摘要:
链接:https://leetcode-cn.com/problems/simplify-path/ 代码 class Solution { public: string simplifyPath(string path) { string ans, name; if (path.back() != 阅读全文
摘要:
链接:https://leetcode-cn.com/problems/climbing-stairs/ 代码 class Solution { public: int climbStairs(int n) { vector<int> f(n + 1); f[0] = 1, f[1] = 1; fo 阅读全文
摘要:
链接:https://leetcode-cn.com/problems/sqrtx/ 代码 class Solution { public: int mySqrt(int x) { int l = 0, r = x; while (l < r) { int mid = (l + 1ll + r) / 阅读全文
摘要:
链接:https://leetcode-cn.com/problems/text-justification/ 代码 class Solution { public: vector<string> fullJustify(vector<string>& words, int maxWidth) { 阅读全文
摘要:
链接:https://leetcode-cn.com/problems/add-binary/ 代码 class Solution { public: string addBinary(string a, string b) { if (a.size() < b.size()) swap(a, b) 阅读全文