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.
Great code
good solution, but it doesn't check for alpha, now we can pass not only letters!
For example this call in this solution
findMissingLetter(['<','>'])
return us'='
which is not a letter actuallyHave thought in this direction, but had this test error:
“expected: java.util.Arrays$ArrayList<[]> but was: java.util.ArrayList<[]>”
Wierd...
In the filter() you can use only the second condition as it covers the first one as well.
hey thx for help and sorry for late reply
btw is this final solution?
That'll be a different problem and what do you think should be returned there? It's missing "m", "n", "q" and "t"
what if we have array where 2char are missing continusly like this one ['k','l','o','p','r','s','u']
if anyone know how to solve this pls help
This comment is hidden because it contains spoiler information about the solution
O(n * log n)...
We can do better!!))
Good point)
I like your solution. I think PriorityQueue fits very well into the purpose of this kata.
I suggest you to improve your solution by removing the nested class.
WordFreq object doesn't buy you anything, you just duplicate the data from map entries.
Add them to the entries to the queue directly instead.
This comment is hidden because it contains spoiler information about the solution
It is mentioned in the question that sorting should not be used. I would prefer heap over it.
It sure was a clever way, Also the loop runs one time less than all general solutions
Very nice, compact solution. Can you please explain the first collect operation? I am not following the logic of the groupingsBy with the identity and counting.
He is using a filter operation. If he was using the map then you would be correct, the ' would be replaced with nothing and his test would fail. But the filter only checks the condition, it does not modify the input.
Loading more items...