682. Baseball Game

Practice Baseball Game for free on NudgeCode: Easy, Stack pattern. Write it in Python or JavaScript, run the tests in your browser, and ask for a hint when you are stuck.

You keep a record of scores, starting empty. Apply each string in operations in order:

Return the sum of all scores left in the record. Every operation is valid (there are always enough previous scores).

Example

operations = ["5","2","C","D","+"]  ->  30   (record ends as [5,10,15])

Constraints