Leetcode Two Pointer Approach In Python