XOR of all substrings of a given Binary String
Given a binary string str of size N, the task is to calculate the bitwise XOR of all substrings of str. Examples: Input: str = "11"Output: 11Explanation: The substrings of "11" are: 1, 1, and 11.Their XOR = 1 ⊕ 1 ⊕ 11 = 11 Input: str = "110"Output: 111Explanation: The substrings of 110 are: 1, 1, 0,