프로그래밍/기타
2021. 1. 14.
프로그래머스 - 위장 (C#)
using System.Linq; using System.Collections.Generic; public class Solution { public int solution(string[,] clothes) { Dictionary wearDic = new Dictionary(); for(int i = 0; i < clothes.GetLength(0); i++) { if(!wearDic.ContainsKey(clothes[i, 1])) wearDic[clothes[i, 1]] = new List(); } for(int i = 0; i < clothes.GetLength(0); i++) wearDic[clothes[i, 1]].Add(clothes[i, 0]); int answer = 1; foreach (..