title: Write You Own Power Without Using Multiplication And Division
signature: function writeYouOwnPowerWithoutUsingMultiplicationAndDivision(a: number, b: number): number {
source_py: def write_you_own_power_without_using_multiplication_and_division(a, b):
      if (b == 0):
          return 1
      answer = a
      increment = a
      for i in range(1, b):
          for j in range(1, a):
              answer += increment
          increment = answer
      return answer
source_cpp: int write_you_own_power_without_using_multiplication_and_division(int a, int b) {
    if ( b == 0 ) return 1;
    int answer = a;
    int increment = a;
    int i, j;
    for ( i = 1;
    i < b;
    i ++ ) {
      for ( j = 1;
      j < a;
      j ++ ) {
        answer += increment;
      }
      increment = answer;
    }
    return answer;
  }
question_info.test_list: [{"idx": 0, "outputs": 18974736, "inputs": {"a": 66, "b": 4}}]
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(a: number, b: number, expected:number): string {
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(a, b),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(66, 4, 18974736);
    console.log(`TEST-0...${result}`);
  
  };
  
  main();
question_info.extension: ts
question_info.entry_fn_name: writeYouOwnPowerWithoutUsingMultiplicationAndDivision
question_info.test_case_ids: 0
question_info.commands: tsc --target es2020 --lib es5,dom,es2015,es2020 __FILENAME__
question_info.commands: node __FILENAME__.js