-
OddOccurrencesInArrayStudy/알고리즘 2018. 1. 11. 15:49
점수 : 80 / 20 = 55% ㅡ_ㅡ
public static int soludtion(int[] A){ int result = 0; int index = 0; int searchTarget = 0; while(true){ searchTarget = A[index]; int dupCnt = 0; for(int i = 0; i< A.length; i++){ if(searchTarget == A[i]){ dupCnt++; } } if(dupCnt < 2){ result = searchTarget; break; } index++; } return result; }
'Study > 알고리즘' 카테고리의 다른 글
PassingCars (0) 2018.01.12 CountDiv (0) 2018.01.12 MaxCounters (0) 2018.01.12 MissingInteger (0) 2018.01.12 FrogRiverOne (0) 2018.01.12 PermCheck (0) 2018.01.11 PermMissingElem (0) 2018.01.11 FrogJmp (0) 2018.01.11 CyclicRotation (0) 2018.01.11 BinaryGap (0) 2018.01.11 댓글