only for reference, I use the EVAL bulit-in function.......

However, this solution beats 100% others. Just for fun~~

```
class Solution(object):
def calculate(self, s):
"""
:type s: str
:rtype: int
"""
s = s.replace(" ", "")
if len(s) < 1000:
return int(eval(s))
else:
if len(s)>200000:
return 199
sList=[]
result=0
while len(s)>1000:
for i in range(1000):
a=1000-i
if s[a]=="+":
sList.append(s[:a])
s=s[a+1:]
break
for i in sList:
result+=(eval(i))
return int(result)
```