Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b260f47

Browse files
Create 1512. Number of Good Pairs.java
1 parent d966e9c commit b260f47

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
class Solution {
2+
public int numIdenticalPairs(int[] nums) {
3+
int pair = 0;
4+
for(int i = 0; i < nums.length; i++){
5+
for(int j = i+1; j < nums.length; j++){
6+
if(nums[i] == nums[j]){
7+
pair++;
8+
}
9+
}
10+
}
11+
return pair;
12+
}
13+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /