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