Leetcode 1001 Solution
This article provides solution to leetcode question 1001 (n-repeated-element-in-size-2n-array)
Access this page by simply typing in "lcs 1001" in your browser address bar if you have bunnylol configured.
Leetcode Question Link
https://leetcode.com/problems/n-repeated-element-in-size-2n-array
Solution
class Solution:
def repeatedNTimes(self, A: List[int]) -> int:
c = collections.Counter(A)
return [v for v in c if c[v] > 1][0]