国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

leetcode 1598. Crawler Log Folder(easy)

2022-02-19 09:56 作者:您是打尖兒還是住店呢  | 我要投稿


The Leetcode file system keeps a log each time some user performs a?change folder?operation.

The operations are described below:

  • "../"?: Move to the parent folder of the current folder. (If you are already in the main folder,?remain in the same folder).

  • "./"?: Remain in the same folder.

  • "x/"?: Move to the child folder named?x?(This folder is?guaranteed to always exist).

You are given a list of strings?logs?where?logs[i]?is the operation performed by the user at the?ith?step.

The file system starts in the main folder, then the operations in?logs?are performed.

Return?the minimum number of operations needed to go back to the main folder after the change folder operations.

?

Example 1:

Input: logs = ["d1/","d2/","../","d21/","./"]Output: 2Explanation: Use this change folder operation "../" 2 times and go back to the main folder.

Example 2:

Input: logs = ["d1/","d2/","./","d3/","../","d31/"]Output: 3

Example 3:

Input: logs = ["d1/","../","../","../"]Output: 0

?

Constraints:

  • 1 <= logs.length <= 103

  • 2 <= logs[i].length <= 10

  • logs[i]?contains lowercase English letters, digits,?'.', and?'/'.

  • logs[i]?follows the format described in the statement.



Runtime:?0 ms, faster than?100.00%?of?Java?online submissions for?Crawler Log Folder.

Memory Usage:?41.3 MB, less than?38.53%?of?Java?online submissions for?Crawler Log Folder.


leetcode 1598. Crawler Log Folder(easy)的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
舞阳县| 清远市| 巩留县| 兴文县| 苏尼特右旗| 巩义市| 大港区| 呼和浩特市| 赣榆县| 密山市| 堆龙德庆县| 沐川县| 通许县| 来宾市| 图们市| 葵青区| 杭锦后旗| 巴林左旗| 子长县| 乌兰察布市| 华宁县| 响水县| 峨山| 灵台县| 万全县| 玛沁县| 和平区| 大洼县| 盘山县| 建德市| 且末县| 景德镇市| 互助| 舟曲县| 钦州市| 马关县| 桃园市| 洞头县| 云安县| 大关县| 闵行区|