title: Find The Number Occurring Odd Number Of Times
signature: class Solution {
  
      public Integer findTheNumberOccurringOddNumberOfTimes(ArrayList<Integer> arr, Integer arr_size) {
source_py: def find_the_number_occurring_odd_number_of_times(arr, arr_size):
      for i in range(0, arr_size):
          count = 0
          for j in range(0, arr_size):
              if (arr[i] == arr[j]):
                  count += 1
          if ((count % 2) != 0):
              return arr[i]
      return (- 1)
source_cpp: int find_the_number_occurring_odd_number_of_times(vector<int> arr, int arr_size) {
    for ( int i = 0;
    i < arr_size;
    i ++ ) {
      int count = 0;
      for ( int j = 0;
      j < arr_size;
      j ++ ) {
        if ( arr [ i ] == arr [ j ] ) count ++;
      }
      if ( count % 2 != 0 ) return arr [ i ];
    }
    return - 1;
  }
question_info.extension: java
question_info.entry_fn_name: findTheNumberOccurringOddNumberOfTimes
question_info.entry_cls_name: Solution
question_info.test_list: [{"idx": 0, "outputs": 1, "inputs": {"arr": [1, 5, 5, 8, 14, 15, 17, 17, 18, 23, 23, 25, 26, 35, 36, 39, 51, 53, 56, 56, 60, 62, 64, 64, 65, 66, 67, 68, 71, 75, 80, 82, 83, 88, 89, 91, 91, 92, 93, 95, 99], "arr_size": 31}}, {"idx": 1, "outputs": -56, "inputs": {"arr": [-56, 98, 44, 30, -88, 18, 60, 86, 4, 16, 10, 64, -22, -86, -66, -16, 70, -44, 98, 78, -96, -66, 92, 10, 40, -16], "arr_size": 19}}, {"idx": 2, "outputs": 0, "inputs": {"arr": [0, 0, 0, 0, 0, 1, 1, 1], "arr_size": 6}}, {"idx": 3, "outputs": 36, "inputs": {"arr": [36, 11, 83, 41, 42, 14, 46, 89, 91, 96, 57, 42, 74, 73, 9, 26, 79, 40, 31, 69, 44, 39, 14, 92, 34, 20, 52, 47, 14], "arr_size": 25}}, {"idx": 4, "outputs": -84, "inputs": {"arr": [-84, -84, -84, -78, -66, -62, -62, -36, -24, -10, -10, -8, -4, -2, 12, 14, 20, 22, 36, 42, 46, 66, 84, 96, 96, 98], "arr_size": 23}}, {"idx": 5, "outputs": 1, "inputs": {"arr": [1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1], "arr_size": 19}}, {"idx": 6, "outputs": 11, "inputs": {"arr": [11, 12, 14, 28, 42, 48, 50, 58, 67, 74, 86, 89, 95], "arr_size": 7}}, {"idx": 7, "outputs": 52, "inputs": {"arr": [52, -56, -6, 74, 10, 68, 74, 10, 16, -80, 82, -32, 6, -6, 82, 20], "arr_size": 11}}, {"idx": 8, "outputs": 0, "inputs": {"arr": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], "arr_size": 31}}, {"idx": 9, "outputs": 4, "inputs": {"arr": [4, 80, 92], "arr_size": 1}}]
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 arr_size, Integer expected){
          try{
              Driver driver = new Driver();
              if (driver.run(arr, arr_size,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, 5, 5, 8, 14, 15, 17, 17, 18, 23, 23, 25, 26, 35, 36, 39, 51, 53, 56, 56, 60, 62, 64, 64, 65, 66, 67, 68, 71, 75, 80, 82, 83, 88, 89, 91, 91, 92, 93, 95, 99)), 31, 1);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(-56, 98, 44, 30, -88, 18, 60, 86, 4, 16, 10, 64, -22, -86, -66, -16, 70, -44, 98, 78, -96, -66, 92, 10, 40, -16)), 19, -56);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(0, 0, 0, 0, 0, 1, 1, 1)), 6, 0);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(36, 11, 83, 41, 42, 14, 46, 89, 91, 96, 57, 42, 74, 73, 9, 26, 79, 40, 31, 69, 44, 39, 14, 92, 34, 20, 52, 47, 14)), 25, 36);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(-84, -84, -84, -78, -66, -62, -62, -36, -24, -10, -10, -8, -4, -2, 12, 14, 20, 22, 36, 42, 46, 66, 84, 96, 96, 98)), 23, -84);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1)), 19, 1);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(11, 12, 14, 28, 42, 48, 50, 58, 67, 74, 86, 89, 95)), 7, 11);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(52, -56, -6, 74, 10, 68, 74, 10, 16, -80, 82, -32, 6, -6, 82, 20)), 11, 52);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)), 31, 0);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(4, 80, 92)), 1, 4);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(ArrayList<Integer> arr, Integer arr_size, Integer expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(arr, arr_size),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__