diff --git a/1512-number-of-good-pairs/1512-number-of-good-pairs.py b/1512-number-of-good-pairs/1512-number-of-good-pairs.py new file mode 100644 index 0000000..2bc84df --- /dev/null +++ b/1512-number-of-good-pairs/1512-number-of-good-pairs.py @@ -0,0 +1,10 @@ +class Solution: + def numIdenticalPairs(self, nums: List[int]) -> int: + count = 0 + + for i in range(len(nums)): + for j in range(i + 1, len(nums)): + if nums[i] == nums[j]: + count += 1 + + return count \ No newline at end of file