# 剑指-Offer-Leetcode **Repository Path**: sungq5/finger-off-level-code ## Basic Information - **Project Name**: 剑指-Offer-Leetcode - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-04-26 - **Last Updated**: 2025-04-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # jianzhi-Offer-Leetcode 《剑指Offer》与Leetcode主站题目链接对应 * update:中文版leetcode已发布剑指offer授权的刷题合集:https://leetcode-cn.com/problemset/lcof/ ## 本帖记录剑指offer在leetcode主站的原题。 1. 无 2. 无 3. 数组中重复的数字 -> (中文版) https://leetcode-cn.com/problems/shu-zu-zhong-zhong-fu-de-shu-zi-lcof/ 4. 二维数组中的查找 -> https://leetcode.com/problems/search-a-2d-matrix-ii/ 5. 替换空格 -> (中文版) https://leetcode-cn.com/problems/ti-huan-kong-ge-lcof/ 6. 从尾到头打印链表 -> (中文版) https://leetcode-cn.com/problems/cong-wei-dao-tou-da-yin-lian-biao-lcof/ 7. 重建二叉树 -> https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/ 8. 暂无 9. 用两个栈实现队列 -> https://leetcode.com/problems/implement-queue-using-stacks/ 10. 斐波那契数列/青蛙跳台阶 -> https://leetcode.com/problems/fibonacci-number/ 11. 旋转数组的最小数字 -> https://leetcode.com/problems/find-minimum-in-rotated-sorted-array-ii/ 12. √矩阵中的路径 -> https://leetcode.com/problems/word-search/ 13. 机器人的运动范围 -> 没找到 -> (中文版)https://leetcode-cn.com/problems/ji-qi-ren-de-yun-dong-fan-wei-lcof/ 14. 剪绳子(dp) -> https://leetcode-cn.com/problems/integer-break/) 15. √二进制中1的个数 -> https://leetcode.com/problems/number-of-1-bits/ ->(升级版)https://leetcode.com/problems/counting-bits/ 16. √数值的整数次方(溢出) -> https://leetcode.com/problems/powx-n/ 17. 打印从1到最大的n位数(溢出) -> 没找到 18. √删除链表的节点 ->(简单版)https://leetcode.com/problems/delete-node-in-a-linked-list/ ->(升级版)https://leetcode.com/problems/remove-linked-list-elements 19. ×正则表达式匹配 -> https://leetcode.com/problems/regular-expression-matching/ 20. ×表示数值的字符串 -> https://leetcode.com/problems/valid-number/ 21. √调整数组顺序使奇数在偶数前 -> https://leetcode.com/problems/sort-array-by-parity 22. √链表中倒数第K个节点 -> https://leetcode.com/problems/remove-nth-node-from-end-of-list/ 23. √链表中环的入口节点 -> https://leetcode.com/problems/linked-list-cycle-ii 24. √反转链表 -> 只用了递归,下次用循环 https://leetcode.com/problems/reverse-linked-list/ 25. √合并两个排序的链表 -> https://leetcode.com/problems/merge-two-sorted-lists/ 26. √树的子结构 -> * https://leetcode.com/problems/subtree-of-another-tree/ 27. √二叉树的镜像 -> https://leetcode.com/problems/invert-binary-tree 28. √对称的二叉树 -> https://leetcode.com/problems/symmetric-tree/ 29. √顺时针打印矩阵 -> https://leetcode.com/problems/spiral-matrix/ 30. √包含min函数的栈 -> https://leetcode.com/problems/min-stack/ 31. √栈的压入、弹出序列 ->* https://leetcode.com/problems/validate-stack-sequences/ 32. √从上到下打印二叉树 -> https://leetcode.com/problems/binary-tree-level-order-traversal/ -> 从下到上 https://leetcode.com/problems/binary-tree-level-order-traversal-ii/ -> 之字形打印 https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal/ 33. 二叉搜索树的后序遍历序列 -> (收费)https://leetcode.com/problems/verify-preorder-sequence-in-binary-search-tree/ -> (先序遍历)https://leetcode.com/problems/verify-preorder-serialization-of-a-binary-tree/ 34. √二叉树中和为某一值得路径 -> https://leetcode.com/problems/path-sum/ 35. √复杂链表的复制 -> https://leetcode.com/problems/copy-list-with-random-pointer/ 36. √二叉搜索树与双向链表 -> *(收费)https://leetcode.com/problems/convert-binary-search-tree-to-sorted-doubly-linked-list/ -> (牛客网)https://www.nowcoder.com/practice/947f6eb80d944a84850b0538bf0ec3a5?tpId=13&tqId=11179&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking 37. √序列化二叉树 -> https://leetcode.com/problems/serialize-and-deserialize-binary-tree/ 38. √字符串的排列 -> (原理相同,leetcode用的数组)https://leetcode.com/problems/permutations/ ->(有重复元素的情况) https://leetcode.com/problems/permutations-ii 39. √数组中出现次数超过一半的数字 -> https://leetcode.com/problems/majority-element/ -> (升级版) https://leetcode.com/problems/majority-element-ii/ 40. √最小的k个数 -> *(类似)https://leetcode.com/problems/kth-largest-element-in-an-array/ 41. √数据流中的中位数 -> * https://leetcode.com/problems/find-median-from-data-stream/ 42. √连续子数组的最大和 -> https://leetcode.com/problems/maximum-subarray/ 43. √1~n整数中1出现的次数 -> https://leetcode.com/problems/number-of-digit-one/submissions/ 44. √数字序列中某一位的数字 -> https://leetcode.com/problems/nth-digit/ 45. √把数组排成最小的数 -> https://leetcode.com/problems/largest-number/ 46. √把数字翻译成字符串 -> (递归or动归) https://leetcode.com/problems/decode-ways/ 47. 礼物最大值 -> 未找到 -> (中文版) https://leetcode-cn.com/problems/li-wu-de-zui-da-jie-zhi-lcof/ 48. √最长不含重复字符的子字符串 -> https://leetcode.com/problems/longest-substring-without-repeating-characters/ 49. √丑数 -> (有更好的解法)https://leetcode.com/problems/ugly-number-ii/ 50. √第一个只出现一次的字符 -> https://leetcode.com/problems/first-unique-character-in-a-string/ 51. 数组中的逆序对 -> (升级版)https://leetcode.com/problems/reverse-pairs/#/description 52. √两个链表的第一个公共节点 -> https://leetcode.com/problems/intersection-of-two-linked-lists/ 53. √在排序数组中查找数字 -> https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/submissions/ 54. 二叉搜索树的第K大节点 -> https://leetcode.com/problems/kth-smallest-element-in-a-bst/description/ 55. 二叉树的深度 -> https://leetcode.com/problems/maximum-depth-of-binary-tree/ 56. 数组中数字出现的次数 -> https://leetcode.com/problems/single-number-iii/ 57. 和为S的数字 —> https://leetcode.com/problems/two-sum/ 58. 翻转字符串 -> https://leetcode.com/problems/reverse-words-in-a-string/ 59. 队列的最大值 -> https://leetcode.com/problems/sliding-window-maximum/ 60. n个骰子的点数 -> (中文版)https://leetcode-cn.com/problems/nge-tou-zi-de-dian-shu-lcof/ 61. 扑克牌中的顺子 -> (中文版)https://leetcode-cn.com/problems/bu-ke-pai-zhong-de-shun-zi-lcof/ 62. 圆圈中最后剩下的数字 -> (中文版) https://leetcode-cn.com/problems/yuan-quan-zhong-zui-hou-sheng-xia-de-shu-zi-lcof/ 63. 股票的最大利润 -> https://leetcode.com/problems/best-time-to-buy-and-sell-stock/ 64. 求1+2+…+n -> (中文版) https://leetcode-cn.com/problems/qiu-12n-lcof/ 65. 不用加减乘除做加法 -> (中文版) https://leetcode-cn.com/problems/bu-yong-jia-jian-cheng-chu-zuo-jia-fa-lcof/ 66. 构建乘积数组 -> (中文版) https://leetcode-cn.com/problems/gou-jian-cheng-ji-shu-zu-lcof/ 67. 把字符串转换成整数 -> https://leetcode.com/problems/string-to-integer-atoi/ 68. 二叉搜索树的最近公共祖先 -> https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/