diff --git a/go/crawler-log-folder.go b/go/crawler-log-folder.go new file mode 100644 index 0000000..a4a0751 --- /dev/null +++ b/go/crawler-log-folder.go @@ -0,0 +1,17 @@ +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 +}