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.
For those stuck, do not forget to draw the rails out. Example's string at rails 8+ may be tricky to decode, depending on the algo. Once passed unit tests, I found the edge cases' decoding strings confusing to read, so i generated my own (google rail fence cipher crypto corner).
for decoding, break it down. and reverse engineer. start with the rails (arrays) needed. then lengths of each rail. for my process, lots of shifting and pushing.
For those stuck on final tests, console.logging the input field helps to visualize the layouts. Simple but oft forgotten.
My apologies. What i wrote was confusing. In my approach, you do not compare y and z from the same x, because—like you mentioned—z will always be greater than y.
But y is > than z per different indices.
This comment is hidden because it contains spoiler information about the solution
For those stuck, try brushing up on nested reducers and / or using recursion.
For those stuck, i found it helpful to visualize whats happening with a pen and paper.
Great exercise to sharpen the sort() skills.
This kata may throw you off if you are not used to Big O challenges. Just keep in mind, solution shouldn't be any longer than O(n) and, if you've been stuck for a long time, you are probably overthinking it. The solution to your 1200 ms timeout is much simpler than you may perceive. GL
for those struggling, i feel ya. If you need a hint, look up Kadane's algorithm.
your pompous nature is unwelcomed.
This comment is hidden because it contains spoiler information about the solution