title: Find Repetitive Element 1 N 1
signature: def findRepetitiveElement1N1(arr: List[Int], n: Int) = {
test_code: import scala.collection.mutable.HashMap
  import scala.collection.immutable.HashSet
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  
  // TESTING CODE 
  // ============================================
  def validateSolution(actual: Int , expected: Int): Boolean = {
      actual.toString == expected.toString
  }
  
  def driver(arr: List[Int], n: Int, expected: Int): String = {
      try {
          if (validateSolution(PLACEHOLDER_FN_NAME(arr, n),expected)) {
              "PASSED"
          } else{
              "FAILED"
          }
      }catch{
          case e: Exception => {e.getClass.getName}
      }
  
  }
  object QuestionEvaluator extends App {
  
      println(s"TEST-0...${driver(
        List(4, 8, 27, 34, 39, 42, 43, 54, 72), 5, 
        313    
      )}")   
  
  
      println(s"TEST-1...${driver(
        List(-38, -66, -38, -48, -96, 74, -32, -62, -34, -32, -88, -12, -8, -4), 9, 
        -520    
      )}")   
  
  
      println(s"TEST-2...${driver(
        List(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1), 8, 
        -23    
      )}")   
  
  
      println(s"TEST-3...${driver(
        List(88, 86, 23, 81, 76, 16, 94, 64, 59, 50, 71, 62, 10, 89, 73, 64, 65, 96, 83, 40, 99, 40, 77, 33, 14, 62, 6, 89, 74, 96, 93, 29, 15, 93, 9, 58, 98, 76, 23, 23, 70, 99), 31, 
        2101    
      )}")   
  
  
      println(s"TEST-4...${driver(
        List(-96, -94, -82, -64, -56, -40, -36, -34, -32, -24, -24, -22, -20, -20, -20, -18, -18, -12, -10, -6, 16, 20, 20, 22, 26, 30, 36, 46, 46, 50, 50, 52, 64, 64, 64, 68, 72, 74, 76, 92, 96, 98), 28, 
        76    
      )}")   
  
  
      println(s"TEST-5...${driver(
        List(0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1), 25, 
        -288    
      )}")   
  
  
      println(s"TEST-6...${driver(
        List(2, 6, 7, 13, 19, 23, 37, 39, 42, 42, 43, 45, 52, 53, 55, 56, 59, 63, 66, 71, 76, 85, 86, 89, 92, 94, 96, 99), 27, 
        1159    
      )}")   
  
  
      println(s"TEST-7...${driver(
        List(52, -56, -12, 78, 6, 32, 0, 36, 34, -54, -74, -32), 11, 
        -45    
      )}")   
  
  
      println(s"TEST-8...${driver(
        List(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), 15, 
        -86    
      )}")   
  
  
      println(s"TEST-9...${driver(
        List(10, 42, 50, 5, 74, 81, 30, 76, 6, 34, 86, 4, 77, 71, 96, 22, 34, 50, 35, 16, 60, 11, 21, 38), 13, 
        951    
      )}")   
  
  }
  
source_py: def find_repetitive_element_1_n_1(arr, n):
      return (sum(arr) - (((n - 1) * n) // 2))
source_cpp: int find_repetitive_element_1_n_1(vector<int> arr, int n) {
    return accumulate(arr.begin(), arr.end(), 0 ) - ( ( n - 1 ) * n / 2 );
  }