Dr. Strange's powers
Submissions: 605   Accuracy:

29.08%

  Difficulty: Easy   Marks: 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

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: vaibhav garg
Author: justrelax


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.