Leetcode Two Pointer Technique Python