Notice
Recent Posts
Recent Comments
Link
목록Arrays.sort() (1)
개발자는 기록이 답이다

5. 중복 확인 예시 입력 1 8 20 25 52 30 39 33 43 33 예시 출력 1 D 내가 푼 풀이 1 (Time: 790ms Memory: 34MB) 나는 정렬도 HashMap도 안쓰고 그냥 간단하게 풀었다. 시간복잡도가 O(n^2)이다. 하지만 지금 정렬파트를 보고 있으니 정렬로도 연습을 해야 한다. import java.util.Scanner; public class Main { public String solution(int n, int[] arr) { String answer = "U"; for (int i = 0; i < n-1 ; i++) { int tmp = arr[i]; for (int j = i+1; j < n ; j++) { if (tmp == arr[j]) return "D..
알고리즘/인프런 - Java알고리즘 입문
2023. 10. 2. 00:49