title: Non Repeating Element
signature: non_repeating_element <- function(arr, n) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      toString(actual)==toString(expected)
  }
  
  driver <- function(arr, n, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(arr, n), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          list(1L, 2L, 3L, 4L, 6L, 6L, 7L, 9L, 10L, 13L, 16L, 23L, 30L, 32L, 36L, 42L, 42L, 43L, 44L, 47L, 48L, 48L, 49L, 52L, 52L, 53L, 55L, 56L, 58L, 59L, 60L, 60L, 63L, 67L, 68L, 68L, 74L, 75L, 76L, 80L, 81L, 81L, 83L, 83L, 86L, 87L, 91L, 92L, 97L), 47L, 
          1L
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          list(-96L, -46L, -86L, 56L, -72L, 50L, 18L, 8L, 50L), 8L, 
          -96L
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          list(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), 14L, 
          -1L
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          list(19L, 10L, 49L, 40L, 34L, 21L, 63L, 51L), 5L, 
          19L
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          list(-96L, -96L, -90L, -88L, -88L, -84L, -80L, -76L, -68L, -64L, -64L, -52L, -52L, -52L, -52L, -50L, -50L, -48L, -48L, -40L, -32L, -26L, -24L, -22L, -20L, -14L, -12L, 0L, 6L, 8L, 10L, 20L, 24L, 28L, 34L, 36L, 54L, 60L, 60L, 60L, 68L, 74L, 74L, 74L, 84L, 88L, 94L), 27L, 
          -90L
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          list(1L, 0L, 0L, 1L, 0L, 1L, 1L, 1L, 1L, 0L, 0L, 1L, 0L, 0L, 1L, 0L, 0L, 1L, 0L, 1L, 1L, 0L, 0L, 0L, 1L, 1L, 0L, 1L, 0L, 0L, 0L), 19L, 
          -1L
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          list(1L, 2L, 3L, 10L, 15L, 21L, 28L, 36L, 41L, 44L, 45L, 47L, 72L, 77L, 77L, 79L, 85L), 15L, 
          1L
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          list(42L, -84L, 42L, 36L, -10L, 24L, -62L, 60L), 7L, 
          -84L
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          list(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), 35L, 
          -1L
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          list(2L, 21L, 42L, 92L, 65L, 62L, 75L, 43L, 81L, 17L, 92L, 86L, 37L, 63L, 27L, 97L, 24L, 61L, 85L, 49L, 84L, 7L, 14L, 19L, 60L, 55L, 68L, 79L, 8L, 12L, 75L, 12L, 92L, 79L, 42L), 27L, 
          2L
      )))
  
  }
  
  main()
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;
  }