当前位置:网站首页>LeetCode 2011. Variable Value After Action (Simple)
LeetCode 2011. Variable Value After Action (Simple)
2022-08-10 05:55:00 【Shengxin Research Ape】
python
class Solution:
def finalValueAfterOperations(self, operations: List[str]) -> int:
x = 0
for i in range(len(operations)):
if(operations[i][1]=='+'):
x +=1
else:
x -=1
return x

边栏推荐
猜你喜欢
随机推荐
机器学习——聚类——商场客户聚类
error in ./node_modules/cesium/Source/ThirdParty/zip.js
泛型笔记()()()
Day1 微信小程序-小程序代码的构成
LeetCode 94. Inorder Traversal of Binary Trees (Simple)
Collection Map
Notes 1
pytorch-10.卷积神经网络(作业)
LeetCode 1894.找到需要补充粉笔的学生编号
Models corresponding to each architecture instruction set
大端以及小端以及读寄存器习惯
LeetCode 162.寻找峰值(中等)
sqlplus displays the previous command and the available backspace key
树结构——2-3树图解
ZigBee 网络设备相关内容
wiki confluence installation
链读推荐:从瓷砖到生成式 NFT
PyTorch之模型定义
Batch add watermark to pictures batch add background zoom batch merge tool picUnionV4.0
树结构——二叉查找树原理与实现








