Two Pointer Problems Interviewbit Python