title: Next Power Of 2 2
signature: fun nextPowerOf22(n: Int): Int {
source_py: def next_power_of_2_2(n):
      n -= 1
      n |= (n >> 1)
      n |= (n >> 2)
      n |= (n >> 4)
      n |= (n >> 8)
      n |= (n >> 16)
      n += 1
      return n
source_cpp: unsigned int next_power_of_2_2(unsigned int n) {
    n --;
    n |= n >> 1;
    n |= n >> 2;
    n |= n >> 4;
    n |= n >> 8;
    n |= n >> 16;
    n ++;
    return n;
  }
question_info.test_list: [{"idx": 0, "outputs": 64, "inputs": {"n": 63}}, {"idx": 1, "outputs": 128, "inputs": {"n": 78}}, {"idx": 2, "outputs": 16, "inputs": {"n": 13}}, {"idx": 3, "outputs": 8, "inputs": {"n": 5}}, {"idx": 4, "outputs": 64, "inputs": {"n": 34}}, {"idx": 5, "outputs": 128, "inputs": {"n": 69}}, {"idx": 6, "outputs": 64, "inputs": {"n": 63}}, {"idx": 7, "outputs": 128, "inputs": {"n": 78}}, {"idx": 8, "outputs": 128, "inputs": {"n": 80}}, {"idx": 9, "outputs": 32, "inputs": {"n": 19}}]
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(63, 64)
      println("TEST-0...${result}")
      
      result = driver(78, 128)
      println("TEST-1...${result}")
      
      result = driver(13, 16)
      println("TEST-2...${result}")
      
      result = driver(5, 8)
      println("TEST-3...${result}")
      
      result = driver(34, 64)
      println("TEST-4...${result}")
      
      result = driver(69, 128)
      println("TEST-5...${result}")
      
      result = driver(63, 64)
      println("TEST-6...${result}")
      
      result = driver(78, 128)
      println("TEST-7...${result}")
      
      result = driver(80, 128)
      println("TEST-8...${result}")
      
      result = driver(19, 32)
      println("TEST-9...${result}")
      
          
  }
  
  main()
question_info.entry_fn_name: nextPowerOf22
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