Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

HashMap<int, HashSet<string>> - you meant to say Multimap right? :)


Out of the 200 or so people I interviewed where I posed this question, only one went with Multimap.

You’re hired. :)

Kidding aside, going with a map of string lists as a first iteration of a solution for this is perfectly fine. The followup is to optimized the algo for space and time, and there are intuitive steps if you implement it as a map of lists.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: