摘要:
链接:https://leetcode-cn.com/problems/two-sum/ 思路 使用HashMap存储数据从而节省第二层循环寻找数字的时间 代码 class Solution { public int[] twoSum(int[] nums, int target) { Map<In 阅读全文
摘要:
1446. 连续字符 链接:https://leetcode-cn.com/problems/consecutive-characters/ 代码 class Solution { public: int maxPower(string s) { int tmp = 1, ans = 1; for 阅读全文
摘要:
链接:https://leetcode cn.com/problems/maximum depth of binary tree/ 递归 阅读全文
摘要:
链接:https://leetcode cn.com/problems/binary tree zigzag level order traversal/ 阅读全文
摘要:
链接:https://leetcode cn.com/problems/binary tree level order traversal/ 阅读全文
摘要:
链接:https://leetcode cn.com/problems/symmetric tree/ 阅读全文
摘要:
链接:https://leetcode cn.com/problems/same tree/ 阅读全文
摘要:
链接:https://leetcode-cn.com/problems/validate-binary-search-tree/ 算法:中序遍历 /** * Definition for a binary tree node. * public class TreeNode { * int val; 阅读全文
摘要:
831. KMP字符串 链接:https://www.acwing.com/problem/content/833/ $next[i] = j$ 代表 $p[i, j] = p[i j + 1, j]$ 阅读全文
摘要:
785. 快速排序 链接:https://www.acwing.com/problem/content/787/ 795. 前缀和 https://www.acwing.com/problem/content/797/ 阅读全文