title: Compute N Under Modulo P
signature: func computeNUnderModuloP(n int, p int) int {
test_code: package main
  
  import (
      "fmt"
      "reflect"
      "math"
      "sort"
  )
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  func validateSolution(actual int, expected int) bool {
      return reflect.DeepEqual(actual,expected)
  }
  
  func driver(n int, p int, expected int) string {
      if validateSolution(PLACEHOLDER_FN_NAME(n, p),expected) {
              return "PASSED"
      }
      return "FAILED"
  
  }
  
  func main() {
  
      // Use imports to avoid undefined errors
      var _ = reflect.DeepEqual
      _ = math.Abs
      _ = sort.Sort
      result := ""
      result = driver(85, 
  	18, 0)
      fmt.Printf("TEST-0...%s\n", result)
      
      result = driver(14, 
  	13, 0)
      fmt.Printf("TEST-1...%s\n", result)
      
      result = driver(83, 
  	21, 0)
      fmt.Printf("TEST-2...%s\n", result)
      
      result = driver(30, 
  	35, 0)
      fmt.Printf("TEST-3...%s\n", result)
      
      result = driver(96, 
  	51, 0)
      fmt.Printf("TEST-4...%s\n", result)
      
      result = driver(55, 
  	58, 0)
      fmt.Printf("TEST-5...%s\n", result)
      
      result = driver(82, 
  	71, 0)
      fmt.Printf("TEST-6...%s\n", result)
      
      result = driver(12, 
  	74, 44)
      fmt.Printf("TEST-7...%s\n", result)
      
      result = driver(38, 
  	3, 0)
      fmt.Printf("TEST-8...%s\n", result)
      
      result = driver(46, 
  	73, 67)
      fmt.Printf("TEST-9...%s\n", result)
      
          
  }
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;
  }