title: Count Frequency K Matrix Size N Matrixi J Ij
signature: def countFrequencyKMatrixSizeNMatrixiJIj(n: Int, k: 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(n: Int, k: Int, expected: Int): String = {
      try {
          if (validateSolution(PLACEHOLDER_FN_NAME(n, k),expected)) {
              "PASSED"
          } else{
              "FAILED"
          }
      }catch{
          case e: Exception => {e.getClass.getName}
      }
  
  }
  object QuestionEvaluator extends App {
  
      println(s"TEST-0...${driver(
        90, 74, 
        73    
      )}")   
  
  
      println(s"TEST-1...${driver(
        86, 36, 
        35    
      )}")   
  
  
      println(s"TEST-2...${driver(
        92, 38, 
        37    
      )}")   
  
  
      println(s"TEST-3...${driver(
        72, 71, 
        70    
      )}")   
  
  
      println(s"TEST-4...${driver(
        25, 57, 
        -6    
      )}")   
  
  
      println(s"TEST-5...${driver(
        11, 53, 
        -30    
      )}")   
  
  
      println(s"TEST-6...${driver(
        94, 80, 
        79    
      )}")   
  
  
      println(s"TEST-7...${driver(
        91, 75, 
        74    
      )}")   
  
  
      println(s"TEST-8...${driver(
        66, 58, 
        57    
      )}")   
  
  
      println(s"TEST-9...${driver(
        34, 88, 
        -19    
      )}")   
  
  }
  
source_py: def count_frequency_k_matrix_size_n_matrixi_j_ij(n, k):
      if ((n + 1) >= k):
          return (k - 1)
      else:
          return (((2 * n) + 1) - k)
source_cpp: int count_frequency_k_matrix_size_n_matrixi_j_ij(int n, int k) {
    if ( n + 1 >= k ) return ( k - 1 );
    else return ( 2 * n + 1 - k );
  }