Dashboard Temp Share Shortlinks Frames API

HTMLify

LeetCode - Crawler Log Folder - Go
Views: 302 | Author: abh
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
func minOperations(logs []string) int {
    depth := 0
    for _, o := range logs {
        if o == "../" {
            if depth > 0 {
                depth--
            }
            continue
        }
        if o == "./" {
            continue
        }
        depth++
    }
    return depth
}