Maximize Active Section with Trade II
Apply the one-trade rule, which turns a block of ones between zeros into zeros and then a block of zeros between ones into ones, to a query substring with an uncounted one added at each end. For each independent query, return the most ones the whole string can hold after a trade inside that substring.