1
0
Fork 0
mirror of https://gitlab.com/mfocko/LeetCode.git synced 2024-11-10 00:09:06 +01:00
LeetCode/go/crawler-log-folder.go

18 lines
229 B
Go
Raw Normal View History

package main
func minOperations(logs []string) int {
depth := 0
for _, dir := range logs {
if dir == "../" {
depth = max(0, depth-1)
} else if dir == "./" {
/* no-op */
} else {
depth++
}
}
return depth
}