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.
JS version update
Returning inconsistent datatypes is not a best practice. How about
["",-1]
if there are no interesting substrings?Also, use valid input and appropriate datatypes. Why give us a space-separated string when you can give us an array of strings? Every solution starts by splitting on whitespace and lowercasing everything ( not necessarily in that order ), but neither of these is the essence of the task.
Random tests needed.
This comment is hidden because it contains spoiler information about the solution