Two Pointers Question On Leetcode Problems Python