Ad
  • Custom User Avatar

    Why are you sorting? In javascript sort modifies the array in place, and you shouldn't sort at all.

    Your task is to return the first longest string consisting of k consecutive strings taken in the array.

    So in case of a tie, you should return the first one.