title: Fast Multiplication Method Without Using Multiplication Operator Russian Peasants Algorithm
signature: function fast_multiplication_method_without_using_multiplication_operator_russian_peasants_algorithm(a, b)
test_code: using Printf
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  function validate_solution(actual, expected)
      return actual == expected
  end
  
  function driver(a, b, expected)
      try
  
          if validate_solution(PLACEHOLDER_FN_NAME(a, b), expected)
              return "PASSED";
          end
          return "FAILED";
      catch exception_obj
          return string(Base.typename(typeof(exception_obj)).wrapper);
      end
  end
  
  function main()
      
      result = driver(4, 33, 132);
      @printf("TEST-0...%s\n",result);
      
      result = driver(36, 67, 2412);
      @printf("TEST-1...%s\n",result);
      
      result = driver(65, 52, 3380);
      @printf("TEST-2...%s\n",result);
      
      result = driver(55, 37, 2035);
      @printf("TEST-3...%s\n",result);
      
      result = driver(35, 76, 2660);
      @printf("TEST-4...%s\n",result);
      
      result = driver(69, 98, 6762);
      @printf("TEST-5...%s\n",result);
      
      result = driver(84, 62, 5208);
      @printf("TEST-6...%s\n",result);
      
      result = driver(5, 80, 400);
      @printf("TEST-7...%s\n",result);
      
      result = driver(15, 36, 540);
      @printf("TEST-8...%s\n",result);
      
      result = driver(67, 84, 5628);
      @printf("TEST-9...%s\n",result);
      
  end
  
  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;
  }