Company: Experian_1july
Difficulty: medium
Circular Difference Problem Description You are given a circular array A having N elements. You replaced each element by the absolute difference of the two adjacent elements. Calculate the final array B, and print sum(B[i] XOR i) 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 = [1,1,1]. B = [0,0,0]. Answer = 0+1+2 = 3. Example 3: Input: 2 1 5 Output: 1 Explanation: N