title: Find Whether A Given Number Is A Power Of 4 Or Not 1
signature: fun findWhetherAGivenNumberIsAPowerOf4OrNot1(n: Int): Boolean {
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(45, false)
      println("TEST-6...${result}")
      
      result = driver(33, false)
      println("TEST-7...${result}")
      
      result = driver(66, false)
      println("TEST-8...${result}")
      
      result = driver(74, false)
      println("TEST-9...${result}")
      
          
  }
  
  main()
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;
  }