Two Pointer Algorithm Python Template Code