title: Decimal Binary Conversion Without Using Arithmetic Operators
signature: function decimalBinaryConversionWithoutUsingArithmeticOperators(n) {
test_code: 
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function convertToString(value) {
      return JSON.stringify(value, function (key, val) {
          if (val instanceof Set) {
              return Array.from(val);
          } return val;});
  }
  
  function validateSolution(actual, expected){
      return convertToString(actual)===convertToString(expected);
  }
  
  function driver(n, expected){
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(35, "100011");
    console.log(`TEST-0...${result}`);
  
    result = driver(17, "10001");
    console.log(`TEST-1...${result}`);
  
    result = driver(8, "1000");
    console.log(`TEST-2...${result}`);
  
    result = driver(99, "1100011");
    console.log(`TEST-3...${result}`);
  
    result = driver(57, "111001");
    console.log(`TEST-4...${result}`);
  
    result = driver(39, "100111");
    console.log(`TEST-5...${result}`);
  
    result = driver(99, "1100011");
    console.log(`TEST-6...${result}`);
  
    result = driver(14, "1110");
    console.log(`TEST-7...${result}`);
  
    result = driver(22, "10110");
    console.log(`TEST-8...${result}`);
  
    result = driver(7, "111");
    console.log(`TEST-9...${result}`);
  
    process.exit(0);
  };
  
  if (require.main === module) {
    main();
  }
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;
  }