title: Position Of Rightmost Set Bit 1
signature: fun positionOfRightmostSetBit1(n: Int): Int {
test_code: package main
  
  import kotlin.text.*
  import kotlin.math.*
  
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  fun validateSolution(actual:Int, expected:Int):Boolean{
    return actual.equals(expected)
  }
  fun driver(n: Int, expected:Int):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver(17, 1)
      println("TEST-0...${result}")
      
      result = driver(97, 1)
      println("TEST-1...${result}")
      
      result = driver(73, 1)
      println("TEST-2...${result}")
      
      result = driver(68, 3)
      println("TEST-3...${result}")
      
      result = driver(6, 2)
      println("TEST-4...${result}")
      
      result = driver(84, 3)
      println("TEST-5...${result}")
      
      result = driver(72, 4)
      println("TEST-6...${result}")
      
      result = driver(66, 2)
      println("TEST-7...${result}")
      
      result = driver(57, 1)
      println("TEST-8...${result}")
      
      result = driver(11, 1)
      println("TEST-9...${result}")
      
          
  }
  
  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;
  }