You are viewing a single comment's thread. Return to all comments →
int bread=0; for(int i=B.size()-1;i>=0;i--){ if(B.stream().allMatch(e->e%2==0)){ return String.valueOf(bread); }else if(B.get(i)%2!=0 && i-1>=0){ B.set(i, B.get(i)+1); B.set(i-1, B.get(i-1)+1); bread +=2; } } 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 →
Java