Loading...
Loading...
Loading...
A fitness band records the steps walked each day. The app shows, for every day, the total steps walked from day 1 up to that day. Print these running totals.
Example
Input
4 3000 5000 2000 8000
Output
3000 8000 10000 18000
Each total adds that day's steps to the total before it.
Try the problem first. Open one hint at a time.
Keep one running sum; add today's steps and print it.
The total can reach 10^14, so the sum must be a long.
Write your Java code, run it on the examples and submit it to hidden tests.
Solve in the editor