题目:
The only difference between easy and hard versions is the length of the string. You can hack this problem only if you solve both problems.
Kirk has a binary string s (a string which consists of zeroes and ones) of length n and he is asking you to find a binary string t of the same length which satisfies the following conditions:
- For any l and r (1≤l≤r≤n) the length of the longest non-decreasing subsequence of the substring slsl+1…sr is equal to the length of the longest non-decreasing subsequence of the substring tltl+1…tr;
- The number of zeroes in t is the maximum possible.
A non-decreasing subsequence of a string p is a sequence of indices i1,i2,…,ik such that i1<i2<…<ik and pi1≤pi2≤…≤pik. T