title: Write One Line C Function To Find Whether A No Is Power Of Two
signature: fun writeOneLineCFunctionToFindWhetherANoIsPowerOfTwo(n: Int): Boolean {
source_py: def write_one_line_c_function_to_find_whether_a_no_is_power_of_two(n):
      if (n == 0):
          return False
      while (n != 1):
          if ((n % 2) != 0):
              return False
          n = (n // 2)
      return True
source_cpp: bool write_one_line_c_function_to_find_whether_a_no_is_power_of_two(int n) {
    if ( n == 0 ) return 0;
    while ( n != 1 ) {
      if ( n % 2 != 0 ) return 0;
      n = n / 2;
    }
    return 1;
  }
question_info.test_list: [{"idx": 0, "outputs": true, "inputs": {"n": 1}}, {"idx": 1, "outputs": true, "inputs": {"n": 2}}, {"idx": 2, "outputs": true, "inputs": {"n": 8}}, {"idx": 3, "outputs": true, "inputs": {"n": 1024}}, {"idx": 4, "outputs": false, "inputs": {"n": 24}}, {"idx": 5, "outputs": false, "inputs": {"n": 7}}, {"idx": 6, "outputs": false, "inputs": {"n": 46}}, {"idx": 7, "outputs": false, "inputs": {"n": 61}}, {"idx": 8, "outputs": false, "inputs": {"n": 73}}, {"idx": 9, "outputs": false, "inputs": {"n": 66}}]
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(2, true)
      println("TEST-1...${result}")
      
      result = driver(8, true)
      println("TEST-2...${result}")
      
      result = driver(1024, true)
      println("TEST-3...${result}")
      
      result = driver(24, false)
      println("TEST-4...${result}")
      
      result = driver(7, false)
      println("TEST-5...${result}")
      
      result = driver(46, false)
      println("TEST-6...${result}")
      
      result = driver(61, false)
      println("TEST-7...${result}")
      
      result = driver(73, false)
      println("TEST-8...${result}")
      
      result = driver(66, false)
      println("TEST-9...${result}")
      
          
  }
  
  main()
question_info.entry_fn_name: writeOneLineCFunctionToFindWhetherANoIsPowerOfTwo
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