You are given an Array A of size N and an integer N.
Find the minimum vale K such that the number of subarrays of A having XOR value of at most K is atleast X.
4 7 1 2 3 4
4
Given number of subarrays to be atleast 7, i.e. X = 7.
So if we select the value for K to be 3, number of subarrays of A having XOR value atmost 3 is 6.
If we select the minimum value for K to be 4, number of subarrays of A having XOR value atmost 4 is 8.
So, the minimum value of K for which number of subarrays of A is atleast 7, each of which have XOR value of atmost K is 4.
Given an subarray A of size N, you need to find a triplet say Ai, Aj, Ak with maximum sum which respects following two conditions :-
This problem is almost same as Mock Interview - II !