https://leetcode.com/problems/find-the-pivot-integer



Success



```python
class Solution:
    numbers = list(range(1, 1000 + 1))
    def pivotInteger(self, n: int) -> int:
        #2024/02/16 09:50
        if n == 1:
            return 1

        all_numbers = self.numbers[:n]
        for i in all_numbers:
            index = i - 1
            #print(all_numbers[:index], all_numbers[index-1:])
            first_part_sum = sum(all_numbers[:index])
            second_part_sum = sum(all_numbers[index-1:])
            if (first_part_sum == second_part_sum):
                return i-1
        return -1
        #2024/02/16 09:58
```
