Skip to content

Commit 5f8b038

Browse files
committed
1598
1 parent 8581d37 commit 5f8b038

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Jul-10-24.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class Solution:
2+
def minOperations(self, logs: List[str]) -> int:
3+
stk = []
4+
for i in logs:
5+
if i=='./':
6+
continue
7+
elif i=='../':
8+
if stk:
9+
stk.pop()
10+
else:
11+
stk.append(i[:-1])
12+
return len(stk)

0 commit comments

Comments
 (0)