Ad
  • Custom User Avatar

    IMHO This is readable but bad performance wise.
    IndexOf & lastIndexOf iterate over all elements in the array. Therefore, this will have a quadratic time look-up since the function is looking at a every index in the array 3 times.

  • Custom User Avatar

    Tests seem to be broken.
    I keep getting expected [ undefined ] to deeply equal [ 1, 2, 3, 7, 16, 17 ] even though I am returning the array in the correct order