PermCheck
https://app.codility.com/programmers/lessons/4-counting_elements/perm_check/ PermCheck coding task - Learn to Code - Codility Check whether array A is a permutation. app.codility.com 1~N까지 중복된 숫자가 없는 순열인지 체크하는 문제 주어진 배열을 정렬하고 인덱스값과 비교하는 방법이 먼저 떠올랐는데 굳이 정렬하지 않고 중복 체크 + 범위 체크정도만 해도 풀릴것 같았다. class Solution { public int solution(int[] A) { boolean[] check = new boolean[A.length+1]; for (int a : A) {..
코딩테스트/codility
2023. 9. 29.