title: Find Whether A Given Number Is A Power Of 4 Or Not 1
signature: function find_whether_a_given_number_is_a_power_of_4_or_not_1(n)
test_code: using Printf
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  function validate_solution(actual, expected)
      return actual == expected
  end
  
  function driver(n, expected)
      try
  
          if validate_solution(PLACEHOLDER_FN_NAME(n), expected)
              return "PASSED";
          end
          return "FAILED";
      catch exception_obj
          return string(Base.typename(typeof(exception_obj)).wrapper);
      end
  end
  
  function main()
      
      result = driver(1, true);
      @printf("TEST-0...%s\n",result);
      
      result = driver(4, true);
      @printf("TEST-1...%s\n",result);
      
      result = driver(64, true);
      @printf("TEST-2...%s\n",result);
      
      result = driver(-64, false);
      @printf("TEST-3...%s\n",result);
      
      result = driver(128, false);
      @printf("TEST-4...%s\n",result);
      
      result = driver(1024, true);
      @printf("TEST-5...%s\n",result);
      
      result = driver(45, false);
      @printf("TEST-6...%s\n",result);
      
      result = driver(33, false);
      @printf("TEST-7...%s\n",result);
      
      result = driver(66, false);
      @printf("TEST-8...%s\n",result);
      
      result = driver(74, false);
      @printf("TEST-9...%s\n",result);
      
  end
  
  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;
  }