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.
It doesn't says both are valid, it says one digit can belong to two adjacent digit-pairs.
For that string your code should return false, as the similar sample test shows.
I solved the kata in JavaScript, so I am able to see your code. Your code passes the first sample tests, but fails in some of the series
for example
I don't think it works fine in VSC either.
This means you are using too much memory (you are probably building a gigantic array or something like this, or a part of your code keeps pushing value into something and never stops), and it is not a kata issue.
Advice: your
while
loop is probably the culprit. You are probably not testing your code with the same input in VSC as here. Please refer to the documentation: https://docs.codewars.com/training/troubleshooting/