3 ms·
> I'd appreciate any advice on my solution. You should always compare your results to what is expected. For a problem like this, use a small set of test data t
by shill 13y ago
> I'd appreciate any advice on my solution.
You should always compare your results to what is expected. For a problem like this, use a small set of test data that can easily be counted and sorted in your head or on paper.
You forgot reverse=True and your results show the 10 least common words. ;)
This kind of error happens to all of us. That's why we have unit tests and QA teams. If you made this mistake during an interview I wouldn't give it much importance and we would have a good laugh about it.
- spenuke 13y agoHa, nice! Funny you should mention that. I did exactly that when tooling around in the repl and forgot the reverse kw, saw something fishy, and fixed it. Promptly forgot it again when I typed it in this comment. :)