最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

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

【每日一題】LeetCode1598-Crawler Log Folder

2022-09-09 23:03 作者:安然Nano  | 我要投稿

Difficulty: easy????CompletionTime: 49s

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.

LeetCode 1598

純模擬題,最后所在文件樹的深度即為所求結(jié)果。


【每日一題】LeetCode1598-Crawler Log Folder的評論 (共 條)

分享到微博請遵守國家法律
桐城市| 卢湾区| 施甸县| 赫章县| 砀山县| 铁岭县| 苏尼特右旗| 称多县| 和田县| 会宁县| 海原县| 同仁县| 石屏县| 拉萨市| 赞皇县| 拜城县| 乃东县| 河源市| 襄城县| 遵化市| 荆州市| 抚远县| 新晃| 万盛区| 望城县| 定远县| 新津县| 潜山县| 田东县| 平湖市| 沙雅县| 昔阳县| 遵义县| 凤阳县| 武城县| 通化县| 江川县| 龙里县| 大石桥市| 花莲市| 宁海县|