title: Compute N Under Modulo P
signature: fun computeNUnderModuloP(n: Int, p: Int): Int {
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;
  }
question_info.test_list: [{"idx": 0, "outputs": 0, "inputs": {"n": 85, "p": 18}}, {"idx": 1, "outputs": 0, "inputs": {"n": 14, "p": 13}}, {"idx": 2, "outputs": 0, "inputs": {"n": 83, "p": 21}}, {"idx": 3, "outputs": 0, "inputs": {"n": 30, "p": 35}}, {"idx": 4, "outputs": 0, "inputs": {"n": 96, "p": 51}}, {"idx": 5, "outputs": 0, "inputs": {"n": 55, "p": 58}}, {"idx": 6, "outputs": 0, "inputs": {"n": 82, "p": 71}}, {"idx": 7, "outputs": 44, "inputs": {"n": 12, "p": 74}}, {"idx": 8, "outputs": 0, "inputs": {"n": 38, "p": 3}}, {"idx": 9, "outputs": 67, "inputs": {"n": 46, "p": 73}}]
question_info.extension: kts
question_info.test_code: package main
  
  import kotlin.text.*
  import kotlin.math.*
  
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  fun validateSolution(actual:Int, expected:Int):Boolean{
    return actual.equals(expected)
  }
  fun driver(n: Int, p: Int, expected:Int):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(n, p), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver(85, 18, 0)
      println("TEST-0...${result}")
      
      result = driver(14, 13, 0)
      println("TEST-1...${result}")
      
      result = driver(83, 21, 0)
      println("TEST-2...${result}")
      
      result = driver(30, 35, 0)
      println("TEST-3...${result}")
      
      result = driver(96, 51, 0)
      println("TEST-4...${result}")
      
      result = driver(55, 58, 0)
      println("TEST-5...${result}")
      
      result = driver(82, 71, 0)
      println("TEST-6...${result}")
      
      result = driver(12, 74, 44)
      println("TEST-7...${result}")
      
      result = driver(38, 3, 0)
      println("TEST-8...${result}")
      
      result = driver(46, 73, 67)
      println("TEST-9...${result}")
      
          
  }
  
  main()
question_info.entry_fn_name: computeNUnderModuloP
question_info.entry_cls_name: Solution
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: kotlinc -script __FILENAME__ -no-reflect -nowarn