title: Fast Multiplication Method Without Using Multiplication Operator Russian Peasants Algorithm
signature: function fastMultiplicationMethodWithoutUsingMultiplicationOperatorRussianPeasantsAlgorithm($a, $b) {
test_code: <?php
  
  
  // SOLUTION CODE 
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function validateSolution($actual, $expected){
      return serialize($actual) == serialize($expected);
  }
  
  function driver($a, $b, $expected){
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME($a, $b), $expected)){
          return "PASSED";
        }
        return "FAILED";
      }
      catch (Exception $exception_obj) {
        return get_class($exception_obj);
      }
  }
  
  function main(){
      printf("TEST-0...%s\n",driver(
        4, 33, 
        132));
      
      printf("TEST-1...%s\n",driver(
        36, 67, 
        2412));
      
      printf("TEST-2...%s\n",driver(
        65, 52, 
        3380));
      
      printf("TEST-3...%s\n",driver(
        55, 37, 
        2035));
      
      printf("TEST-4...%s\n",driver(
        35, 76, 
        2660));
      
      printf("TEST-5...%s\n",driver(
        69, 98, 
        6762));
      
      printf("TEST-6...%s\n",driver(
        84, 62, 
        5208));
      
      printf("TEST-7...%s\n",driver(
        5, 80, 
        400));
      
      printf("TEST-8...%s\n",driver(
        15, 36, 
        540));
      
      printf("TEST-9...%s\n",driver(
        67, 84, 
        5628));
      
  }
  
  main();
  ?>
source_py: def fast_multiplication_method_without_using_multiplication_operator_russian_peasants_algorithm(a, b):
      res = 0
      while (b > 0):
          if (b & 1):
              res = (res + a)
          a = (a << 1)
          b = (b >> 1)
      return res
source_cpp: unsigned int fast_multiplication_method_without_using_multiplication_operator_russian_peasants_algorithm(unsigned int a, unsigned int b) {
    int res = 0;
    while ( b > 0 ) {
      if ( b & 1 ) res = res + a;
      a = a << 1;
      b = b >> 1;
    }
    return res;
  }