Given two binary string of unequal lengths A and B, the task is to print the binary string which is the XOR of A and B.
Input: A = “11001”, B = “111111”
Input: A = “11111”, B = “0”
Approach: The idea is to first make both the strings of equal length and then perform the XOR of each character one by one and store it in the resultant string.
Below is the implementation of the above approach:
- Sort an array of strings according to string lengths
- Sort an array of strings according to string lengths using Map
- Add n binary strings
- Program to add two binary strings
- Bitwise OR of N binary strings
- Bitwise AND of N binary strings
- Generate all the binary strings of N bits
- Generate all binary strings without consecutive 1's
- Generate all binary strings from given pattern
- Count numbers in range such that digits in it and it's product with q are unequal
- Count of non-overlapping sub-strings "101" and "010" in the given binary string
- Count binary strings with twice zeros in first half
- Count number of binary strings without consecutive 1's
- Number of sub-strings in a given binary string divisible by 2
- Number of binary strings such that there is no substring of length ≥ 3
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.