Level2) 위장
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 import java.util.*; public class Level2_위장 { public static int solution(String[][] clothes) { Map map = new HashMap(); for (String[] str: clothes) { String key = str[1]; map.put(key, map.getOrDefault(key, 0) + 1); } int answer = 1; for (int value : map.values()) { answer *= (value + 1); } return answer - 1; } public static void ma..
2021.05.03