There is no real convention, no.
My rule of thumb is that if it makes the code cleaner and easier to read and maintain (this last point being the most important), then use streams. If not, then use normal loop iteration.
This comment is hidden because it contains spoiler information about the solution
not for this task, way too slow
No, it will fail with an ArrayIndexOutOfBoundsException.
ArrayIndexOutOfBoundsException
The power of ES6
Kata says:
Threshold K will always be reachable.
Cool
Wow. It's cool
In case when sum of all numbers < k your code will be execute infinity
If the passed array has no missed letters, your solution will end with ArrayIndexOutOfBoundsException. For instance, ['a', 'b', 'c', 'd', 'e'] -> ' '.
bad performance
Loading collection data...
There is no real convention, no.
My rule of thumb is that if it makes the code cleaner and easier to read and maintain (this last point being the most important), then use streams. If not, then use normal loop iteration.
This comment is hidden because it contains spoiler information about the solution
not for this task, way too slow
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
No, it will fail with an
ArrayIndexOutOfBoundsException
.This comment is hidden because it contains spoiler information about the solution
The power of ES6
Kata says:
Cool
Wow. It's cool
This comment is hidden because it contains spoiler information about the solution
In case when sum of all numbers < k your code will be execute infinity
If the passed array has no missed letters, your solution will end with ArrayIndexOutOfBoundsException.
For instance, ['a', 'b', 'c', 'd', 'e'] -> ' '.
bad performance
Loading more items...