Add coins at even indices to the amount collected by A
mid_odd . sort ( reverse = True ) NEW_LINE for i in range ( len ( mid_odd ) ) : NEW_LINE INDENT if i % 2 == 0 : NEW_LINE INDENT amount = amount + mid_odd [ i ] NEW_LINE DEDENT DEDENT