Leetcode Two Pointer Approach Python 3