Company: Salesforce_28thjuly
Difficulty: medium
In a Salesforce environment, the customer interaction logging service keeps a fixed-size array of interaction counters. To make historical lookups cheaper, the service periodically folds the array onto itself with a bitwise transformation. You are given an array log of n non-negative integers (0-indexed) and a number of transformation cycles iterations . The log is updated by performing the following step once for every i from 0 to iterations - 1 , in increasing order of i : Compute the current position i1 = i % n . Compute the symmetric position i2 = n - (i % n) - 1 . Set log[i1] = log[i1] XOR log[i2] , where XOR is the bitwise exclusive-or. Every step reads the current contents of the array, so a step sees all the changes made by the steps before it. When i1 equals i2 (only possible when n is odd), the entry is XOR-ed with itself. Print the array after all iterations steps have been applied. Input Format The first line contains a single integer n , the length of the log. The second l