Two Pointer Questions Leetcode Problem