title: Smallest Power Of 2 Greater Than Or Equal To N 1
signature: pub fn smallest_power_of_2_greater_than_or_equal_to_n_1(n: i32) -> i32 {
test_code: use std::collections::HashMap;
  use std::collections::HashSet;
  use std::cmp::*;
  use std::collections::*;
  use std::fmt::*; 
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  pub fn validate_solution(actual: i32, expected: i32)->bool{
  return actual==expected
  }
  pub fn driver(n: i32, expected: i32)->String{
      if validate_solution(PLACEHOLDER_FN_NAME(n), expected) {
        return "PASSED".to_string();
      };
      return "FAILED".to_string();
  
  }
  
  fn main() {
      println!("TEST-0...{}", driver(
        31, 
        32
      ));
      
      println!("TEST-1...{}", driver(
        89, 
        128
      ));
      
      println!("TEST-2...{}", driver(
        92, 
        128
      ));
      
      println!("TEST-3...{}", driver(
        66, 
        128
      ));
      
      println!("TEST-4...{}", driver(
        38, 
        64
      ));
      
      println!("TEST-5...{}", driver(
        34, 
        64
      ));
      
      println!("TEST-6...{}", driver(
        17, 
        32
      ));
      
      println!("TEST-7...{}", driver(
        24, 
        32
      ));
      
      println!("TEST-8...{}", driver(
        54, 
        64
      ));
      
      println!("TEST-9...{}", driver(
        20, 
        32
      ));
      
  }
source_py: def smallest_power_of_2_greater_than_or_equal_to_n_1(n):
      p = 1
      if (n and (not (n & (n - 1)))):
          return n
      while (p < n):
          p <<= 1
      return p
source_cpp: unsigned int smallest_power_of_2_greater_than_or_equal_to_n_1(unsigned int n) {
    unsigned int p = 1;
    if ( n && ! ( n & ( n - 1 ) ) ) return n;
    while ( p < n ) p <<= 1;
    return p;
  }