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

It's unfortunate that the question isn't itself posed, but I think you're overcomplicating it somewhat (because I think the question/explanation is bad).

The input is in the form Array<Str>, not Array<char>, yet the example is ['a', 'b', 'c', 'd']. By the API, an input could just as easily be ['apple', 'banana', 'cherry', 'durian'] by the types provided.

For this problem, I also think that's a weird clarification, because it doesn't really change how you approach the problem, which should be to construct a hash table keyed by string and whose values are the number of appearances. In python this would end up being something like `return max(collections.Counter(strs).values()) > k`. Whether the strings are single- or multicharacter isn't relevant unless you're doing something weird.



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

Search: