Company: amazon_23april
Difficulty: medium
Code Question 1 Developers at Amazon are working on a new algorithm using the Bitwise XOR operation. Given an array arr of even length n , Developers can perform an operation on a given array which is defined below as many times as necessary: Choose two indices L and R, where 0 ≤ L ≤ R Let x be the bitwise XOR of all elements of the subarray represented by indices L and R of the given array. Assign all elements of the chosen subarray to x. Given an integer array arr[] , find the minimum number of operations required to make all elements of the given array equal to zero. Note: Bitwise XOR for an array of numbers is determined by examining each bit position across all numbers in the array. If the total count of set bits at a bit-position is odd, the resulting bit in output is set to 1. Otherwise, the resulting bit is set to 0. For example, consider the array [13, 6, 10, 7]. The binary representations are: 13 = 1101 2 6 = 0110 2 10 = 1010 2 7 = 0111 2 The count of set bits for each bit po