mirror of
https://github.com/devenperez/leetcode.git
synced 2026-06-13 14:57:08 +00:00
Time: 27 ms (97.27%), Space: 13.8 MB (52.11%) - LeetHub
This commit is contained in:
@@ -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
|
||||||
Reference in New Issue
Block a user