title: Find The Maximum Subarray Xor In A Given Array
signature: class Solution {
  
      public Integer findTheMaximumSubarrayXorInAGivenArray(ArrayList<Integer> arr, Integer n) {
source_py: def find_the_maximum_subarray_xor_in_a_given_array(arr, n):
      ans = (- 2147483648)
      for i in range(n):
          curr_xor = 0
          for j in range(i, n):
              curr_xor = (curr_xor ^ arr[j])
              ans = max(ans, curr_xor)
      return ans
source_cpp: int find_the_maximum_subarray_xor_in_a_given_array(vector<int> arr, int n) {
    int ans = INT_MIN;
    for ( int i = 0;
    i < n;
    i ++ ) {
      int curr_xor = 0;
      for ( int j = i;
      j < n;
      j ++ ) {
        curr_xor = curr_xor ^ arr [ j ];
        ans = max ( ans, curr_xor );
      }
    }
    return ans;
  }
question_info.extension: java
question_info.entry_fn_name: findTheMaximumSubarrayXorInAGivenArray
question_info.entry_cls_name: Solution
question_info.test_list: [{"idx": 0, "outputs": 63, "inputs": {"arr": [1, 7, 7, 11, 12, 18, 20, 23, 27, 30, 44, 47, 53, 53, 55, 57, 57, 58, 61, 62, 67, 74, 76, 80, 86, 86], "n": 13}}, {"idx": 1, "outputs": 126, "inputs": {"arr": [-34, -4, 68, -82, 54, 20, 6, -18, -70, 98, -40, 80, -28, 78, 28, 56, 26, 2, 2, -56, -66, 44, 0, -72, 12, 54, -40, 18, 28, -48, -56, 72, 84, 60, 76, 26, -8, 62], "n": 21}}, {"idx": 2, "outputs": 1, "inputs": {"arr": [0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], "n": 12}}, {"idx": 3, "outputs": 33, "inputs": {"arr": [33, 98], "n": 1}}, {"idx": 4, "outputs": 126, "inputs": {"arr": [-92, -80, -76, -76, -74, -58, -44, -38, -34, -32, -30, -24, -20, -18, -4, -2, 2, 8, 44, 52, 52, 56, 70, 72, 80, 80, 98], "n": 15}}, {"idx": 5, "outputs": 1, "inputs": {"arr": [0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0], "n": 33}}, {"idx": 6, "outputs": 127, "inputs": {"arr": [1, 2, 3, 6, 9, 15, 15, 18, 19, 25, 31, 31, 33, 37, 39, 47, 49, 51, 51, 52, 52, 54, 58, 59, 59, 61, 62, 62, 65, 66, 66, 66, 66, 67, 71, 76, 77, 78, 79, 80, 83, 86, 87, 92, 97, 97, 98, 99], "n": 38}}, {"idx": 7, "outputs": 126, "inputs": {"arr": [34, -90, 64, 88, -46, -4, -96, 76, -32, 10, -8, -24, 32, -4, 86, -20, -86, -88, -72, 64, 12, 66, -96, -84, 16, -58, -48, 80, -80, 70, -94, -84, 56, 8, -14, 86, 72, -16, -18, 74, 40, 34, 20, 80], "n": 35}}, {"idx": 8, "outputs": 1, "inputs": {"arr": [1, 1], "n": 1}}, {"idx": 9, "outputs": 127, "inputs": {"arr": [57, 76, 2, 30, 24, 12, 49, 12, 5, 75, 55, 17, 62, 87, 21, 91, 88, 10, 20, 49, 46, 79, 51, 33, 94, 59, 48, 97, 70, 49], "n": 25}}]
question_info.test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(ArrayList<Integer> arr, Integer n, Integer expected){
          try{
              Driver driver = new Driver();
              if (driver.run(arr, n,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution(new ArrayList<>(Arrays.asList(1, 7, 7, 11, 12, 18, 20, 23, 27, 30, 44, 47, 53, 53, 55, 57, 57, 58, 61, 62, 67, 74, 76, 80, 86, 86)), 13, 63);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(-34, -4, 68, -82, 54, 20, 6, -18, -70, 98, -40, 80, -28, 78, 28, 56, 26, 2, 2, -56, -66, 44, 0, -72, 12, 54, -40, 18, 28, -48, -56, 72, 84, 60, 76, 26, -8, 62)), 21, 126);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)), 12, 1);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(33, 98)), 1, 33);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(-92, -80, -76, -76, -74, -58, -44, -38, -34, -32, -30, -24, -20, -18, -4, -2, 2, 8, 44, 52, 52, 56, 70, 72, 80, 80, 98)), 15, 126);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0)), 33, 1);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(1, 2, 3, 6, 9, 15, 15, 18, 19, 25, 31, 31, 33, 37, 39, 47, 49, 51, 51, 52, 52, 54, 58, 59, 59, 61, 62, 62, 65, 66, 66, 66, 66, 67, 71, 76, 77, 78, 79, 80, 83, 86, 87, 92, 97, 97, 98, 99)), 38, 127);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(34, -90, 64, 88, -46, -4, -96, 76, -32, 10, -8, -24, 32, -4, 86, -20, -86, -88, -72, 64, 12, 66, -96, -84, 16, -58, -48, 80, -80, 70, -94, -84, 56, 8, -14, 86, 72, -16, -18, 74, 40, 34, 20, 80)), 35, 126);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(1, 1)), 1, 1);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(57, 76, 2, 30, 24, 12, 49, 12, 5, 75, 55, 17, 62, 87, 21, 91, 88, 10, 20, 49, 46, 79, 51, 33, 94, 59, 48, 97, 70, 49)), 25, 127);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(ArrayList<Integer> arr, Integer n, Integer expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(arr, n),expected);
      }
      
      public boolean validateSolution(Integer actual, Integer expected){
          return actual.equals(expected);
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: java __FILENAME__