mirror of
https://github.com/devenperez/leetcode.git
synced 2026-06-13 14:57:08 +00:00
11 lines
282 B
Python
11 lines
282 B
Python
class Solution:
|
|
def finalValueAfterOperations(self, operations: List[str]) -> int:
|
|
value = 0
|
|
|
|
for op in operations:
|
|
if op[1] == "+":
|
|
value += 1
|
|
else:
|
|
value -= 1
|
|
|
|
return value |