python算法题--简单--文件夹操作日志搜集器

class Solution:
    def minOperations(selflogs: List[str]) -> int:
        result=0
        for i in range(0,len(logs)):
            if logs[i]=='../':
                if result>0:
                    result-=1
            elif logs[i]=='./':
                continue
            else:
                result+=1
        return result
posted @ 2022-09-09 15:24  盗哥泡茶去了  阅读(11)  评论(0编辑  收藏  举报