728x90
https://leetcode.com/problems/n-repeated-element-in-size-2n-array
class Solution:
def repeatedNTimes(self, nums: List[int]) -> int:
for i in nums:
if nums.count(i) > 1:
return i
return -1
728x90
'IT > 코딩테스트' 카테고리의 다른 글
[Leetcode] 2864. Maximum Odd Binary Number (0) | 2024.03.08 |
---|---|
[Leetcode] 876. Middle of the Linked List (0) | 2024.03.07 |
[Leetcode] 2670. Find the Distinct Difference Array (0) | 2024.03.07 |
[Leetcode] 1207. Unique Number of Occurrences (0) | 2024.03.06 |
[Leetcode] 1941. Check if All Characters Have Equal Number of Occurrences (0) | 2024.03.05 |