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.
🙏
Thank you, this is a good point.
Thank you, your advices has a sense.
Foreach
here would be perfect choice.Reduce
is also an option, but as with amap
case, there will no further chaining afterreduce
, so it would be not so much neccessery.Solution with
map
+join
is also a good case, so we can get rid ofresult
variable. But in this case we additionally need to handle empty string scenario:return ......map().join('') || '';
You can use an array instead of number-indexed object
marray.length/2 is repeated 3 times, maybe it would be better to add variable.
Imho this kata should be greater then 6 kyu.
If the string does not match regexp return null
null || [] returns [];
It might be better if you move compare cur and max to else block. Then this compare goes only when chain breaks. Now compare goes for each vowel.
It would be better to do just single replace call with function as argument.
another way n/v ^ 0
I think break isn't necessary here. Return is enough.
Looks clean, great approach! But indexOf + lasIndefOx calls count make perfomance side not so good.
break doesn't needed here
Why we need to add plants if we can just add one plant for even quantity and two for odd and wait till plants quantity became needed? If i understand correctly there is no time limit in this task.
empty object isn't neccessary here
Loading more items...