1598. Crawler Log Folder
On This Page
class Solution:
def minOperations(self, logs: List[str]) -> int:
res = 0
for v in logs:
if v == "../":
res = max(0, res - 1)
elif v[0] != ".":
res += 1
return res