Two Pointer Algorithm Javascript Interviewbit