Back to course home
0% completed
Vote For New Content
Python solution using Counter
Toni Dezman
May 17, 2025
from collections import Counter class Solution: def numGoodPairs(self, nums): seen = Counter() res = 0 for num in nums: res += seen[num] seen[num] += 1 return res
0
0
Comments
Comments
On this page