Skip to content

Commit d200311

Browse files
committed
Time: 0 ms (100%), Space: 17.7 MB (60.7%) - LeetHub
1 parent 061b1df commit d200311

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class Solution:
2+
def finalValueAfterOperations(self, operations: List[str]) -> int:
3+
x = 0
4+
for operation in operations:
5+
if operation.replace("X", "") == "--":
6+
x -= 1
7+
else:
8+
x += 1
9+
return x

0 commit comments

Comments
 (0)