728x90
1 2 3 4 5 6 7 8 9 10 11 12 | public int solution(int[] A) { Arrays.sort(A); int comparativeValue = 1; for (int i = 0; i < A.length; i++) { if (comparativeValue++ != A[i]) return 0; }// return 1; } | cs |
'알고리즘 풀이 > Codility' 카테고리의 다른 글
codility - PassingCars (Prefix Sums) (0) | 2019.12.10 |
---|---|
codility - Counting Elements (MissingInteger) (0) | 2019.12.10 |
codility - Counting Elements (MaxCounters) (0) | 2019.12.10 |
codility - Counting Elements (FrogRiverOne) (0) | 2019.12.10 |
codility - Time Complexity (TapeEquilibrium) (0) | 2019.12.10 |