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

Given a positive integer n, find the pivot integer x such that:

The sum of all elements between 1 and x inclusively equals the sum of all elements between x and n inclusively.

Return the pivot integer x. If no such integer exists, return -1. It is guaranteed that there will be at most one pivot index for the given input.
 
Please complete the following python code precisely:
```python
class Solution:
    def pivotInteger(self, n: int) -> int:
```