title: Count Frequency K Matrix Size N Matrixi J Ij
signature: pub fn count_frequency_k_matrix_size_n_matrixi_j_ij(n: i32, k: i32) -> i32 {
test_code: use std::collections::HashMap;
  use std::collections::HashSet;
  use std::cmp::*;
  use std::collections::*;
  use std::fmt::*; 
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  pub fn validate_solution(actual: i32, expected: i32)->bool{
  return actual==expected
  }
  pub fn driver(n: i32, k: i32, expected: i32)->String{
      if validate_solution(PLACEHOLDER_FN_NAME(n, k), expected) {
        return "PASSED".to_string();
      };
      return "FAILED".to_string();
  
  }
  
  fn main() {
      println!("TEST-0...{}", driver(
        90, 74, 
        73
      ));
      
      println!("TEST-1...{}", driver(
        86, 36, 
        35
      ));
      
      println!("TEST-2...{}", driver(
        92, 38, 
        37
      ));
      
      println!("TEST-3...{}", driver(
        72, 71, 
        70
      ));
      
      println!("TEST-4...{}", driver(
        25, 57, 
        -6
      ));
      
      println!("TEST-5...{}", driver(
        11, 53, 
        -30
      ));
      
      println!("TEST-6...{}", driver(
        94, 80, 
        79
      ));
      
      println!("TEST-7...{}", driver(
        91, 75, 
        74
      ));
      
      println!("TEST-8...{}", driver(
        66, 58, 
        57
      ));
      
      println!("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 );
  }