title: Smallest Power Of 2 Greater Than Or Equal To N 1
signature: fun smallestPowerOf2GreaterThanOrEqualToN1(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(31, 32)
      println("TEST-0...${result}")
      
      result = driver(89, 128)
      println("TEST-1...${result}")
      
      result = driver(92, 128)
      println("TEST-2...${result}")
      
      result = driver(66, 128)
      println("TEST-3...${result}")
      
      result = driver(38, 64)
      println("TEST-4...${result}")
      
      result = driver(34, 64)
      println("TEST-5...${result}")
      
      result = driver(17, 32)
      println("TEST-6...${result}")
      
      result = driver(24, 32)
      println("TEST-7...${result}")
      
      result = driver(54, 64)
      println("TEST-8...${result}")
      
      result = driver(20, 32)
      println("TEST-9...${result}")
      
          
  }
  
  main()
source_py: def smallest_power_of_2_greater_than_or_equal_to_n_1(n):
      p = 1
      if (n and (not (n & (n - 1)))):
          return n
      while (p < n):
          p <<= 1
      return p
source_cpp: unsigned int smallest_power_of_2_greater_than_or_equal_to_n_1(unsigned int n) {
    unsigned int p = 1;
    if ( n && ! ( n & ( n - 1 ) ) ) return n;
    while ( p < n ) p <<= 1;
    return p;
  }