Total the Daily Receipts
Basic SolvedA finance widget shows the total of a day’s receipt amounts. Given the list of amounts, return their sum.
Implement `solve(List<Integer> nums)` to return the sum of all values.
Examples
Input
[4, 8, 15, 16, 23, 42]Output
108Input
[]Output
0Hints
- Accumulate with total += n in a for-each loop.
Tests
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.