title: Number Days Tank Will Become Empty
signature: function numberDaysTankWillBecomeEmpty(c: number, l: number): number {
source_py: def number_days_tank_will_become_empty(C, l):
      if (l >= C):
          return C
      eq_root = ((math.sqrt((1 + (8 * (C - l)))) - 1) / 2)
      return (math.ceil(eq_root) + l)
source_cpp: int number_days_tank_will_become_empty(int C, int l) {
    if ( l >= C ) return C;
    double eq_root = ( std :: sqrt ( 1 + 8 * ( C - l ) ) - 1 ) / 2;
    return std :: ceil ( eq_root ) + l;
  }
question_info.test_list: [{"idx": 0, "outputs": 40, "inputs": {"c": 91, "l": 29}}, {"idx": 1, "outputs": 64, "inputs": {"c": 99, "l": 55}}, {"idx": 2, "outputs": 11, "inputs": {"c": 11, "l": 56}}, {"idx": 3, "outputs": 23, "inputs": {"c": 23, "l": 56}}, {"idx": 4, "outputs": 12, "inputs": {"c": 12, "l": 97}}, {"idx": 5, "outputs": 1, "inputs": {"c": 1, "l": 64}}, {"idx": 6, "outputs": 10, "inputs": {"c": 18, "l": 5}}, {"idx": 7, "outputs": 14, "inputs": {"c": 14, "l": 37}}, {"idx": 8, "outputs": 13, "inputs": {"c": 13, "l": 55}}, {"idx": 9, "outputs": 36, "inputs": {"c": 36, "l": 99}}]
question_info.entry_cls_name: Solution
question_info.test_code: 
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function convertToString(value: any): string{
      return JSON.stringify(value, function (key, val) {
          if (val instanceof Set) {
              return Array.from(val);
          } return val;});
  }
  
  function validateSolution(actual: number, expected: number): boolean {
      return convertToString(actual) === convertToString(expected);
  }
  
  function driver(c: number, l: number, expected:number): string {
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(c, l),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(91, 29, 40);
    console.log(`TEST-0...${result}`);
  
    result = driver(99, 55, 64);
    console.log(`TEST-1...${result}`);
  
    result = driver(11, 56, 11);
    console.log(`TEST-2...${result}`);
  
    result = driver(23, 56, 23);
    console.log(`TEST-3...${result}`);
  
    result = driver(12, 97, 12);
    console.log(`TEST-4...${result}`);
  
    result = driver(1, 64, 1);
    console.log(`TEST-5...${result}`);
  
    result = driver(18, 5, 10);
    console.log(`TEST-6...${result}`);
  
    result = driver(14, 37, 14);
    console.log(`TEST-7...${result}`);
  
    result = driver(13, 55, 13);
    console.log(`TEST-8...${result}`);
  
    result = driver(36, 99, 36);
    console.log(`TEST-9...${result}`);
  
  };
  
  main();
question_info.extension: ts
question_info.entry_fn_name: numberDaysTankWillBecomeEmpty
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: tsc --target es2020 --lib es5,dom,es2015,es2020 __FILENAME__
question_info.commands: node __FILENAME__.js