随笔分类 - LeetCode刷题总结
摘要:题号为LeetCode剑指Offer题库中的题号。网址:https://leetcode-cn.com/problem-list/xb9nqhhg/ 1~n 整数中 1 出现的次数 43 限制:1 <= n < 2^31 数字范围较大,暴力会超时 class Solution { public in
阅读全文
摘要:题号为LeetCode剑指Offer题库中的题号。网址:https://leetcode-cn.com/problem-list/xb9nqhhg/ 从上到下打印二叉树 32-III class Solution { public List<List<Integer>> levelOrder(Tre
阅读全文
摘要:题号为LeetCode剑指Offer题库中的题号。网址:https://leetcode-cn.com/problem-list/xb9nqhhg/ 合并两个排序链表25 本题思路非常简单,两个链表元素依次比较,压入新链表即可,但有易错点。 public ListNode mergeTwoLists
阅读全文
摘要:LeetCode过程中值得反思的细节(二) 本周10道题,此栏目将每周定期更新。题号为LeetCode剑指Offer题库中的题号。 剪绳子14 这道题需要思考剪绳子的过程 public int cuttingRope(int n) { if(n<=3) return n-1; if(n%3==0)r
阅读全文
摘要:LeetCode过程中值得反思的细节 以下题号均指LeetCode剑指offer题库中的题号 本文章将每周定期更新,当内容达到10题左右时将会开下一节。 二维数组越界问题04 public static void main(String[] args) { int[][]x = {{}}; Syst
阅读全文