Leetcode Two Pointer Approach In Python Iteration