Two Pointer Approach Leetcode Javascript Practice