This commit is contained in:
parent
9d8cb29871
commit
1479c11038
1 changed files with 15 additions and 0 deletions
15
easy/crawler_log_folder.py
Normal file
15
easy/crawler_log_folder.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
# https://leetcode.com/problems/crawler-log-folder
|
||||
from typing import List
|
||||
|
||||
class Solution:
|
||||
def minOperations(self, logs: List[str]) -> int:
|
||||
ret = 0
|
||||
for dir in logs:
|
||||
if dir == "./":
|
||||
continue
|
||||
elif dir == "../":
|
||||
ret += -1 if ret > 0 else 0
|
||||
else:
|
||||
ret += 1
|
||||
return ret
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue