title: Next Power Of 2
signature: def nextPowerOf2(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(
        74, 
        128    
      )}")   
  
  
      println(s"TEST-1...${driver(
        70, 
        128    
      )}")   
  
  
      println(s"TEST-2...${driver(
        85, 
        128    
      )}")   
  
  
      println(s"TEST-3...${driver(
        78, 
        128    
      )}")   
  
  
      println(s"TEST-4...${driver(
        71, 
        128    
      )}")   
  
  
      println(s"TEST-5...${driver(
        32, 
        32    
      )}")   
  
  
      println(s"TEST-6...${driver(
        97, 
        128    
      )}")   
  
  
      println(s"TEST-7...${driver(
        90, 
        128    
      )}")   
  
  
      println(s"TEST-8...${driver(
        64, 
        64    
      )}")   
  
  
      println(s"TEST-9...${driver(
        48, 
        64    
      )}")   
  
  }
  
source_py: def next_power_of_2(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 next_power_of_2(unsigned int n) {
    unsigned count = 0;
    if ( n && ! ( n & ( n - 1 ) ) ) return n;
    while ( n != 0 ) {
      n >>= 1;
      count += 1;
    }
    return 1 << count;
  }