MCPcopy Create free account
hub / github.com/Vishruth-S/CompetitiveCode / Solution

Class Solution

LeetCode_problems/Number_of_good_pairs/solution.cpp:11–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9
10
11class Solution {
12public:
13 int numIdenticalPairs(vector<int>& nums) {
14 int count=0;
15 for(int i=0;i<nums.size()-1;++i){
16 for(int j=i+1;j<nums.size();++j){
17 if(nums[i]==nums[j]){
18 count+=1;
19 }
20 }
21 }
22
23 return count;
24 }
25};
26
27
28// solution 2

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected