Skip to content

Commit 6c150ac

Browse files
committed
Time: 0 ms (100%), Space: 35.2 MB (19.05%) - LeetHub
1 parent 0fdd1c2 commit 6c150ac

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class Solution {
2+
fun numIdenticalPairs(nums: IntArray): Int {
3+
val freqArr = IntArray(101)
4+
var count = 0
5+
for(num in nums){
6+
count += freqArr[num]
7+
freqArr[num]++
8+
}
9+
return count
10+
}
11+
}

0 commit comments

Comments
 (0)