title: Smallest Power Of 2 Greater Than Or Equal To N
signature: fun smallestPowerOf2GreaterThanOrEqualToN(n: Int): Int {
source_py: def smallest_power_of_2_greater_than_or_equal_to_n(n):
      count = 0
      if (n and (not (n & (n - 1)))):
          return n
      while (n != 0):
          n >>= 1
          count += 1
      return (1 << count)
source_cpp: unsigned int smallest_power_of_2_greater_than_or_equal_to_n(unsigned int n) {
    unsigned count = 0;
    if ( n && ! ( n & ( n - 1 ) ) ) return n;
    while ( n != 0 ) {
      n >>= 1;
      count += 1;
    }
    return 1 << count;
  }
question_info.test_list: [{"idx": 0, "outputs": 16, "inputs": {"n": 13}}, {"idx": 1, "outputs": 32, "inputs": {"n": 27}}, {"idx": 2, "outputs": 1, "inputs": {"n": 1}}, {"idx": 3, "outputs": 32, "inputs": {"n": 24}}, {"idx": 4, "outputs": 128, "inputs": {"n": 98}}, {"idx": 5, "outputs": 128, "inputs": {"n": 94}}, {"idx": 6, "outputs": 64, "inputs": {"n": 36}}, {"idx": 7, "outputs": 64, "inputs": {"n": 41}}, {"idx": 8, "outputs": 128, "inputs": {"n": 74}}, {"idx": 9, "outputs": 64, "inputs": {"n": 39}}]
question_info.extension: kts
question_info.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(13, 16)
      println("TEST-0...${result}")
      
      result = driver(27, 32)
      println("TEST-1...${result}")
      
      result = driver(1, 1)
      println("TEST-2...${result}")
      
      result = driver(24, 32)
      println("TEST-3...${result}")
      
      result = driver(98, 128)
      println("TEST-4...${result}")
      
      result = driver(94, 128)
      println("TEST-5...${result}")
      
      result = driver(36, 64)
      println("TEST-6...${result}")
      
      result = driver(41, 64)
      println("TEST-7...${result}")
      
      result = driver(74, 128)
      println("TEST-8...${result}")
      
      result = driver(39, 64)
      println("TEST-9...${result}")
      
          
  }
  
  main()
question_info.entry_fn_name: smallestPowerOf2GreaterThanOrEqualToN
question_info.entry_cls_name: Solution
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: kotlinc -script __FILENAME__ -no-reflect -nowarn