title: Decimal Binary Conversion Without Using Arithmetic Operators
signature: fun decimalBinaryConversionWithoutUsingArithmeticOperators(n: Int): String {
source_py: def decimal_binary_conversion_without_using_arithmetic_operators(n):
      if (n == 0):
          return '0'
      bin = ''
      while (n > 0):
          if ((n & 1) == 0):
              bin = ('0' + bin)
          else:
              bin = ('1' + bin)
          n = (n >> 1)
      return bin
source_cpp: string decimal_binary_conversion_without_using_arithmetic_operators(int n) {
    if ( n == 0 ) return "0";
    string bin = "";
    while ( n > 0 ) {
      bin = ( ( n & 1 ) == 0 ? '0' : '1' ) + bin;
      n >>= 1;
    }
    return bin;
  }
question_info.test_list: [{"idx": 0, "outputs": "100011", "inputs": {"n": 35}}, {"idx": 1, "outputs": "10001", "inputs": {"n": 17}}, {"idx": 2, "outputs": "1000", "inputs": {"n": 8}}, {"idx": 3, "outputs": "1100011", "inputs": {"n": 99}}, {"idx": 4, "outputs": "111001", "inputs": {"n": 57}}, {"idx": 5, "outputs": "100111", "inputs": {"n": 39}}, {"idx": 6, "outputs": "1100011", "inputs": {"n": 99}}, {"idx": 7, "outputs": "1110", "inputs": {"n": 14}}, {"idx": 8, "outputs": "10110", "inputs": {"n": 22}}, {"idx": 9, "outputs": "111", "inputs": {"n": 7}}]
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:String, expected:String):Boolean{
    return actual.equals(expected)
  }
  fun driver(n: Int, expected:String):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(35, "100011")
      println("TEST-0...${result}")
      
      result = driver(17, "10001")
      println("TEST-1...${result}")
      
      result = driver(8, "1000")
      println("TEST-2...${result}")
      
      result = driver(99, "1100011")
      println("TEST-3...${result}")
      
      result = driver(57, "111001")
      println("TEST-4...${result}")
      
      result = driver(39, "100111")
      println("TEST-5...${result}")
      
      result = driver(99, "1100011")
      println("TEST-6...${result}")
      
      result = driver(14, "1110")
      println("TEST-7...${result}")
      
      result = driver(22, "10110")
      println("TEST-8...${result}")
      
      result = driver(7, "111")
      println("TEST-9...${result}")
      
          
  }
  
  main()
question_info.entry_fn_name: decimalBinaryConversionWithoutUsingArithmeticOperators
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