Arrange a binary string to get maximum value within a range of indices
Given a string consisting of only 0's and 1's. Now you are given N non-intersecting ranges L, R ( L <= R), more specifically [L1, R1], [L2, R2], ..., [LN, RN], No two of these intervals overlap â formally, for each valid i, j such that i!=j, either Ri<Lj or Rj<Li. The task is to find a vali