Skip to content

Commit

Permalink
Merge pull request ashvish183#11 from Ks103/main
Browse files Browse the repository at this point in the history
Added new c++ code
  • Loading branch information
ashvish183 authored Oct 3, 2023
2 parents c9014cd + a28a249 commit 3432d73
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Number of Good Pairs.c++
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
class Solution {
public:
int numIdenticalPairs(vector<int>& nums) {
int res=0;
for(int i=0;i<nums.size();i++){
for(int j=i+1;j<nums.size();j++){
if(nums[i]==nums[j]){
res++;
}
}
}
return res;
}
};

0 comments on commit 3432d73

Please sign in to comment.