[Python3] Prefix sum O(k+n^2)
```python3 []
class Solution:
    def rangeAddQueries(self, n: int, queries: List[List[int]]) -> List[List[int]]:
        arr = [[0 for _ in range(n)] for _ in range(n)]
        for i1,j1,i2,j2 in queries:
            arr[i1][j1] += 1
            if j2+1 < n: arr[i1][j2+1] -= 1
            if i2+1 < n: arr[i2+1][j1] -= 1
            if i2+1 < n and j2+1 < n: arr[i2+1][j2+1] += 1
        for i in range(n):
            for j in range(1,n):
                arr[i][j] += arr[i][j-1]
        for i in range(1,n):
            for j in range(n):
                arr[i][j] += arr[i-1][j]
        return arr

```
['Python3']