Given an N bit binary number, find the 1's complement of the number. The ones' complement of a binary number is defined as the value obtained by inverting all the bits in the binary representation of the number (swapping 0s for 1s and vice versa).
The first line of input takes an integer T, the number of test cases. Then T test cases follow. The first line of each test case takes an integer N, the number of bits. The second line of each test case takes N space separated integers denoting the N bits of the binary number.
Print the 1's complement for each test case in a new line.
1 0 1
0 0 0 1 0
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.