Two Pointer Approach Leetcode Javascript Questions