Recent Posts
Recent Comments
목록체유복 (1)
밍쎄의 코딩공간
프로그래머스 LV.1 - 체육복
import java.util.HashSet; class Solution { public int solution(int n, int[] lost, int[] reserve) { int answer = 0; HashSet resSet = new HashSet(); HashSet loSet = new HashSet(); for(int i: reserve) { resSet.add(i); } for(int i: lost) { if(resSet.contains(i)) { resSet.remove(i); } else { loSet.add(i); } } for(int i: resSet) { if(loSet.contains(i-1)) { loSet.remove(i - 1); } else if(loSet.contains..
프로그래머스/프로그래머스 LV.1
2023. 8. 13. 22:26