Given an array of N elements , You need to find subarray of size Z , XOR of whose elements is minimum.If multiple such subarrays exist,Choose the subarray whose starting Index is Maximum. Print the start Index of that subarray.
Input Format:
First line of the input will have T (number of test cases). Then for each test case first line will have two integers N and Z. The second line will have a list of N space separated integers denoting the Array values (Array is denoted by A).
Output Format: For each test case, output a single integer denoting starting Index of Subarray.
Input Constraints:
\(1 \le T \le100 \)
\(1 \le Z \le N \le10^4\)
\(1 \le A_i \le10^{12} \)
Cost in shops 1 and 2 : 1 XOR 2 = 3
Cost in shops 2 and 3 : 2 XOR 3 = 1
Since cost from shop 1 to 2 is more than those in shop 2 to 3, Milly should start shopping from shop number 2 itself.
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor
Login to unlock the editorial
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor