Total the Daily Receipts

Basic

A 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]
Output108
Input[]
Output0
Hints
  • Accumulate with total += n in a for-each loop.
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.