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.
To be honest, your solution outsmarted mine. I have to admit that i didn't even think of this solution, and if I had, I would've gone for it definitely. I went for the complex regex right away LOL!
To my defense, and despite this not being the case, I have to say that the regex solution would be the best practice in a production env for example, where you don't know whether the protocols / domains are likely to change or not. But, of course, the kata didn't specify any of that sooo GGs well played haha.
Keep it simple!
Well.. it turns out that in javascript you can perform indexOf and lastIndexOf on arrays... coming from java that's new to me so i could have one lined this one.. saad :)