title: Find Whether A Given Number Is A Power Of 4 Or Not 2
signature: fun findWhetherAGivenNumberIsAPowerOf4OrNot2(n: Int): Boolean {
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 );
  }
question_info.test_list: [{"idx": 0, "outputs": true, "inputs": {"n": 1}}, {"idx": 1, "outputs": true, "inputs": {"n": 4}}, {"idx": 2, "outputs": true, "inputs": {"n": 64}}, {"idx": 3, "outputs": false, "inputs": {"n": -64}}, {"idx": 4, "outputs": false, "inputs": {"n": 128}}, {"idx": 5, "outputs": true, "inputs": {"n": 1024}}, {"idx": 6, "outputs": false, "inputs": {"n": 97}}, {"idx": 7, "outputs": false, "inputs": {"n": 86}}, {"idx": 8, "outputs": false, "inputs": {"n": 14}}, {"idx": 9, "outputs": false, "inputs": {"n": 99}}]
question_info.extension: kts
question_info.test_code: package main
  
  import kotlin.text.*
  import kotlin.math.*
  
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  fun validateSolution(actual:Boolean, expected:Boolean):Boolean{
    return actual.equals(expected)
  }
  fun driver(n: Int, expected:Boolean):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver(1, true)
      println("TEST-0...${result}")
      
      result = driver(4, true)
      println("TEST-1...${result}")
      
      result = driver(64, true)
      println("TEST-2...${result}")
      
      result = driver(-64, false)
      println("TEST-3...${result}")
      
      result = driver(128, false)
      println("TEST-4...${result}")
      
      result = driver(1024, true)
      println("TEST-5...${result}")
      
      result = driver(97, false)
      println("TEST-6...${result}")
      
      result = driver(86, false)
      println("TEST-7...${result}")
      
      result = driver(14, false)
      println("TEST-8...${result}")
      
      result = driver(99, false)
      println("TEST-9...${result}")
      
          
  }
  
  main()
question_info.entry_fn_name: findWhetherAGivenNumberIsAPowerOf4OrNot2
question_info.entry_cls_name: Solution
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: kotlinc -script __FILENAME__ -no-reflect -nowarn