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.
1.)
punctuation.indexOf(pin) === 0
is your problem because it attempts to find the whole pin in the punctuation array. For example it tries to find.234
in the array instead of.
.2.)
isNaN(pin)
will work on a string of digits that contains a letter because that can be converted to bases such as hexadecimal. You need to check if any letters are in the string.This comment is hidden because it contains spoiler information about the solution
Got it! Thanks so much :)
It terminates because of an infinite loop when
a > b
.Try with the following cases
This comment is hidden because it contains spoiler information about the solution