title: Count Frequency K Matrix Size N Matrixi J Ij
signature: countFrequencyKMatrixSizeNMatrixiJIj :: Integer -> Integer -> Integer
  countFrequencyKMatrixSizeNMatrixiJIj n k = 
test_code: import Text.Printf
  import Control.Exception (catch, SomeException)
  import Data.Typeable
  import qualified Data.List as List
  import qualified Data.Map as Map
  import qualified Data.Set as Set
  
  -- SOLUTION CODE
  -- ============================================
  
  PLACEHOLDER_CODE_BODY
  
  -- TESTING CODE 
  -- ============================================
  validateSolution :: Integer -> Integer -> Bool
  validateSolution actual expected = do
      actual == expected
  
  
  driver :: Integer -> Integer -> Integer -> String
  driver n k expected = do
      if (validateSolution (PLACEHOLDER_FN_NAME n k) expected)
          then "PASSED"
      else "FAILED"
  
  main = do
      printf "TEST-0...%s\n" (driver (90) (74) (73) )
  
      printf "TEST-1...%s\n" (driver (86) (36) (35) )
  
      printf "TEST-2...%s\n" (driver (92) (38) (37) )
  
      printf "TEST-3...%s\n" (driver (72) (71) (70) )
  
      printf "TEST-4...%s\n" (driver (25) (57) (-6) )
  
      printf "TEST-5...%s\n" (driver (11) (53) (-30) )
  
      printf "TEST-6...%s\n" (driver (94) (80) (79) )
  
      printf "TEST-7...%s\n" (driver (91) (75) (74) )
  
      printf "TEST-8...%s\n" (driver (66) (58) (57) )
  
      printf "TEST-9...%s\n" (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 );
  }