Two Pointer Algorithm Python Code Practice