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.
Codewars is also here to showcase actual best practices and this is one of the rare cases where the votes match.
ehehe I like it
This comment is hidden because it contains spoiler information about the solution
It certainly looks elegant and functional, but I dug deeper into how Sequence works and how effective they are for small sets or sequences. As a result, using the measureTimeMillis function, I found that executing generateSequence with subsequent processing takes from 5 to 13 seconds. While if you use "do{}while(...)" or just "while" it takes 0 seconds. From this we can conclude that although Sequence is very concise and saves us from mutability and temporary variables, we still need to be careful when using them for such tasks.
I think this is clever but definitely not best practice.
could i ask how one would go about learning about functions that can do this stuff because this is the first time ive encountered it
How to make the oper function accepts only methods of Opstrings?
worst solution. this is
codewars
, you should write your own logic and not use existing solution.take():
Returns a string containing the first n characters from this string, or the entire string if this string is shorter.
example:
"Hello World".take(5) would be "Hello"
what is .take() function?
sumBy is deprecated use sumOf
This comment is hidden because it contains spoiler information about the solution