title: Multiply Large Integers Under Large Modulo
signature: class Solution {
  
      public Integer multiplyLargeIntegersUnderLargeModulo(Integer a, Integer b, Integer mod_arg2) {
test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(Integer a, Integer b, Integer mod_arg2, Integer expected){
          try{
              Driver driver = new Driver();
              if (driver.run(a, b, mod_arg2,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution(60, 24, 58, 48);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(46, 43, 29, 6);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(4, 50, 71, 58);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(67, 1, 66, 1);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(93, 35, 73, 43);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(89, 97, 8, 1);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(8, 78, 55, 19);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(53, 73, 22, 19);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(96, 92, 83, 34);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution(38, 64, 83, 25);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(Integer a, Integer b, Integer mod_arg2, Integer expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(a, b, mod_arg2),expected);
      }
      
      public boolean validateSolution(Integer actual, Integer expected){
          return actual.equals(expected);
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
source_py: def multiply_large_integers_under_large_modulo(a, b, mod):
      res = 0
      a = (a % mod)
      while b:
          if (b & 1):
              res = ((res + a) % mod)
          a = ((2 * a) % mod)
          b >>= 1
      return res
source_cpp: long long multiply_large_integers_under_large_modulo(long long a, long long b, long long mod) {
    long long res = 0;
    a %= mod;
    while ( b ) {
      if ( b & 1 ) res = ( res + a ) % mod;
      a = ( 2 * a ) % mod;
      b >>= 1;
    }
    return res;
  }