title: Program To Find Remainder Without Using Modulo Or Operator
signature: function programToFindRemainderWithoutUsingModuloOrOperator(num: number, divisor: number): number {
source_py: def program_to_find_remainder_without_using_modulo_or_operator(num, divisor):
      return (num - (divisor * (num // divisor)))
source_cpp: int program_to_find_remainder_without_using_modulo_or_operator(int num, int divisor) {
    return ( num - divisor * ( num / divisor ) );
  }
question_info.test_list: [{"idx": 0, "outputs": 26, "inputs": {"num": 80, "divisor": 54}}, {"idx": 1, "outputs": 0, "inputs": {"num": 63, "divisor": 21}}, {"idx": 2, "outputs": 1, "inputs": {"num": 1, "divisor": 56}}, {"idx": 3, "outputs": 22, "inputs": {"num": 22, "divisor": 39}}, {"idx": 4, "outputs": 3, "inputs": {"num": 66, "divisor": 7}}, {"idx": 5, "outputs": 61, "inputs": {"num": 61, "divisor": 67}}, {"idx": 6, "outputs": 45, "inputs": {"num": 45, "divisor": 63}}, {"idx": 7, "outputs": 29, "inputs": {"num": 29, "divisor": 44}}, {"idx": 8, "outputs": 30, "inputs": {"num": 95, "divisor": 65}}, {"idx": 9, "outputs": 9, "inputs": {"num": 9, "divisor": 68}}]
question_info.entry_cls_name: Solution
question_info.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(num: number, divisor: number, expected:number): string {
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(num, divisor),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(80, 54, 26);
    console.log(`TEST-0...${result}`);
  
    result = driver(63, 21, 0);
    console.log(`TEST-1...${result}`);
  
    result = driver(1, 56, 1);
    console.log(`TEST-2...${result}`);
  
    result = driver(22, 39, 22);
    console.log(`TEST-3...${result}`);
  
    result = driver(66, 7, 3);
    console.log(`TEST-4...${result}`);
  
    result = driver(61, 67, 61);
    console.log(`TEST-5...${result}`);
  
    result = driver(45, 63, 45);
    console.log(`TEST-6...${result}`);
  
    result = driver(29, 44, 29);
    console.log(`TEST-7...${result}`);
  
    result = driver(95, 65, 30);
    console.log(`TEST-8...${result}`);
  
    result = driver(9, 68, 9);
    console.log(`TEST-9...${result}`);
  
  };
  
  main();
question_info.extension: ts
question_info.entry_fn_name: programToFindRemainderWithoutUsingModuloOrOperator
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: tsc --target es2020 --lib es5,dom,es2015,es2020 __FILENAME__
question_info.commands: node __FILENAME__.js