title: Sum K Th Group Odd Positive Numbers
signature: function sumKThGroupOddPositiveNumbers(k: number): number {
source_py: def sum_k_th_group_odd_positive_numbers(k):
      cur = int(((k * (k - 1)) + 1))
      sum = 0
      while k:
          sum += cur
          cur += 2
          k = (k - 1)
      return sum
source_cpp: int sum_k_th_group_odd_positive_numbers(int k) {
    int cur = ( k * ( k - 1 ) ) + 1;
    int sum = 0;
    while ( k -- ) {
      sum += cur;
      cur += 2;
    }
    return sum;
  }
question_info.test_list: [{"idx": 0, "outputs": 753571, "inputs": {"k": 91}}, {"idx": 1, "outputs": 140608, "inputs": {"k": 52}}, {"idx": 2, "outputs": 474552, "inputs": {"k": 78}}, {"idx": 3, "outputs": 132651, "inputs": {"k": 51}}, {"idx": 4, "outputs": 274625, "inputs": {"k": 65}}, {"idx": 5, "outputs": 59319, "inputs": {"k": 39}}, {"idx": 6, "outputs": 74088, "inputs": {"k": 42}}, {"idx": 7, "outputs": 1728, "inputs": {"k": 12}}, {"idx": 8, "outputs": 175616, "inputs": {"k": 56}}, {"idx": 9, "outputs": 941192, "inputs": {"k": 98}}]
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(k: number, expected:number): string {
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(k),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(91, 753571);
    console.log(`TEST-0...${result}`);
  
    result = driver(52, 140608);
    console.log(`TEST-1...${result}`);
  
    result = driver(78, 474552);
    console.log(`TEST-2...${result}`);
  
    result = driver(51, 132651);
    console.log(`TEST-3...${result}`);
  
    result = driver(65, 274625);
    console.log(`TEST-4...${result}`);
  
    result = driver(39, 59319);
    console.log(`TEST-5...${result}`);
  
    result = driver(42, 74088);
    console.log(`TEST-6...${result}`);
  
    result = driver(12, 1728);
    console.log(`TEST-7...${result}`);
  
    result = driver(56, 175616);
    console.log(`TEST-8...${result}`);
  
    result = driver(98, 941192);
    console.log(`TEST-9...${result}`);
  
  };
  
  main();
question_info.extension: ts
question_info.entry_fn_name: sumKThGroupOddPositiveNumbers
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