当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
Database Notes Create Database, Table Backup
转载fstream,ifstream的详细用法
LeetCode 剑指offer 10-I.斐波那契数列(简单)
微信小程序-小程序的宿主环境
Small program wx.request simple Promise package
细说MySql索引原理
Four characteristics of ACID
国内数字藏品投资价值分析
opencv
链表API设计
深度学习TensorFlow入门环境配置
数据库 笔记 创建数据库、表 备份
开源免费WMS仓库管理系统【推荐】
ORACLE系统表空间SYSTEM占满无法扩充表空间问题解决过程
Analysis of the investment value of domestic digital collections
Canal reports Could not find first log file name in binary log index file
树结构——2-3树图解
Reprint fstream, detailed usage of ifstream
LeetCode 2011.执行操作后的变量值(简单)
LeetCode 面试题17.14 最小k个数(中等)