You are viewing a single comment's thread. Return to all comments →
In Python 3
n,c,a=int(input()),0,list(map(int,input().split())) for i in range(0,len(a)-1): if a[i]%2!=0 : c=c+2 a[i+1]=a[i+1]+1 print(c if a[-1]%2==0 else '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 →
Simple and easy :-)
In Python 3