You are viewing a single comment's thread. Return to all comments →
Here's similar Python3 code in modern HackerRank, where one defines a function.
def fairRations(B): output, M = 0, len(B)-1 for i in range(M): if B[i]%2 : output += 2 ; B[i+1] += 1 return "NO" if B[M]%2 else output
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 →
Here's similar Python3 code in modern HackerRank, where one defines a function.