[Codiliy]OddOccurrencesInArray
[문제] [답안작성] class Solution { public int solution(int[] A) { Set tempSet = new HashSet(); for( int a : A ) { if( tempSet.contains( a ) ) { tempSet.remove(a); } else { tempSet.add(a); } } return tempSet.iterator().next(); } }
Development/알고리즘
2020. 6. 27. 19:15