title: Count Frequency K Matrix Size N Matrixi J Ij
signature: function count_frequency_k_matrix_size_n_matrixi_j_ij(n, k)
test_code: using Printf
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  function validate_solution(actual, expected)
      return actual == expected
  end
  
  function driver(n, k, expected)
      try
  
          if validate_solution(PLACEHOLDER_FN_NAME(n, k), expected)
              return "PASSED";
          end
          return "FAILED";
      catch exception_obj
          return string(Base.typename(typeof(exception_obj)).wrapper);
      end
  end
  
  function main()
      
      result = driver(90, 74, 73);
      @printf("TEST-0...%s\n",result);
      
      result = driver(86, 36, 35);
      @printf("TEST-1...%s\n",result);
      
      result = driver(92, 38, 37);
      @printf("TEST-2...%s\n",result);
      
      result = driver(72, 71, 70);
      @printf("TEST-3...%s\n",result);
      
      result = driver(25, 57, -6);
      @printf("TEST-4...%s\n",result);
      
      result = driver(11, 53, -30);
      @printf("TEST-5...%s\n",result);
      
      result = driver(94, 80, 79);
      @printf("TEST-6...%s\n",result);
      
      result = driver(91, 75, 74);
      @printf("TEST-7...%s\n",result);
      
      result = driver(66, 58, 57);
      @printf("TEST-8...%s\n",result);
      
      result = driver(34, 88, -19);
      @printf("TEST-9...%s\n",result);
      
  end
  
  main()
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 );
  }