title: Compute N Under Modulo P
signature: function computeNUnderModuloP(n: number, p: number): number {
test_code: 
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function convertToString(value: any): string{
      return JSON.stringify(value, function (key, val) {
          if (val instanceof Set) {
              return Array.from(val);
          } return val;});
  }
  
  function validateSolution(actual: number, expected: number): boolean {
      return convertToString(actual) === convertToString(expected);
  }
  
  function driver(n: number, p: number, expected:number): string {
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(n, p),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(85, 18, 0);
    console.log(`TEST-0...${result}`);
  
    result = driver(14, 13, 0);
    console.log(`TEST-1...${result}`);
  
    result = driver(83, 21, 0);
    console.log(`TEST-2...${result}`);
  
    result = driver(30, 35, 0);
    console.log(`TEST-3...${result}`);
  
    result = driver(96, 51, 0);
    console.log(`TEST-4...${result}`);
  
    result = driver(55, 58, 0);
    console.log(`TEST-5...${result}`);
  
    result = driver(82, 71, 0);
    console.log(`TEST-6...${result}`);
  
    result = driver(12, 74, 44);
    console.log(`TEST-7...${result}`);
  
    result = driver(38, 3, 0);
    console.log(`TEST-8...${result}`);
  
    result = driver(46, 73, 67);
    console.log(`TEST-9...${result}`);
  
  };
  
  main();
source_py: def compute_n_under_modulo_p(n, p):
      if (n >= p):
          return 0
      result = 1
      for i in range(1, (n + 1)):
          result = ((result * i) % p)
      return result
source_cpp: int compute_n_under_modulo_p(int n, int p) {
    if ( n >= p ) return 0;
    int result = 1;
    for ( int i = 1;
    i <= n;
    i ++ ) result = ( result * i ) % p;
    return result;
  }