title: Smallest Power Of 2 Greater Than Or Equal To N 2
signature: def smallestPowerOf2GreaterThanOrEqualToN2(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(
        60, 
        64    
      )}")   
  
  
      println(s"TEST-1...${driver(
        20, 
        32    
      )}")   
  
  
      println(s"TEST-2...${driver(
        33, 
        64    
      )}")   
  
  
      println(s"TEST-3...${driver(
        34, 
        64    
      )}")   
  
  
      println(s"TEST-4...${driver(
        68, 
        128    
      )}")   
  
  
      println(s"TEST-5...${driver(
        79, 
        128    
      )}")   
  
  
      println(s"TEST-6...${driver(
        20, 
        32    
      )}")   
  
  
      println(s"TEST-7...${driver(
        41, 
        64    
      )}")   
  
  
      println(s"TEST-8...${driver(
        36, 
        64    
      )}")   
  
  
      println(s"TEST-9...${driver(
        17, 
        32    
      )}")   
  
  }
  
source_py: def smallest_power_of_2_greater_than_or_equal_to_n_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 smallest_power_of_2_greater_than_or_equal_to_n_2(unsigned int n) {
    n --;
    n |= n >> 1;
    n |= n >> 2;
    n |= n >> 4;
    n |= n >> 8;
    n |= n >> 16;
    n ++;
    return n;
  }