---
# System prepended metadata

title: 1598. Crawler Log Folder
tags: [Leetcode, Easy]

---

# 1598. Crawler Log Folder
###### tags: `Leetcode` `Easy`
## Code
```java=
class Solution {
    public int minOperations(String[] logs) {
        int ans = 0;
        for(String log:logs){
            if(log.equals("../")) ans = ans<=0?0:ans-1;
            else if(!log.equals("./")) ans+=1;
        }
        return ans<0?0:ans;
    }
}
```