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.
Is performing a filter followed by a reduce less efficient than processing everything within a single reduce?
This is a 2 dimensionnal array.
First mapping, iterate each row (or line) and after mapping each row (or line), to change 'X' element to '*'
DRY
DRY not friendly
nice result, i totally forgot to DRY, thanks for the reminder
Worst time complexity solution, sorting and filter all the array element, so many iterations before get result ....
This comment is hidden because it contains spoiler information about the solution
I dont believe time complexity was good with this solution, because first you sort all array, and after, you check all number from first to last, you can do exactly the same thing without sorting input array (just wath behind solution). So i really think sorting is useless here.
This comment is hidden because it contains spoiler information about the solution
+1 not clever and not best practice
I don't think it was best practice because mutating original array is not a good practice
Code Duplication Warning
Return a new Array, but the original array is lost
+1 don't mutate original array
In Array.from method, second argument, after array length, is a map function, you can apply directly yur mapping, you don't need to call another map function.
Loading more items...