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 using Map
- Sort an array of strings according to string lengths
- Add n binary strings
- XOR of two Binary Strings
- Bitwise AND of N binary strings
- Bitwise OR of N binary strings
- Program to add two binary strings
- Generate all the binary strings of N bits
- Generate all binary strings from given pattern
- Generate all binary strings without consecutive 1's
- Count numbers in range such that digits in it and it's product with q are unequal
- Count number of binary strings without consecutive 1's
- Number of sub-strings in a given binary string divisible by 2
- Count of non-overlapping sub-strings "101" and "010" in the given binary string
- Count binary strings with twice zeros in first half
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.