You are viewing a single comment's thread. Return to all comments →
string fairRations(vector B) {
int res = 0; // size1 = sizeof(B)/sizeof(B[0]); for(int i = 0; i < B.size()- 1; i++){ if(B[i] % 2 == 1){ B[i+1]++; res+=2; } } return B[B.size() - 1] % 2 == 0 ? to_string(res) : "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 →
string fairRations(vector B) {
}