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.
Very nice kata!
In Scala, definition name inside the Writer companion object should be changed to writerMonad.
Finding the minimum and maximum element in an array has O(n) time complexity, whereas sorting the input takes O(n log(n)). So yes, it will be noticeably faster for larger arrays.
B-but what if I've drunk 11 beers?
Couldn't figure it out for quite some time, but after I've finally done this, I feel relieved.
You're right. Sorry for the confusion. I'm relatively new to JS and I didn't expect such behaviour.
It seems like Javascript test cases are broken. For input d = 'R' and a = [13,2,4,7,93], it expects [13, 2, 4, 7, 93], which is clearly wrong answer. I managed to solve the kata with the same concept using python and all test cases passed.
num => num match { ... } inside a map method can be simplified to just num match { ... }
It's not an issue. You have a whitespace character at the end of the string.
This is probably an issue. Random tests in scala pass only when the length of the array is 10.
Couldn't come up with a O(1) solution, but still managed to solve it somehow. Great kata!
Are we supposed to modify test class or should we touch only the Kata object?
Can someone fix it? It looks like the issue is present since at least 5 months already.
What are we supposed to return in this case? E.g. we have List(1,2,3) - what is the correct answer? 1 * 2?