Two Pointer Technique Leetcode Problems On Java