Two Pointer Algorithm Javascript Interview Coding Questions