Ad
  • Custom User Avatar

    At least in JavaScript this would be counterproductive. NodeJS doesn't support TCO.

    It's a nice idea, but even for languages that support TCO, the description should then state that as a constraint, and the ranking would be higher.

  • Custom User Avatar

    You should add a test for a rather large list, so that solutions that are not tail-recursive produce stack overflows.

  • Custom User Avatar

    This is not tail recursive, and as such is not optimized well. If the list is long, you'd end up with a stack overflow.

  • Default User Avatar

    In your daily programming, whether for work or for leisure, you should always strive to have function return types that make sense. If your function returns an array, then don't return false in the event of an error. Similarly, if your function returns true in one case, it should return false otherwise. Be consistent.

  • Custom User Avatar

    That's still a fragment an is in no way verifiable to check for. The slash is only a convention. There is nothing preventing a page from doing navigation from index.html#pathgoeshere (and several of my pages does this).

  • Custom User Avatar

    Test for links with multiple #-signs.

  • Custom User Avatar

    This would fail if your url had multiple '#' (totally legal as far as I know).

  • Custom User Avatar

    The description never specified that I should return false if there was no duplicates, and failed me for returning undefined.