Two Pointer Method Leetcode Javascript Questions