Two Pointer Algorithm Python Code For Game