Skip to content

Commit 3a94ef0

Browse files
Update 2011. Final Value of Variable After Performing Operations.py
1 parent 7ed0988 commit 3a94ef0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

python/easy/2011. Final Value of Variable After Performing Operations.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
class Solution:
22
def finalValueAfterOperations(self, operations: List[str]) -> int:
3+
"""
4+
finalValueAfterOperations returns the same when given 4 increment and decrement possibilities in list operations.
5+
++X and X++ increments, --X and X-- decrements, X begins at 0
6+
"""
37
addition_one = operations.count('X++')
48
addition_two = operations.count('++X')
59
subtraction_one = operations.count('X--')

0 commit comments

Comments
 (0)