[프로그래머스] 42862번 - 체육복 [Java]
·
프로그래머스
프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr 문제 제출한 코드import java.util.Arrays;class Solution { public long solution(int n, int[] lost, int[] reserve) { int[] student = new int[n+2]; student[0] = -1; student[n+1] = -1; Arrays.sort(lost); Arrays.sort(reserve); // 잃어버린 학생 = 1 / 체육복이 있는 학생 = 0 / 배열의 맨앞뒤 = -1 f..