[프로그래머스] 완주하지 못한 학생
import java.util.*; class Solution { public String solution(String[] participant, String[] completion) { String answer = ""; HashMap map = new HashMap(); for(String s: participant){ map.put(s, map.getOrDefault(s, 0)+1); } for(String s: completion){ map.put(s, map.get(s)-1); } for(String player: map.keySet()){ if(map.get(player)!=0){ answer = player; break; } } return answer; } }