title: Next Power Of 2 2
signature: nextPowerOf22(n) {
test_code: import 'dart:convert';
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  bool validateSolution(int actual, int expected){
      return actual.toString() == expected.toString();
  }
  
  String driver(n, int expected){
      try
      {
          if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)){
              return "PASSED";
          }
          return "FAILED";
      }catch(exception_object){
          return exception_object.runtimeType.toString();
      }
  }
  
  int main() {
  
      print("TEST-0...${driver(
          63, 
          64)
      }");
  
      print("TEST-1...${driver(
          78, 
          128)
      }");
  
      print("TEST-2...${driver(
          13, 
          16)
      }");
  
      print("TEST-3...${driver(
          5, 
          8)
      }");
  
      print("TEST-4...${driver(
          34, 
          64)
      }");
  
      print("TEST-5...${driver(
          69, 
          128)
      }");
  
      print("TEST-6...${driver(
          63, 
          64)
      }");
  
      print("TEST-7...${driver(
          78, 
          128)
      }");
  
      print("TEST-8...${driver(
          80, 
          128)
      }");
  
      print("TEST-9...${driver(
          19, 
          32)
      }");
  
      return 0;
  }
source_py: def next_power_of_2_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 next_power_of_2_2(unsigned int n) {
    n --;
    n |= n >> 1;
    n |= n >> 2;
    n |= n >> 4;
    n |= n >> 8;
    n |= n >> 16;
    n ++;
    return n;
  }