Skip to content

Commit d51afae

Browse files
committed
Added Crawler Log Folder.java
1 parent 270ed55 commit d51afae

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Easy/Crawler Log Folder.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
class Solution {
2+
public int minOperations(String[] logs) {
3+
int currPos = 0;
4+
for (String log : logs) {
5+
if (log.equals("../")) {
6+
currPos -= currPos == 0 ? 0 : 1;
7+
}
8+
else if (!log.equals("./")) {
9+
currPos++;
10+
}
11+
}
12+
return currPos;
13+
}
14+
}

0 commit comments

Comments
 (0)