
import Foundation
func solution(_ clothes:[[String]]) -> Int {
	// 옷의 종류와 갯수 저장
    var dic = [String : Int]()
    var sum = 1
    
    for i in 0..<clothes.count {
        dic[clothes[i][1]] = (dic[clothes[i][1]] ?? 0) + 1
    }
    
    for (key, value) in dic {
    	// 각각 옷의 갯수에 +1을 하고 곱한다
        sum *= (value+1)
    }
    
    if dic.count == 1 {
        return clothes.count
    } else {
    	// 아무것도 입지 않는 경우는 없기에 -1을 해준다
        return sum - 1
    }
}