q
原创 2023-06-16 11:22:58
77阅读
Given an absolute path for a file (Unix-style), simplify it.For example,path="/home/", =>"/home"path="/a/./b/../../c/", =>"/c"click to show corner cas...
转载 2014-12-01 23:15:00
37阅读
Simplify Path   Given an absolute path for a file (Unix-style), simplify it. For example, path = "/home/", => "/home" path = "/a/./b/../../c/", => "/c" class Solution { public: //遇到/.就
原创 2023-02-17 09:42:52
33阅读
Given an absolute path for a file (Unix-style), simplify it.For example,path="/home/", =>"/home"path="/a/./b/../../c/", =>"/c"思路以/为分界符split,如/a/./b/.....
原创 2021-08-07 11:47:02
111阅读
Given an absolute path for a file (Unix-style), simplify it.For example,path="/home/", =>"/home"path="/a/./b/../../c/", =>"/c"click to show corner cas...
转载 2013-10-02 04:18:00
96阅读
2评论
题目: Given an absolute path for a file (Unix-style), simplify it.For example, path = ​ ​"/home/"​​, => ​ ​"/home"​​ path = ​ ​"/a/./b/../../c/"​​, => ​ ​"/c"​​分析:此题主要需注意以下两点1、结果起码有一个​​"/"​​2
转载 2013-05-22 21:41:00
118阅读
2评论
Given an absolute path for a file (Unix-style), simplify it.For example,path="/home/", =>"/home"path="/a/./b/../../c/", =>"/c"Corner Cases:Did you con...
转载 2014-07-15 22:04:00
49阅读
2评论
Given an absolute path for a file (Unix-style), simplify it. For example,path = "/home/", => "/home"path = "/a/./b/../../c/", => "/c" 题意:问最后的路径是什么。 思路:说白了就是字符串的处理。".."的话就pop一个,字母的话就是push
转载 2017-08-04 16:17:00
66阅读
2评论
Given an absolute path for a file (Unix-style), simplify it. For example, path="/home/", =>"/home" path="/a/./b/http://www.cnblogs.com/c/", =>"/c" 这个题就是拼体力的,用一个string的stack,然后码就可以了。。。注意边界条件class Solution {public: string simplifyPath(string path) { // Sta Read More
转载 2013-03-29 20:12:00
108阅读
2评论
Given an absolute path for a file (Unix-style), simplify it. For example, path = "/home/", => "/home" path = "/a/./b/../../c/", => "/c" 难度:85,虽然不难,但是里
转载 2014-10-10 13:20:00
97阅读
2评论
Given an absolute path for a file (Unix-style), simplify it. For example, path = "/home/", => "/home" path = "/a/./b/../../c/", => "/c" click to show
转载 2017-05-15 12:40:00
63阅读
https://leetcode.com/problems/simplify-path/ https://leetcode.com/mockinterview/session/result/xjl3d3m/ 现在字符串比较,都知道用 equals了,哈哈。不能用==,否则可能有bug。
转载 2016-11-05 18:31:00
39阅读
2评论
QuestionGiven an absolute path for a file (Unix-style), simplify it.For example, path = “/home/”, => “/home” path = “/a/./b/../../c/”, => “/c”本题难度Medium。【复杂度】 时间 O(N) 空间 O(N) 【思路】 思路很简单,先将整个路径按照/
转载 2023-02-02 14:58:50
44阅读
Given an absolute path for a file (Unix-style), simplify it.For example,path="/home/", =>"/home"path="/a/./b/../../c/", =>"/c"click to show corner cas...
转载 2015-03-10 16:26:00
74阅读
2评论
Given an absolute path for a file (Unix-style), simplify it. For example, path = "/home/", => "/home" path = "/a/./b/../../c/", => "/c" click to show
转载 2017-07-27 12:09:00
88阅读
2评论
题目链接:https://leetcode.com/problems/simplify-path/题目:Given an absol
原创 2023-07-26 16:43:07
283阅读
题目大意化简Unix系统下一个文件的绝对路径。解题思路栈参考: https://shenjie1993.gitbooks.io/leetcode-python/071%20Simplify%20Path.html“/” 根目录“..” 跳转上级目录,上级目录为空,所以依旧处于 “/”“a” 进入子目录a,目前处于 “/a”“b” 进入子目录b,目前处于 “/a/b”“c” 进入子目录c,
原创 2021-06-16 19:51:28
246阅读
Given an absolute path for a file (Unix-style), simplify it.For example,path="/home/", =>"/home"path="/a/./b/../../c/", =>"/c"click to show corner cas...
转载 2015-02-09 14:23:00
158阅读
2评论
Given an absolute path for a file (Unix-style), simplify it. Or in other words, convert it to the canonical path. In a UNIX-style file system, a perio
转载 2019-08-24 23:02:00
85阅读
“..” Means go up a level, so delete the prev “.” Means do nothing “” Means do nothing First, we need to split the input by the splitter “/” 这种方式Arrays
转载 2018-07-18 13:07:00
72阅读
2评论
  • 1
  • 2
  • 3
  • 4
  • 5