title: Find Whether A Given Number Is A Power Of 4 Or Not 2
signature: find_whether_a_given_number_is_a_power_of_4_or_not_2 <- function(n) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      toString(actual)==toString(expected)
  }
  
  driver <- function(n, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(n), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          1L, 
          TRUE
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          4L, 
          TRUE
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          64L, 
          TRUE
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          -64L, 
          FALSE
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          128L, 
          FALSE
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          1024L, 
          TRUE
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          97L, 
          FALSE
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          86L, 
          FALSE
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          14L, 
          FALSE
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          99L, 
          FALSE
      )))
  
  }
  
  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 );
  }