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.
What a code wall. It takes a lot of space on this discourse page.
Use
[].map.call
on the given stringstr
to map over its characters while avoiding the creation of a possibly big intermediate array of characters.This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
The test cases for the Python translation are not comprehensive enough, allowing brute force solutions which just use a while loop (like mine), whereas to pass the challenge in JavaScript you have to come up with a more mathematical solution.
Therefore, may I suggest either the addition of such test cases to the Python translation, or to adjust the kata description and lower the associated difficulty rating. Because the current 4-kyu rating is probably too high if you can solve the kata using a simple loop.
A solution using generator comprehension instead of list comprehension for more laziness.