You are viewing a single comment's thread. Return to all comments →
Go solution pretty simple
dic := make(map[string]int) for _, n := range magazine { dic[n]++ } for _, n := range note { if val, ok := dic[n]; !ok || val == 0 { fmt.Println("No") return } else { dic[n]-- } } fmt.Println("Yes") }
Seems like cookies are disabled on this browser, please enable them to open this website
Hash Tables: Ransom Note
You are viewing a single comment's thread. Return to all comments →
Go solution pretty simple