Two Pointers Approach In Python