title: Position Of Rightmost Set Bit 1
signature: position_of_rightmost_set_bit_1 <- function(n) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      toString(actual)==toString(expected)
  }
  
  driver <- function(n, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(n), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          17L, 
          1L
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          97L, 
          1L
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          73L, 
          1L
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          68L, 
          3L
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          6L, 
          2L
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          84L, 
          3L
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          72L, 
          4L
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          66L, 
          2L
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          57L, 
          1L
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          11L, 
          1L
      )))
  
  }
  
  main()
source_py: def position_of_rightmost_set_bit_1(n):
      position = 1
      m = 1
      while (not (n & m)):
          m = (m << 1)
          position += 1
      return position
source_cpp: int position_of_rightmost_set_bit_1(int n) {
    int position = 1;
    int m = 1;
    while ( ! ( n & m ) ) {
      m = m << 1;
      position ++;
    }
    return position;
  }