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

Given an integer n, return the number of ways you can write n as the sum of consecutive positive integers.
 
Please complete the following python code precisely:
```python
class Solution:
    def consecutiveNumbersSum(self, n: int) -> int:
```