Two Pointer Array Problems Geeksforgeeks Python