
M = 6, N = 6
ANS = “110011001100”
In ans no three consecutive characters are same.
ANS=”001100110011” is also a valid answer.
The first line of input contains an integer 'T’ denoting the number of test cases to run. Then the test case follows.
The first line and the only line of each test case contain two space-separated integers ‘M’ and ‘N’.
For each test case print any binary string ‘S’ satisfying all the conditions.
You don’t need to print anything. It has already been taken care of. Just implement the given function.
1 <= T <= 10
1 <= M+N <= 5000
Time Limit: 1 sec
We will iterate from left to right and check for the remaining numbers of 1’s and 0’s to be added and check if it can be added without violating the constrain.
The algorithm will be-