title: Find Whether A Given Number Is A Power Of 4 Or Not 2
signature: findWhetherAGivenNumberIsAPowerOf4OrNot2 :: Integer -> Bool
  findWhetherAGivenNumberIsAPowerOf4OrNot2 n = 
test_code: import Text.Printf
  import Control.Exception (catch, SomeException)
  import Data.Typeable
  import qualified Data.List as List
  import qualified Data.Map as Map
  import qualified Data.Set as Set
  
  -- SOLUTION CODE
  -- ============================================
  
  PLACEHOLDER_CODE_BODY
  
  -- TESTING CODE 
  -- ============================================
  validateSolution :: Bool -> Bool -> Bool
  validateSolution actual expected = do
      actual == expected
  
  
  driver :: Integer -> Bool -> String
  driver n expected = do
      if (validateSolution (PLACEHOLDER_FN_NAME n) expected)
          then "PASSED"
      else "FAILED"
  
  main = do
      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 (97) (False) )
  
      printf "TEST-7...%s\n" (driver (86) (False) )
  
      printf "TEST-8...%s\n" (driver (14) (False) )
  
      printf "TEST-9...%s\n" (driver (99) (False) )
  
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 );
  }