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.
Have 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.
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.
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.
Because ' or ''' is invalid.
I dont really get streams right now
so one question:
why u replace ' with nothing? wouldn't be won't to wont?
which in the test is not correct
The description should mention that
]
jumps back only when the value under the pointer is1
(as it's mentionned in the brainfuck kata -- I failed constantly before I realised that...).Also, references and comparisons to brainfuck (and the predefined transpiler) could be removed, as they are not much use here.
Cheers
I agree, comparing and referring to brainfuck is of not much use. The same stands for the
brainfuck_to_boolfuck()
interpreter (used 0 times in the 80+ python solutions). So it could be safely removed.That was it thank you!!! Seems weird that it would happen even when the print statements were commented out, but whatever.
The problem is that CW do not support printing of unicodes when using python, even if python itself can handle them. So what are facing here (I believe) is that your code return a wrong result, this result raise an error that is printed in the console, and that cause the failure. And changing the output will not solve anything because the expected answer will still be displayed.
But what's "cool" in that, is that you still get the expected value in the failure message when you return the empty string... ;) So now, you just have to correct your code.
Loading more items...