2's Complement
Submissions: 1895   Accuracy:

30.88%

  Difficulty: Basic   Marks: 1

For a given string of binary number find the two’s complement of it.

Input :
The first line contains an integer 'T' denoting the total number of test cases.The next T lines contains the string S.

Output:

In each separate line the two’s complement string should be output.

Constraints:
1<=T<=30
1<=lenght(string)<=10

Example:
Input:
1
00000101

Output:
11111011

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

Author: abhiraj26


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.