```
public int[] getModifiedArray(int length, int[][] updates) {
int[] res = new int[length];
int value = 0, start = 0, end = 0;
for(int i = 0 ;i < updates.length; i++) {
start = updates[i][0];
end = updates[i][1];
value = updates[i][2];
for(int k = start; k <= end; k++) {
res[k] += value;
}
}
return res;
}
```