Chart the Cumulative Revenue

Intermediate

A dashboard plots revenue accumulating day by day. Given the daily amounts, produce the running total at each point in the series.

Implement `solve(List<Integer> nums)` to return a list where each element is the cumulative sum up to and including that index.

Examples

Input[1, 2, 3, 4]
Output[1, 3, 6, 10]
Input[5, -2, 7]
Output[5, 3, 10]
Hints
  • Keep a running sum; append its current value at each step.
Anonymous Apex

Your code runs in a secure sandbox against multiple hidden test cases. The problem is solved only when every test passes. Each run is isolated and any data changes are rolled back automatically.