Company: Experian_1july
Difficulty: medium
Circular Difference Problem Description You are given a circular array A holding N elements, where the element before index 0 wraps around to index N-1 and vice versa. Build a new array B by replacing every element with the absolute difference between its two neighbors in the circle. Then output sum(B[i] XOR i) taken modulo 10^9 + 7. Function description Complete the circularArray function in the editor below. It has the following parameter(s): Name: A Type: INTEGER ARRAY Description: given array A having N elements Return: INTEGER denoting the sum(B[i] XOR i) modulo 10^9 + 7 Input format for debugging The first line contains an integer, N, denoting the number of elements in A. Each line i of the N subsequent lines (where 0 ≤ i < N) contains an integer describing A[i]. Examples Example 1: Input: 3 1 2 3 Output: 7 Explanation: N = 3. A = [1,2,3]. B = [|3-2|, |1-3|, |2-1|] = [1,2,1]. sum(B[i]xor i) = 1^0 + 2^1 + 1^2 = 7. Example 2: Input: 3 1 1 1 Output: 3 Explanation: N = 3. A = [