알고리즘 풀이/Codility
codility - Counting Elements (PermCheck)
배게
2019. 12. 10. 14:11
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 |