O(n * (upper-lower)) time complexity?

```
class Solution(object):
def countRangeSum(self, nums, lower, upper):
psums, sum, count = {0:1}, 0, 0
for num in nums:
sum += num
for x in range(sum-upper, sum-lower+1):
count += psums.get(x, 0)
psums[sum] = psums.get(sum, 0)+1
return count
```