title: Find Whether A Given Number Is A Power Of 4 Or Not 1
signature: function findWhetherAGivenNumberIsAPowerOf4OrNot1($n) {
test_code: <?php
  
  
  // SOLUTION CODE 
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function validateSolution($actual, $expected){
      return serialize($actual) == serialize($expected);
  }
  
  function driver($n, $expected){
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME($n), $expected)){
          return "PASSED";
        }
        return "FAILED";
      }
      catch (Exception $exception_obj) {
        return get_class($exception_obj);
      }
  }
  
  function main(){
      printf("TEST-0...%s\n",driver(
        1, 
        true));
      
      printf("TEST-1...%s\n",driver(
        4, 
        true));
      
      printf("TEST-2...%s\n",driver(
        64, 
        true));
      
      printf("TEST-3...%s\n",driver(
        -64, 
        false));
      
      printf("TEST-4...%s\n",driver(
        128, 
        false));
      
      printf("TEST-5...%s\n",driver(
        1024, 
        true));
      
      printf("TEST-6...%s\n",driver(
        45, 
        false));
      
      printf("TEST-7...%s\n",driver(
        33, 
        false));
      
      printf("TEST-8...%s\n",driver(
        66, 
        false));
      
      printf("TEST-9...%s\n",driver(
        74, 
        false));
      
  }
  
  main();
  ?>
source_py: def find_whether_a_given_number_is_a_power_of_4_or_not_1(n):
      count = 0
      if (n and (not (n & (n - 1)))):
          while (n > 1):
              n >>= 1
              count += 1
          if ((count % 2) == 0):
              return True
          else:
              return False
source_cpp: bool find_whether_a_given_number_is_a_power_of_4_or_not_1(unsigned int n) {
    int count = 0;
    if ( n && ! ( n & ( n - 1 ) ) ) {
      while ( n > 1 ) {
        n >>= 1;
        count += 1;
      }
      return ( count % 2 == 0 ) ? 1 : 0;
    }
    return 0;
  }