Two Pointer Algorithm Javascript Interview Preparation