title: Hexagonal Number
signature: fun hexagonalNumber(n: Int): Int {
test_code: package main
  
  import kotlin.text.*
  import kotlin.math.*
  
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  fun validateSolution(actual:Int, expected:Int):Boolean{
    return actual.equals(expected)
  }
  fun driver(n: Int, expected:Int):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver(38, 2850)
      println("TEST-0...${result}")
      
      result = driver(44, 3828)
      println("TEST-1...${result}")
      
      result = driver(58, 6670)
      println("TEST-2...${result}")
      
      result = driver(10, 190)
      println("TEST-3...${result}")
      
      result = driver(31, 1891)
      println("TEST-4...${result}")
      
      result = driver(53, 5565)
      println("TEST-5...${result}")
      
      result = driver(94, 17578)
      println("TEST-6...${result}")
      
      result = driver(64, 8128)
      println("TEST-7...${result}")
      
      result = driver(71, 10011)
      println("TEST-8...${result}")
      
      result = driver(59, 6903)
      println("TEST-9...${result}")
      
          
  }
  
  main()
source_py: def hexagonal_number(n):
      return (n * ((2 * n) - 1))
source_cpp: int hexagonal_number(int n) {
    return n * ( 2 * n - 1 );
  }