title: Find Whether A Given Number Is A Power Of 4 Or Not 2
signature: function find_whether_a_given_number_is_a_power_of_4_or_not_2(n)
test_code: using Printf
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  function validate_solution(actual, expected)
      return actual == expected
  end
  
  function driver(n, expected)
      try
  
          if validate_solution(PLACEHOLDER_FN_NAME(n), expected)
              return "PASSED";
          end
          return "FAILED";
      catch exception_obj
          return string(Base.typename(typeof(exception_obj)).wrapper);
      end
  end
  
  function main()
      
      result = driver(1, true);
      @printf("TEST-0...%s\n",result);
      
      result = driver(4, true);
      @printf("TEST-1...%s\n",result);
      
      result = driver(64, true);
      @printf("TEST-2...%s\n",result);
      
      result = driver(-64, false);
      @printf("TEST-3...%s\n",result);
      
      result = driver(128, false);
      @printf("TEST-4...%s\n",result);
      
      result = driver(1024, true);
      @printf("TEST-5...%s\n",result);
      
      result = driver(97, false);
      @printf("TEST-6...%s\n",result);
      
      result = driver(86, false);
      @printf("TEST-7...%s\n",result);
      
      result = driver(14, false);
      @printf("TEST-8...%s\n",result);
      
      result = driver(99, false);
      @printf("TEST-9...%s\n",result);
      
  end
  
  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 );
  }