
내 코드 (틀림) import java.util.*; class Solution { public int solution(String[][] clothes) { int answer = 0; HashMap map = new HashMap(); for(String[] s : clothes) { map.put(s[1], map.getOrDefault(s[1], 0) + 1); } if(map.size() == 1) { answer = clothes.length; } else { answer = clothes.length + map.size(); } return answer; } } 내가 생각한 흐름은 이랬다. 1. 그냥 로해서 HashMap 만듦 (7번째 줄) 2. 얘네 카운트해줌 (9-10번째 줄) 3. 만약..