title: Decimal Binary Conversion Without Using Arithmetic Operators
signature: class Solution {
  
      public String decimalBinaryConversionWithoutUsingArithmeticOperators(Integer n) {
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.extension: java
question_info.entry_fn_name: decimalBinaryConversionWithoutUsingArithmeticOperators
question_info.entry_cls_name: Solution
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.test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(Integer n, String expected){
          try{
              Driver driver = new Driver();
              if (driver.run(n,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution(35, "100011");
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(17, "10001");
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(8, "1000");
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(99, "1100011");
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(57, "111001");
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(39, "100111");
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(99, "1100011");
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(14, "1110");
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(22, "10110");
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution(7, "111");
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(Integer n, String expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(n),expected);
      }
      
      public boolean validateSolution(String actual, String expected){
          return actual.equals(expected);
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: java __FILENAME__