Ad
  • Custom User Avatar

    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!

  • Custom User Avatar

    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 :)