1598. Crawler Log Folder

Обновлено: 2024-03-12
1 мин
[]

Содержание

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