Dr. Strange's powers
Easy Accuracy: 29.13% Submissions: 624 Points: 2

Dr. Strange has developed some new powers since he has started programming. Now if a villan throws a 1 at him, he absorbs it and add it to his already existing binary string s. There are n villans and each of them throws a '1' at him. At each point you have to detemine the resulting string s.

Input:
First line of input contains n denoting the number of enemies. Each of the next n lines contain an integer l and a string s denoting the length of the existing binary string and the string itself.

Output:
For each of the n lines print a string denoting the resulting binary string at each steps.

Constraints:
1 <= n <= 20
1 <= l <= 100

Example:
Input:
2
4
1010
5
11100

Output:
1011
11101

Explanation:
For test case 1 : 1010+1 = 1011 as he absorbs 1 and add to the existing string

to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.