title: Smallest Power Of 2 Greater Than Or Equal To N 2
signature: function smallestPowerOf2GreaterThanOrEqualToN2(n) {
test_code: 
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function convertToString(value) {
      return JSON.stringify(value, function (key, val) {
          if (val instanceof Set) {
              return Array.from(val);
          } return val;});
  }
  
  function validateSolution(actual, expected){
      return convertToString(actual)===convertToString(expected);
  }
  
  function driver(n, expected){
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(60, 64);
    console.log(`TEST-0...${result}`);
  
    result = driver(20, 32);
    console.log(`TEST-1...${result}`);
  
    result = driver(33, 64);
    console.log(`TEST-2...${result}`);
  
    result = driver(34, 64);
    console.log(`TEST-3...${result}`);
  
    result = driver(68, 128);
    console.log(`TEST-4...${result}`);
  
    result = driver(79, 128);
    console.log(`TEST-5...${result}`);
  
    result = driver(20, 32);
    console.log(`TEST-6...${result}`);
  
    result = driver(41, 64);
    console.log(`TEST-7...${result}`);
  
    result = driver(36, 64);
    console.log(`TEST-8...${result}`);
  
    result = driver(17, 32);
    console.log(`TEST-9...${result}`);
  
    process.exit(0);
  };
  
  if (require.main === module) {
    main();
  }
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;
  }