you keep score baseball game strange rule at begin game start recordyou give list string operations operationsi ith operation apply record followingan integer xRecord new score xRecord new score sum previous scoresdrecord new score double previous scorecinvalidate previous score remove recordreturn sum score record apply operationsThe test case generate answer intermediate calculation fit 32bit integer operation valid Example 1input op 52cdoutput 30explanation5 add 5 record record 52 add 2 record record 5 2C Invalidate remove previous score record 5D add 2 5 10 record record 5 10 Add 5 10 15 record record 5 10 15the total sum 5 10 15 30example 2input op 524cd9output 27explanation5 add 5 record record 52 add 2 record record 5 24 add 4 record record 5 2 4c Invalidate remove previous score record 5 2D Add 2 2 4 record record 5 2 49 Add 9 record record 5 2 4 9 add 4 9 5 record record 5 2 4 9 5 Add 9 5 14 record record 5 2 4 9 5 14the total sum 5 2 4 9 5 14 27example 3input op 1coutput 0Explanation1 add 1 record record 1C Invalidate remove previous score record since record total sum 0 Constraints1 operationslength 1000operationsi c D string represent integer range 3 104 3 104for operation previous score recordFor operation C d previous score record