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.
I mean he could have just constructed a new array with the length of 100 and added 1 to each element to get up to 100 and then used the reduce method, but as you can probaly already tell that's way more work than just hard-coding the 5050. I did something similar in my code
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
You're just out here providing high quality information for free brother 💞
Look at the tests: it is covered but with a tolerance. You were lucky of having this tolerance because if there is no moves the speed is zero.
This comment is hidden because it contains spoiler information about the solution
conversion to String is needed to use the method reverse
good point
Fixed the description to narrow down possibility of interpretations.
"working on string" is slow if done incorrectly. Concatenation in a loop is an antipattern leading to performance issues, because it copies and recreates new string on every itetration.
Having said that, it should not be treated as any kind of guideline, because JS runtimes can (and do) perform some magic behind the scenes to improve performance. It can happen that concatenation in a loop will be optimized and transformed into some stringbuilder-ish equivalent.
Follow up reading: https://stackoverflow.com/questions/51185/are-javascript-strings-immutable-do-i-need-a-string-builder-in-javascript
Because it doesn't work in Node: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll
kata author do not assign rank! (also note that 7 kyu problems which you are facing were approved long time ago so, there will be some difficulty gap between old and new kata (i.e old 5 kyu = new 6 kyu))
No response after a week, and it can't be reproduced, closing.
/
is one of the banned characters and the anticheat doesn't distinguish if it's used as division or as a comment.Loading more items...