title: Sum K Th Group Odd Positive Numbers
signature: sumKThGroupOddPositiveNumbers(k) {
test_code: import 'dart:convert';
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  bool validateSolution(int actual, int expected){
      return actual.toString() == expected.toString();
  }
  
  String driver(k, int expected){
      try
      {
          if (validateSolution(PLACEHOLDER_FN_NAME(k), expected)){
              return "PASSED";
          }
          return "FAILED";
      }catch(exception_object){
          return exception_object.runtimeType.toString();
      }
  }
  
  int main() {
  
      print("TEST-0...${driver(
          91, 
          753571)
      }");
  
      print("TEST-1...${driver(
          52, 
          140608)
      }");
  
      print("TEST-2...${driver(
          78, 
          474552)
      }");
  
      print("TEST-3...${driver(
          51, 
          132651)
      }");
  
      print("TEST-4...${driver(
          65, 
          274625)
      }");
  
      print("TEST-5...${driver(
          39, 
          59319)
      }");
  
      print("TEST-6...${driver(
          42, 
          74088)
      }");
  
      print("TEST-7...${driver(
          12, 
          1728)
      }");
  
      print("TEST-8...${driver(
          56, 
          175616)
      }");
  
      print("TEST-9...${driver(
          98, 
          941192)
      }");
  
      return 0;
  }
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;
  }