01 2022 档案
摘要:本博客记录的是 LeetCode 71 到 90 题的题解 之前很少使用的语法 # 71. Simplify Path class Solution: def simplifyPath(self, path: str) -> str: new_dir = [] for name in path.sp
阅读全文
摘要:本博客记录的是 LeetCode 51 到 70 题的题解 之前很少使用的语法 string(n, '.') INT_MIN, INT_MAX // 58. Length of Last Word stringstream ssin(s); string word; int res; while (
阅读全文
摘要:本博客记录的是 LeetCode 41 到 50 题的题解 之前很少使用的语法 # 这样写是错误的,这个 bug 太可恶了!! nums[i], nums[nums[i] - 1] = nums[nums[i] - 1], nums[i] d = set() d.add(1) if x not in
阅读全文
摘要:本博客记录的是 LeetCode 31 到 40 题的题解 之前很少使用的语法 reverse(nums.begin() + k, nums.end()); stk.top(); stk.size(); stk.pop(); t += to_string(k - j) + s[j]; // 注意 +
阅读全文