Two Pointer Technique Python Programming