摘要:
71. Simplify Path 题目 解析 这道题的要求是简化一个Unix风格下的文件的绝对路径。 字符串处理,由于".."是返回上级目录(如果是根目录则不处理),因此可以考虑用栈记录路径名,以便于处理。需要注意几个细节: 重复连续出现的'/',只按1个处理,即跳过重复连续出现的'/'; 如果路 阅读全文
摘要:
70. Climbing Stairs 题目 解析 C++ // add 70. Climbing Stairs class Solution_70 { public: int climbStairs(int n) { int ret = 0; int f1 = 1, f2 = 2; if (n = 阅读全文