Skip to content

Commit

Permalink
Time: 1 ms (86.48%), Space: 40.4 MB (11.24%) - LeetHub
Browse files Browse the repository at this point in the history
  • Loading branch information
techabhi08 committed Oct 3, 2023
1 parent 4d40792 commit b0ecbf1
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions 1512-number-of-good-pairs/1512-number-of-good-pairs.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
class Solution {
public int numIdenticalPairs(int[] nums) {
int ans = 0;
for(int i = 0; i < nums.length; i++){
for(int j = i + 1; j < nums.length; j++){
if(nums[i] == nums[j]){
ans++;
}
}
}
return ans;
}
}

0 comments on commit b0ecbf1

Please sign in to comment.