Skip to content

Commit 4ca12f3

Browse files
committed
Solution to the problem 1512 vJechsmayr#588
1 parent 4e6e98c commit 4ca12f3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

LeetCode/1512_Number_of_Good_Pairs.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
class Solution:
2+
def numIdenticalPairs(self, nums: List[int]) -> int:
3+
ans = 0
4+
for i in range(0, len(nums)):
5+
for j in range(0, len(nums)):
6+
if(nums[i] == nums[j] and i < j):
7+
ans += 1
8+
return ans

0 commit comments

Comments
 (0)