Two Pointer Array Problems Leetcode Solutions Java