//function for problem
int maxSubarrayXOR(int arr[], int n) 
{ 
    int ans = INT_MIN;     // Initialize result 
  
    // Pick starting points of subarrays 
    for (int i=0; i<n; i++) 
    { 
        int curr_xor = 0; // to store xor of current subarray 
  
        // Pick ending points of subarrays starting with i 
        for (int j=i; j<n; j++) 
        { 
            curr_xor = curr_xor ^ arr[j]; 
            ans = max(ans, curr_xor); 
        } 
    } 
    return ans; 
} 