Two Pointers Questions Leetcode Javascript Practice