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.
lazy boi
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 current rating of this kata is 6 kyu and I don't think changing it is possible once it is published (unless a mod could do it).
Python version has been solved more than 500 times, so adding test cases is not possible.
Javascript version can be solved with a while loop too.
Why didn't you mark your post as a suggestion instead of an issue?
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.
good to know about .find() in es6!! nice one!