You are viewing a single comment's thread. Return to all comments →
python
def fairRations(B): sum_B = sum(B) for i in range(len(B)-1): while B[i] % 2 != 0: B[i] += 1 B[i+1] += 1 if all(x %2 == 0 for x in B): return str(sum(B) - sum_B) else: return "NO"
Seems like cookies are disabled on this browser, please enable them to open this website
Fair Rations
You are viewing a single comment's thread. Return to all comments →
python