See More

连续的subarray,我之前不知道怎么取。 例如 1234567, left = 1.。。k; right = k+1,n, 所以应该也是n^2复杂度 这个是最基本的做法,并没有优化 ``` A Simple Solution is to use two loops to find XOR of all subarrays and return the maximum. // A simple C++ program to find max subarray XOR #include using namespace std; int maxSubarrayXOR(int arr[], int n) { int ans = INT_MIN; // Initialize result // Pick starting points of subarrays for (int i=0; i