```
res = 0
for i,n in enumerate(stack):
res += n * (10**(len(stack)-1-i))
return str(res)
for n in stack:
res += str(n)
return str(int(res))
The above one takes 10x more time than the second one, why? The first one assume stack = list[int], the second one assume stack = list[str]
```