LeetCode 961. N-Repeated Element in Size 2N Array
[C++/Java/Python]4linesO(1)O(1)Solution1Usearrayorsetandreturnseennumberatonce.O(N)time,O(N)spaceJava,usearraypublicintrepeatedNTimes(int[]A){int[]count=newint[10000];for(inta:A)if(count[a]++==1)retur