Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
what language?
I'm with you. The question is very poorly phrased. If you notice the {} in the expected values you might think of a dictionary. And you'd be right. So just return a dictionary. It's pretty stupid.
The actual algorithmic part of this question is not very difficult, but I have a problem getting the return type to be correct. How do I return an object the way that the question wants? My understanding was that returning an object does something like " object at instance, etc".
This is true but it is not the only reason it is not optimal. As the comment above yours said, sorting takes klog k time (where k is the length of a word) which means that the total runtime will be n*klogk. Using a dictionary, for example, will only take nk time.
Yea this answer is defintiely not correct. A counter example is ['n','n','n','n','s','s','s','e','w','w']