You are viewing a single comment's thread. Return to all comments →
hello, your algo is nice! however I;ve noticed that there is one redundant operation
for(int i = 0; i<N; i++){ if(B[i] % 2 != 0){ B[i] = B[i] + 1; <===== you don't need to add +1 to current element since you will never comeback here. B[i+1] = B[i+1] + 1; count+=2; }
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 →
hello, your algo is nice! however I;ve noticed that there is one redundant operation