title: Non Repeating Element
signature: function nonRepeatingElement(arr: Array<number>, n: number): number {
source_py: def non_repeating_element(arr, n):
      for i in range(n):
          j = 0
          while (j < n):
              if ((i != j) and (arr[i] == arr[j])):
                  break
              j += 1
          if (j == n):
              return arr[i]
      return (- 1)
source_cpp: int non_repeating_element(vector<int> arr, int n) {
    for ( int i = 0;
    i < n;
    i ++ ) {
      int j;
      for ( j = 0;
      j < n;
      j ++ ) if ( i != j && arr [ i ] == arr [ j ] ) break;
      if ( j == n ) return arr [ i ];
    }
    return - 1;
  }
question_info.test_list: [{"idx": 0, "outputs": 1, "inputs": {"arr": [1, 2, 3, 4, 6, 6, 7, 9, 10, 13, 16, 23, 30, 32, 36, 42, 42, 43, 44, 47, 48, 48, 49, 52, 52, 53, 55, 56, 58, 59, 60, 60, 63, 67, 68, 68, 74, 75, 76, 80, 81, 81, 83, 83, 86, 87, 91, 92, 97], "n": 47}}, {"idx": 1, "outputs": -96, "inputs": {"arr": [-96, -46, -86, 56, -72, 50, 18, 8, 50], "n": 8}}, {"idx": 2, "outputs": -1, "inputs": {"arr": [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], "n": 14}}, {"idx": 3, "outputs": 19, "inputs": {"arr": [19, 10, 49, 40, 34, 21, 63, 51], "n": 5}}, {"idx": 4, "outputs": -90, "inputs": {"arr": [-96, -96, -90, -88, -88, -84, -80, -76, -68, -64, -64, -52, -52, -52, -52, -50, -50, -48, -48, -40, -32, -26, -24, -22, -20, -14, -12, 0, 6, 8, 10, 20, 24, 28, 34, 36, 54, 60, 60, 60, 68, 74, 74, 74, 84, 88, 94], "n": 27}}, {"idx": 5, "outputs": -1, "inputs": {"arr": [1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0], "n": 19}}, {"idx": 6, "outputs": 1, "inputs": {"arr": [1, 2, 3, 10, 15, 21, 28, 36, 41, 44, 45, 47, 72, 77, 77, 79, 85], "n": 15}}, {"idx": 7, "outputs": -84, "inputs": {"arr": [42, -84, 42, 36, -10, 24, -62, 60], "n": 7}}, {"idx": 8, "outputs": -1, "inputs": {"arr": [0, 0, 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], "n": 35}}, {"idx": 9, "outputs": 2, "inputs": {"arr": [2, 21, 42, 92, 65, 62, 75, 43, 81, 17, 92, 86, 37, 63, 27, 97, 24, 61, 85, 49, 84, 7, 14, 19, 60, 55, 68, 79, 8, 12, 75, 12, 92, 79, 42], "n": 27}}]
question_info.entry_cls_name: Solution
question_info.test_code: 
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function convertToString(value: any): string{
      return JSON.stringify(value, function (key, val) {
          if (val instanceof Set) {
              return Array.from(val);
          } return val;});
  }
  
  function validateSolution(actual: number, expected: number): boolean {
      return convertToString(actual) === convertToString(expected);
  }
  
  function driver(arr: Array<number>, n: number, expected:number): string {
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(arr, n),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver([1, 2, 3, 4, 6, 6, 7, 9, 10, 13, 16, 23, 30, 32, 36, 42, 42, 43, 44, 47, 48, 48, 49, 52, 52, 53, 55, 56, 58, 59, 60, 60, 63, 67, 68, 68, 74, 75, 76, 80, 81, 81, 83, 83, 86, 87, 91, 92, 97], 47, 1);
    console.log(`TEST-0...${result}`);
  
    result = driver([-96, -46, -86, 56, -72, 50, 18, 8, 50], 8, -96);
    console.log(`TEST-1...${result}`);
  
    result = driver([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], 14, -1);
    console.log(`TEST-2...${result}`);
  
    result = driver([19, 10, 49, 40, 34, 21, 63, 51], 5, 19);
    console.log(`TEST-3...${result}`);
  
    result = driver([-96, -96, -90, -88, -88, -84, -80, -76, -68, -64, -64, -52, -52, -52, -52, -50, -50, -48, -48, -40, -32, -26, -24, -22, -20, -14, -12, 0, 6, 8, 10, 20, 24, 28, 34, 36, 54, 60, 60, 60, 68, 74, 74, 74, 84, 88, 94], 27, -90);
    console.log(`TEST-4...${result}`);
  
    result = driver([1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0], 19, -1);
    console.log(`TEST-5...${result}`);
  
    result = driver([1, 2, 3, 10, 15, 21, 28, 36, 41, 44, 45, 47, 72, 77, 77, 79, 85], 15, 1);
    console.log(`TEST-6...${result}`);
  
    result = driver([42, -84, 42, 36, -10, 24, -62, 60], 7, -84);
    console.log(`TEST-7...${result}`);
  
    result = driver([0, 0, 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], 35, -1);
    console.log(`TEST-8...${result}`);
  
    result = driver([2, 21, 42, 92, 65, 62, 75, 43, 81, 17, 92, 86, 37, 63, 27, 97, 24, 61, 85, 49, 84, 7, 14, 19, 60, 55, 68, 79, 8, 12, 75, 12, 92, 79, 42], 27, 2);
    console.log(`TEST-9...${result}`);
  
  };
  
  main();
question_info.extension: ts
question_info.entry_fn_name: nonRepeatingElement
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: tsc --target es2020 --lib es5,dom,es2015,es2020 __FILENAME__
question_info.commands: node __FILENAME__.js