1598. Crawler Log Folder

Updated: 2024-03-12
1 min read
[]

On This Page

LeetCode problem 1598

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