title: Next Power Of 2 1
signature: def nextPowerOf21(n: Int) = {
test_code: import scala.collection.mutable.HashMap
  import scala.collection.immutable.HashSet
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  
  // TESTING CODE 
  // ============================================
  def validateSolution(actual: Int , expected: Int): Boolean = {
      actual.toString == expected.toString
  }
  
  def driver(n: Int, expected: Int): String = {
      try {
          if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)) {
              "PASSED"
          } else{
              "FAILED"
          }
      }catch{
          case e: Exception => {e.getClass.getName}
      }
  
  }
  object QuestionEvaluator extends App {
  
      println(s"TEST-0...${driver(
        8, 
        8    
      )}")   
  
  
      println(s"TEST-1...${driver(
        79, 
        128    
      )}")   
  
  
      println(s"TEST-2...${driver(
        31, 
        32    
      )}")   
  
  
      println(s"TEST-3...${driver(
        63, 
        64    
      )}")   
  
  
      println(s"TEST-4...${driver(
        18, 
        32    
      )}")   
  
  
      println(s"TEST-5...${driver(
        2, 
        2    
      )}")   
  
  
      println(s"TEST-6...${driver(
        6, 
        8    
      )}")   
  
  
      println(s"TEST-7...${driver(
        85, 
        128    
      )}")   
  
  
      println(s"TEST-8...${driver(
        29, 
        32    
      )}")   
  
  
      println(s"TEST-9...${driver(
        8, 
        8    
      )}")   
  
  }
  
source_py: def next_power_of_2_1(n):
      p = 1
      if (n and (not (n & (n - 1)))):
          return n
      while (p < n):
          p <<= 1
      return p
source_cpp: unsigned int next_power_of_2_1(unsigned int n) {
    unsigned int p = 1;
    if ( n && ! ( n & ( n - 1 ) ) ) return n;
    while ( p < n ) p <<= 1;
    return p;
  }