title: Find Whether A Given Number Is A Power Of 4 Or Not 2
signature: function findWhetherAGivenNumberIsAPowerOf4OrNot2(n: number): boolean {
test_code: 
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function convertToString(value: any): string{
      return JSON.stringify(value, function (key, val) {
          if (val instanceof Set) {
              return Array.from(val);
          } return val;});
  }
  
  function validateSolution(actual: boolean, expected: boolean): boolean {
      return convertToString(actual) === convertToString(expected);
  }
  
  function driver(n: number, expected:boolean): string {
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(1, true);
    console.log(`TEST-0...${result}`);
  
    result = driver(4, true);
    console.log(`TEST-1...${result}`);
  
    result = driver(64, true);
    console.log(`TEST-2...${result}`);
  
    result = driver(-64, false);
    console.log(`TEST-3...${result}`);
  
    result = driver(128, false);
    console.log(`TEST-4...${result}`);
  
    result = driver(1024, true);
    console.log(`TEST-5...${result}`);
  
    result = driver(97, false);
    console.log(`TEST-6...${result}`);
  
    result = driver(86, false);
    console.log(`TEST-7...${result}`);
  
    result = driver(14, false);
    console.log(`TEST-8...${result}`);
  
    result = driver(99, false);
    console.log(`TEST-9...${result}`);
  
  };
  
  main();
source_py: def find_whether_a_given_number_is_a_power_of_4_or_not_2(n):
      return ((n != 0) and ((n & (n - 1)) == 0) and (not (n & 2863311530)))
source_cpp: bool find_whether_a_given_number_is_a_power_of_4_or_not_2(unsigned int n) {
    return n != 0 && ( ( n & ( n - 1 ) ) == 0 ) && ! ( n & 0xAAAAAAAA );
  }