title: Hexagonal Number
signature: function hexagonalNumber(n) {
test_code: 
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function convertToString(value) {
      return JSON.stringify(value, function (key, val) {
          if (val instanceof Set) {
              return Array.from(val);
          } return val;});
  }
  
  function validateSolution(actual, expected){
      return convertToString(actual)===convertToString(expected);
  }
  
  function driver(n, expected){
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(38, 2850);
    console.log(`TEST-0...${result}`);
  
    result = driver(44, 3828);
    console.log(`TEST-1...${result}`);
  
    result = driver(58, 6670);
    console.log(`TEST-2...${result}`);
  
    result = driver(10, 190);
    console.log(`TEST-3...${result}`);
  
    result = driver(31, 1891);
    console.log(`TEST-4...${result}`);
  
    result = driver(53, 5565);
    console.log(`TEST-5...${result}`);
  
    result = driver(94, 17578);
    console.log(`TEST-6...${result}`);
  
    result = driver(64, 8128);
    console.log(`TEST-7...${result}`);
  
    result = driver(71, 10011);
    console.log(`TEST-8...${result}`);
  
    result = driver(59, 6903);
    console.log(`TEST-9...${result}`);
  
    process.exit(0);
  };
  
  if (require.main === module) {
    main();
  }
source_py: def hexagonal_number(n):
      return (n * ((2 * n) - 1))
source_cpp: int hexagonal_number(int n) {
    return n * ( 2 * n - 1 );
  }