title: Sum Series 555555 N Terms
signature: function sumSeries555555NTerms(n: number): number {
source_py: def sum_series_555555_n_terms(n):
      return int(((0.6172 * (pow(10, n) - 1)) - (0.55 * n)))
source_cpp: int sum_series_555555_n_terms(int n) {
    return 0.6172 * ( pow ( 10, n ) - 1 ) - 0.55 * n;
  }
question_info.test_list: [{"idx": 0, "outputs": 617200000000000000, "inputs": {"n": 18}}, {"idx": 1, "outputs": 61719999999991, "inputs": {"n": 14}}, {"idx": 2, "outputs": 617199999999991, "inputs": {"n": 15}}, {"idx": 3, "outputs": 614, "inputs": {"n": 3}}]
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(n: number, expected:number): string {
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(18, 617200000000000000);
    console.log(`TEST-0...${result}`);
  
    result = driver(14, 61719999999991);
    console.log(`TEST-1...${result}`);
  
    result = driver(15, 617199999999991);
    console.log(`TEST-2...${result}`);
  
    result = driver(3, 614);
    console.log(`TEST-3...${result}`);
  
  };
  
  main();
question_info.extension: ts
question_info.entry_fn_name: sumSeries555555NTerms
question_info.test_case_ids: 0 1 2 3
question_info.commands: tsc --target es2020 --lib es5,dom,es2015,es2020 __FILENAME__
question_info.commands: node __FILENAME__.js