title: Find Whether A Given Number Is A Power Of 4 Or Not 1
signature: findWhetherAGivenNumberIsAPowerOf4OrNot1 :: Integer -> Bool
  findWhetherAGivenNumberIsAPowerOf4OrNot1 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 (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) )
  
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;
  }