title: Compute N Under Modulo P
signature: class Solution {
  
      public Integer computeNUnderModuloP(Integer n, Integer p) {
test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(Integer n, Integer p, Integer expected){
          try{
              Driver driver = new Driver();
              if (driver.run(n, p,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution(85, 18, 0);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(14, 13, 0);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(83, 21, 0);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(30, 35, 0);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(96, 51, 0);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(55, 58, 0);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(82, 71, 0);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(12, 74, 44);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(38, 3, 0);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution(46, 73, 67);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(Integer n, Integer p, Integer expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(n, p),expected);
      }
      
      public boolean validateSolution(Integer actual, Integer expected){
          return actual.equals(expected);
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
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;
  }