classSolution {publicintminFlipsMonoIncr(String s) {int flips =0;int ones =0;for (char c :s.toCharArray()) {if (c =='1') { ones++; } else {if (ones !=0) { flips++; } }if (flips > ones) { flips = ones; } }return flips; }}/*so the last skill is to flip all 1others see if we have a better solution?from end to fix 0?00110if all zero..pass2 case -> 1. cur is zero, and after one, so needs flip2. flip is over ones -> means we can just flip ones' coount*/