Please solve the programming task below using a self-contained code snippet in a markdown code block.

Given an integer array nums of length n and an integer target, find three integers in nums such that the sum is closest to target.
Return the sum of the three integers.
You may assume that each input would have exactly one solution.
 
Please complete the following python code precisely:
```python
class Solution:
    def threeSumClosest(self, nums: List[int], target: int) -> int:
```