当前位置:网站首页>LeetCode 2011.执行操作后的变量值(简单)
LeetCode 2011.执行操作后的变量值(简单)
2022-08-10 05:32:00 【生信研究猿】
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
边栏推荐
猜你喜欢
随机推荐
21天挑战杯MySQL——Day06
十年磨一剑!数字藏品行情软件,链读APP正式开放内测!
Smart contracts and DAPP decentralized applications
力扣——情侣牵手
generic notes()()()
The latest and most complete digital collection sales calendar-07.26
我不喜欢我的代码
wiki confluence 安装
LeetCode 面试题17.14 最小k个数(中等)
Timer (setInterval) on and off
The Principle of Union Search and API Design
链读精选:星巴克着眼于数字收藏品并更好地吸引客户
图片批量添加水印批量加背景缩放批量合并工具picUnionV4.0
棋类游戏-五子棋小游戏
Content related to ZigBee network devices
GUI_AWT
开源免费WMS仓库管理系统【推荐】
反射【笔记】
The latest and most complete digital collection sales calendar-07.27
链读|最新最全的数字藏品发售日历-08.02