The file system records crawler log operations for navigating directories. Initially, you begin in the main folder.
You are given an array of strings logs, where logs[i] represents the operation performed at step
"../": Navigate up to the parent folder of the current directory. If you are already at the main folder, remain where you are.
"./": Remain in the current directory.
"x/": Navigate into the child folder named x (which is guaranteed to exist).
Return the minimum number of operations required to navigate back to the main folder after processing all the logs.
Constraints:
logs.length
logs[i].length
logs[i] contains lowercase English letters, digits, '.', and '/'
logs[i] follows the specified format
Folder names consist of lowercase English letters and digits
The file system records crawler log operations for navigating directories. Initially, you begin in the main folder.
You are given an array of strings logs, where logs[i] represents the operation performed at step
"../": Navigate up to the parent folder of the current directory. If you are already at the main folder, remain where you are.
"./": Remain in the current directory.
"x/": Navigate into the child folder named x (which is guaranteed to exist).
Return the minimum number of operations required to navigate back to the main folder after processing all the logs.
Constraints:
logs.length
logs[i].length
logs[i] contains lowercase English letters, digits, '.', and '/'
logs[i] follows the specified format
Folder names consist of lowercase English letters and digits