Skip to content

Fanlu91/FanluLeetcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FanluLeetcode

Leetcode 解题记录。根据题目的场景/标签归档,并以此位单位归纳总结。

  • 题号:四位数字方便搜索定位。
  • 总结:当前标签/主题相关的理论知识及解题套路和心得总结
  • 地址:包括leetcode.com 和 leetcode-cn.com
  • 难度:作者对题目难度的定义,会在官方给定难度等级之上通过+,-进行标记
  • 代码:Java解法的代码,一般会包含最符合题意的解及效率最高解。并给出每种解的提交数据反馈。
  • 结果:最优解的提交反馈数据
  • 标签:相关标签,一般是最优或者最直观解法使用的算法思想

目前正在探索使用Obisidian整理题解,逐渐提供比代码本身更有信息量的内容。

Helper

README 文件通过此类生成。

Array

总结调整中,草稿内容请参考这里

题号 题目(官网) 题目(中国) 难度 代码 结果 标签
0001 two-sum two-sum Easy java 99.23% 99.75% Array
0056 merge-intervals merge-intervals Medium java 92.20% 55.70% Array
0066 plus-one plus-one Easy java 100.00% 5.10% Array
0118 pascals-triangle pascals-triangle Easy java 77.33% 9.09% Array
0119 pascals-triangle-ii pascals-triangle-ii Easy java 86.51% 5.88% Array
0169 majority-element majority-element Easy java 100.00% 50.94% Array
0189 rotate-array rotate-array easy java 100% 100%% Array
0217 contains-duplicate contains-duplicate Easy java 99.06% 65.20% Array
0228 summary-ranges summary-ranges Easy java 8.88% 26.69% Array
0283 move-zeroes move-zeroes Easy java 100.00% 94.20% Array
0349 intersection-of-two-arrays intersection-of-two-arrays Easy java 100% 50% Array
0448 find-all-numbers-disappeared-in-an-array find-all-numbers-disappeared-in-an-array Easy java 99.93% 61.97% Array
0485 max-consecutive-ones max-consecutive-ones Easy- java 99.83% 99.97% Array
0509 fibonacci-number fibonacci-number Easy- java 100.00% 50.46% Array
0561 array-partition-i array-partition-i Easy java 100.00% 97.20% Array
0697 degree-of-an-array degree-of-an-array Easy java 100.00% 54.88% Array
0849 maximize-distance-to-closest-person maximize-distance-to-closest-person Easy java 100.00% 91.67% Array
0888 fair-candy-swap fair-candy-swap Easy java 100.00% 98.74% Array
0896 monotonic-array monotonic-array Easy- java 100.00% 96.10% Array
0905 sort-array-by-parity sort-array-by-parity Easy java 100.00% 96.91% Array
0922 sort-array-by-parity-ii sort-array-by-parity-ii Easy java 99.72% 99.43% Array
0945 minimum-increment-to-make-array-unique minimum-increment-to-make-array-unique Easy java 97.81% 86.27% Array
0977 squares-of-a-sorted-array squares-of-a-sorted-array Easy java 100.00% 96.27% Array
0985 sum-of-even-numbers-after-queries sum-of-even-numbers-after-queries Easy java 99.93% 86.35% Array
1002 find-common-characters find-common-characters Easy java 100.00% 98.16% Array
1013 partition-array-into-three-parts-with-equal-sum partition-array-into-three-parts-with-equal-sum Easy java 100.00% 90.69% Array
1051 height-checker height-checker Easy java 96.41% 100.00% Array
1103 distribute-candies-to-people distribute-candies-to-people medium java 8.10% 5.27% Array

Dynamic Programming

总结调整中,草稿内容请参考这里

题号 题目(官网) 题目(中国) 难度 代码 结果 标签
0064 minimum-path-sum minimum-path-sum Medium java 88.89% 26.71% Dynamic Programming
0070 climbing-stairs climbing-stairs Easy java 100.00% 5.26% Dynamic Programming
0121 best-time-to-buy-and-sell-stock best-time-to-buy-and-sell-stock Easy java 100.00% 100.00% Dynamic Programming
0122 best-time-to-buy-and-sell-stock-ii best-time-to-buy-and-sell-stock-ii Easy- java 100.00% 100.00% Dynamic Programming
0123 best-time-to-buy-and-sell-stock-iii best-time-to-buy-and-sell-stock-iii Hard java 99.75% 100.00% Dynamic Programming
0188 best-time-to-buy-and-sell-stock-iv best-time-to-buy-and-sell-stock-iv Hard java 100.00% 100.00% Dynamic Programming
0198 house-robber house-robber Easy java 100.00% 100.00% Dynamic Programming
0213 house-robber-ii house-robber-ii Medium java 100.00% 100.00% Dynamic Programming
0256 paint-house paint-house Easy java 98.79% 100.00% Dynamic Programming
0265 paint-house-ii paint-house-ii Hard- java 99.53% 100.00% Dynamic Programming
0276 paint-fence paint-fence Easy java 100% 100% Dynamic Programming
0292 nim-game nim-game Easy java 100.00% 100.00% Minimax
0303 range-sum-query-immutable range-sum-query-immutable Easy java 95.71% 56.10% Dynamic Programming
0309 best-time-to-buy-and-sell-stock-with-cooldown best-time-to-buy-and-sell-stock-with-cooldown Medium java 100.00% 100.00% Dynamic Programming
0322 coin-change coin-change Medium java 99.99% 100% Dynamic Programming
0337 house-robber-iii house-robber-iii Medium java 100.00% 100.00% Dynamic Programming
0338 counting-bits counting-bits Medium java 100.00% 5.88% Dynamic Programming
0375 guess-number-higher-or-lower-ii guess-number-higher-or-lower-ii Medium java 99.47% 5.41% Minimax
0486 predict-the-winner predict-the-winner Medium java 100.00% 5.45% Minimax
0518 coin-change-2 coin-change-2 Medium java 100.00% 8.33% Dynamic Programming
0714 best-time-to-buy-and-sell-stock-with-transaction-fee best-time-to-buy-and-sell-stock-with-transaction-fee Medium java 80.67% 100.00% Dynamic Programming
0746 min-cost-climbing-stairs min-cost-climbing-stairs Easy java 99.86% 100.00% Dynamic Programming
0877 stone-game stone-game Medium java 100.00% 100.00% Minimax
0931 minimum-falling-path-sum minimum-falling-path-sum Medium java 89.09% 86.67% Dynamic Programming
1025 divisor-game divisor-game Easy java 100.00% 13.33% Dynamic Programming
1140 stone-game-ii stone-game-ii Medium java 100.00% 100.00% Minimax
1449 form-largest-integer-with-digits-that-add-up-to-target form-largest-integer-with-digits-that-add-up-to-target Hard java 100.00% 100.00% Dynamic Programming

Binary Tree

总结调整中,草稿内容请参考这里

题号 题目(官网) 题目(中国) 难度 代码 结果 标签
0100 same-tree same-tree Easy java 100.00% 0ms 5.33% Binary Tree
0101 symmetric-tree symmetric-tree Easy java 100.00% 26.66% Binary Tree
0104 maximum-depth-of-binary-tree maximum-depth-of-binary-tree Easy java 100.00% 25.42% Binary Tree
0105 construct-binary-tree-from-preorder-and-inorder-traversal construct-binary-tree-from-preorder-and-inorder-traversal Medium java 77.57% 70.00% Binary Tree
0106 construct-binary-tree-from-inorder-and-postorder-traversal construct-binary-tree-from-inorder-and-postorder-traversal Medium java 74.17% 61.90% Binary Tree
0110 balanced-binary-tree balanced-binary-tree Easy java 99.69% 1ms 23.53% Binary Tree
0116 populating-next-right-pointers-in-each-node populating-next-right-pointers-in-each-node Medium java 100% 100% Binary Tree
0117 populating-next-right-pointers-in-each-node-ii populating-next-right-pointers-in-each-node-ii Medium java 45.96% 50.00% Binary Tree
0226 invert-binary-tree invert-binary-tree Easy- java 100.00% 48.73% Binary Tree
0236 lowest-common-ancestor-of-a-binary-tree lowest-common-ancestor-of-a-binary-tree null java 100.00% 44.21% Binary Tree
0236 lowest-common-ancestor-of-a-binary-tree lowest-common-ancestor-of-a-binary-tree null java 100% 19.83% Binary Tree
0297 serialize-and-deserialize-binary-tree serialize-and-deserialize-binary-tree Hard java 26.24% 33.57% Binary Tree
0404 sum-of-left-leaves sum-of-left-leaves Easy java 100.00% 88.90% Binary Tree
0543 diameter-of-binary-tree diameter-of-binary-tree Easy+ java 100.00% 23.72% tree.binarytree
0563 binary-tree-tilt binary-tree-tilt Easy java 100.00% 31.25% tree.binarytree
0617 merge-two-binary-trees merge-two-binary-trees Easy java 100.00% 17.28% Binary Tree
0671 second-minimum-node-in-a-binary-tree second-minimum-node-in-a-binary-tree null java 100.00% 93.19% Binary Tree

Linked List

总结调整中,草稿内容请参考这里

题号 题目(官网) 题目(中国) 难度 代码 结果 标签
Offer22 lian-biao-zhong-dao-shu-di-kge-jie-dian-lcof lian-biao-zhong-dao-shu-di-kge-jie-dian-lcof Easy java 100.00% 85.78% Double Pointers
0002 add-two-numbers add-two-numbers Medium java 94.51% 90.73% Linked list
0024 swap-nodes-in-pairs swap-nodes-in-pairs Medium- java 100% 55.56% Linked List
0025 reverse-nodes-in-k-group reverse-nodes-in-k-group Hard java 100.00% 37.77% Linked List
0083 remove-duplicates-from-sorted-list remove-duplicates-from-sorted-list null java 100.00% 99.97% Linked list
0092 reverse-linked-list-ii reverse-linked-list-ii Medium java 100.00% 100.00% Linked list
0109 convert-sorted-list-to-binary-search-tree convert-sorted-list-to-binary-search-tree null java 97.35% 100.00% Linked list , Binary Tree
0142 linked-list-cycle-ii linked-list-cycle-ii null java 96.51% 99.89% Linked list
0160 intersection-of-two-linked-lists intersection-of-two-linked-lists Easy java 100.00% 22.65% Linked list
0203 remove-linked-list-elements remove-linked-list-elements Easy- java 99.37% 99.72% Linked list
0206 reverse-linked-list reverse-linked-list Easy java 100.00% 99.87% Double Pointers, Recursive
0237 delete-node-in-a-linked-list delete-node-in-a-linked-list Easy- java 100% 100% Linked list
0328 odd-even-linked-list odd-even-linked-list Medium- java 100.00% 8.12% Linked List
0445 add-two-numbers-ii add-two-numbers-ii Medium java 99.96% 74.91% Linked list
0707 design-linked-list design-linked-list null java 80.06% 88.98% Linked list
0725 split-linked-list-in-parts split-linked-list-in-parts null java 100.00% 100.00% Linked list
0876 middle-of-the-linked-list middle-of-the-linked-list null java 100.00% 100.00% Linked list

Permutation & Combination

总结调整中,草稿内容请参考这里

题号 题目(官网) 题目(中国) 难度 代码 结果 标签
0031 next-permutation next-permutation Medium java 100% 66% Greedy
0039 combination-sum combination-sum Medium java 77.47% 86.63% combination
0040 combination-sum-ii combination-sum-ii Medium java 40.55% 53.43% combination
0046 permutations permutations Medium java 96.75% 5.14% Backtracking
0047 permutations-ii permutations-ii Medium java 100.00% 17.50% Backtracking
0077 combinations combinations Medium java 93.17% 74.09% Backtracking
0078 subsets subsets Medium java 82.14% 5.24% combination
0090 subsets-ii subsets-ii Medium java 100.00% 24.48% combination
lcof38 zi-fu-chuan-de-pai-lie-lcof zi-fu-chuan-de-pai-lie-lcof Medium java 99.28% 49.61% Backtracking
0060 permutation-sequence permutation-sequence Hard java 57.64% 43.94% Math
0216 combination-sum-iii combination-sum-iii Medium java 46.43% 42.73% Backtracking
0377 combination-sum-iv combination-sum-iv Medium- java 99.56% 51.40% DP
0567 permutation-in-string permutation-in-string Medium java 58.10% 18.75% Sliding Window
0784 letter-case-permutation letter-case-permutation Easy java 100.00% 99.36% Backtracking

Binary Search

总结调整中,草稿内容请参考这里

题号 题目(官网) 题目(中国) 难度 代码 结果 标签
0004 median-of-two-sorted-array median-of-two-sorted-array Hard java 92.12% 84.77% Binary Search
0035 search-insert-position search-insert-position Easy java 100.00% 5.03% Binary Search
0050 powx-n powx-n Medium java 82.1 100% Binary Search
0069 sqrtx sqrtx Easy java 100.00% 5.04% Binary Search
0153 find-minimum-in-rotated-sorted-array find-minimum-in-rotated-sorted-array medium java 100.00% 29.57% Binary Search
0154 find-minimum-in-rotated-sorted-array-ii find-minimum-in-rotated-sorted-array-ii Hard java 100.00% 29.57% Binary Search
0167 two-sum-ii-input-array-is-sorted two-sum-ii-input-array-is-sorted Easy java 100.00% 63.39% Binary Search
0222 count-complete-tree-nodes count-complete-tree-nodes Medium java 100.00% 53.27% Binary Search
0300 longest-increasing-subsequence longest-increasing-subsequence Medium java 94.63% 5.63% Binary Search ,Dynamic Programming
0374 guess-number-higher-or-lower guess-number-higher-or-lower Easy java 100.00% 5.21% Binary Search
0441 arranging-coins arranging-coins null java 82.04% 100% Binary Search
0704 binary-search binary-search Easy java 100.00% 5.09% Binary Search
0852 peak-index-in-a-mountain-array peak-index-in-a-mountain-array Easy java 100.00% 5.16% Binary Search
0875 koko-eating-bananas koko-eating-bananas medium java 67.13% 5.14% Binary Search

Stack

总结调整中,草稿内容请参考这里

题号 题目(官网) 题目(中国) 难度 代码 结果 标签
0020 valid-parentheses valid-parentheses Easy java 98.69% 99.98% Stack
0032 longest-valid-parentheses longest-valid-parentheses Hard java 98.69% 99.98% Stack
0155 min-stack min-stack Medium java 78.13% 14.46% Design
0225 implement-stack-using-queues implement-stack-using-queues Easy java 100% 100% Stack, Queue
0394 decode-string decode-string Medium java 100.00% 100.00% Stack,String
0772 basic-calculator-iii basic-calculator-iii Hard java 46.17% 20.92% Stack
mst03.01 three-in-one-lcci three-in-one-lcci Easy java 91.52% 5.64% Stack
mst03.05 sort-of-stacks-lcci sort-of-stacks-lcci Medium- java 99.82% 10.49% Stack
1047 remove-all-adjacent-duplicates-in-string remove-all-adjacent-duplicates-in-string Easy java 100.00% 16.48% Stack
946,Offer31 zhan-de-ya-ru-dan-chu-xu-lie-lcof zhan-de-ya-ru-dan-chu-xu-lie-lcof Medium java 96.92% 10.81% Stack
227,mst16.26 basic-calculator-ii basic-calculator-ii Medium java 100% 23% Stack
0224 basic-calculator basic-calculator Hard java 43.08% 17.47% Stack
0739 daily-temperatures daily-temperatures Medium java 91.69% 5.03% Stack

Math

总结调整中,草稿内容请参考这里

题号 题目(官网) 题目(中国) 难度 代码 结果 标签
mst16.11 diving-board-lcci diving-board-lcci Easy java 100% 100% Math
Offer62 yuan-quan-zhong-zui-hou-sheng-xia-de-shu-zi-lcof yuan-quan-zhong-zui-hou-sheng-xia-de-shu-zi-lcof Easy java 99.98% 100.00% Math
0007 reverse-integer reverse-integer Easy java 100.00% 11.11% Math
0029 divide-two-integers divide-two-integers Medium java 88% 49% Math
0168 excel-sheet-column-title excel-sheet-column-title Easy java 100.00% 14.29% Math
0171 excel-sheet-column-number excel-sheet-column-number Easy - java 100.00% 5.55% Math
0172 factorial-trailing-zeroes factorial-trailing-zeroes Easy java 100.00% 100.00% Math
0202 happy-number happy-number Easy java 47.92% 8.33% Math
0204 count-primes count-primes Easy+ java 80% 80% Math
0223 rectangle-area rectangle-area Medium java 98.16% 25.00% Math
0365 water-and-jug-problem water-and-jug-problem Medium + java 100.00% 13.93% Math, BFS
0492 construct-the-rectangle construct-the-rectangle Easy java 100.00% 14.29% Math
0836 rectangle-overlap rectangle-overlap Easy java 100.00% 50.00% Math
1071 greatest-common-divisor-of-strings greatest-common-divisor-of-strings Easy java 97.81% 100.00% Greatest Common Divisor

Matrix

总结调整中,草稿内容请参考这里

题号 题目(官网) 题目(中国) 难度 代码 结果 标签
mst01.08 zero-matrix-lcci zero-matrix-lcci Medium- java 50% 50% Matrix
0054 spiral-matrix spiral-matrix Medium java 100.00% 99.54% Matrix
0200 number-of-islands number-of-islands Medium java 91.40% 15.30% dfs
0240 search-a-2d-matrix-ii search-a-2d-matrix-ii Medium java 97.85% 17.32% Matrix
0289 game-of-life game-of-life Medium java 100.00% 91.85% Matrix
0695 max-area-of-island max-area-of-island Medium java 82.11% 91.14% Matrix, Back tracking
0766 toeplitz-matrix toeplitz-matrix Easy java 100.00% 73.60% Matrix
0832 flipping-an-image flipping-an-image null java 100.00% 99.95% Matrix
0867 transpose-matri transpose-matri Easy- java 100.00% 99.81% Matrix
0985 reshape-the-matrix reshape-the-matrix Easy- java 100.00% 100.00% Matrix
0999 available-captures-for-rook available-captures-for-rook Easy java 100.00% 99.95% Matrix

Two Pointers

总结调整中,草稿内容请参考这里

题号 题目(官网) 题目(中国) 难度 代码 结果 标签
0003 longest-substring-without-repeating-characters longest-substring-without-repeating-characters Medium java 99.83% 80.19% Sliding Window
0011 container-with-most-water container-with-most-water medium- java 71.02% 7.14% Two Pointers
0015 3sum 3sum Medium java 98.79% 91.35% Two Pointers
0016 3sum-closest 3sum-closest Medium java 85.38% 17.73% Two Pointers
0018 4sum 4sum medium java 88.88% 68.14% Two Pointers
0019 remove-nth-node-from-end-of-list remove-nth-node-from-end-of-list Medium- java 100.00% 94.24% Two Pointers
0026 remove-duplicates-from-sorted-array remove-duplicates-from-sorted-array Easy java 100% 99.47% Array
0027 remove-element remove-element Easy java 100.00% 100.00% Array
0042 trapping-rain-water trapping-rain-water Hard java 99.95% 19.88% two pointers
0076 minimum-window-substring minimum-window-substring Hard java 42.34% 13.33% Sliding Window
0088 merge-sorted-array merge-sorted-array Easy- java 100.00% 73.09% Two Pointers
0141 linked-list-cycle linked-list-cycle Easy java 100.00% 99.88% Two Pointers
0142 linked-list-cycle-ii linked-list-cycle-ii Medium java 100.00% 5.04% Two Pointers
0239 sliding-window-maximum sliding-window-maximum Hard java 39.53% 6.67% Sliding Window
0424 longest-repeating-character-replacement longest-repeating-character-replacement Medium java 33.67% 100.00% Sliding Window

Binary Search Tree

总结调整中,草稿内容请参考这里

题号 题目(官网) 题目(中国) 难度 代码 结果 标签
0095 unique-binary-search-trees-ii unique-binary-search-trees-ii Medium java 100.00% 99.41% Binary Search Tree;Dynamic Programming
0096 unique-binary-search-trees unique-binary-search-trees Medium java 100.00% 99.41% Binary Search Tree;Dynamic Programming
0098 validate-binary-search-tree validate-binary-search-tree Medium java 100.00% 5.80% Binary Search Tree
0108 convert-sorted-array-to-binary-search-tree convert-sorted-array-to-binary-search-tree Easy java 100.00% 5.06% Binary Search Tree
0173 binary-search-tree-iterator binary-search-tree-iterator Medium java 72.82% 100% Binary Search Tree,Stack
0235 lowest-common-ancestor-of-a-binary-search-tree lowest-common-ancestor-of-a-binary-search-tree Easy java 99.85% 6.06% Binary Search Tree
0450 delete-node-in-a-bst delete-node-in-a-bst Medium+ java 100.00% 20.00% Binary Search Tree
0530 minimum-distance-between-bst-nodes minimum-distance-between-bst-nodes null java 100.00% 52.53% Binary Search Tree
0538 convert-bst-to-greater-tree convert-bst-to-greater-tree Easy java 98.33% 62.29% Binary Search Tree
0700 search-in-a-binary-search-tree search-in-a-binary-search-tree Easy- java 100.00% 9.09% Binary Search Tree

Hashtable

总结调整中,草稿内容请参考这里

题号 题目(官网) 题目(中国) 难度 代码 结果 标签
0219 contains-duplicate-ii contains-duplicate-ii Easy- java 95.81% 5.72% Hashtable
0242 valid-anagram valid-anagram null java 90.46% 71.14% Hashtable
0389 find-the-difference find-the-difference Easy java 99.37% 19.48% Hashtable
0409 longest-palindrome longest-palindrome Easy java 100.00% 100% Hashtable
0454 4sum-ii 4sum-ii medium java 99.35% 53.32% Two Pointers
0594 longest-harmonious-subsequence longest-harmonious-subsequence Easy+ java 100.00% 13.99% Hashtable
0692 top-k-frequent-words top-k-frequent-words null java 99.50% 89.29% Hashtable
1160 find-words-that-can-be-formed-by-characters find-words-that-can-be-formed-by-characters Easy java 84.18% 5.08% Hashtable

String

总结调整中,草稿内容请参考这里

题号 题目(官网) 题目(中国) 难度 代码 结果 标签
0008 string-to-integer-atoi string-to-integer-atoi Medium java 99.87% 93.46% String
0014 longest-common-prefix longest-common-prefix Easy- java 74.35% 100% String
0038 count-and-say count-and-say Easy java 100 % 100 % String
0058 length-of-last-word length-of-last-word Easy java 100.00% 5.32% String
0067 add-binary add-binary Easy java 97.15% 5.12% String
0205 isomorphic-strings isomorphic-strings Easy- java 81.95% 34.68% String
0344 reverse-string reverse-string Easy- java 100.00% 18.74% String
0415 add-strings add-strings Easy java 99.62% 26.75% Math
0541 reverse-string-ii reverse-string-ii Easy java 100.00% 25.50% String

Palindromic

总结调整中,草稿内容请参考这里

题号 题目(官网) 题目(中国) 难度 代码 结果 标签
0005 longest-palindromic-substring longest-palindromic-substring Medium java 87.40% 69.11% String
0009 palindrome-number palindrome-number Easy java 100.00% 5.02% Math
0125 valid-palindrome valid-palindrome Easy java 100% 100% String
0234 palindrome-linked-list palindrome-linked-list Easy+ java 99.87% 7.54% findpattern.palindromic
0516 longest-palindromic-subsequence longest-palindromic-subsequence Medium java 100% 100% Dynamic Programming
0647 palindromic-substrings palindromic-substrings Medium java 99.97% 100.00% Dynamic Programming
0680 valid-palindrome-ii valid-palindrome-ii Easy java 99.68% 94.44% String

Breadth-first Search

总结调整中,草稿内容请参考这里

题号 题目(官网) 题目(中国) 难度 代码 结果 标签
0102 binary-tree-level-order-traversal binary-tree-level-order-traversal Medium java 99.79% 5.13% Breadth First Search
0103 binary-tree-zigzag-level-order-traversal binary-tree-zigzag-level-order-traversal Medium- java 98.10% 34.57% Breadth First Search
0107 binary-tree-level-order-traversal-ii binary-tree-level-order-traversal-ii Easy java 99.79% 5.13% Breadth First Search
0111 minimum-depth-of-binary-tree minimum-depth-of-binary-tree Easy java 100.00% 5.33% Breadth First Search
0199 binary-tree-right-side-view binary-tree-right-side-view Medium- java 95.83% 16.21% Breadth First Search
0637 average-of-levels-in-binary-tree average-of-levels-in-binary-tree null java 99.18% 24.76% Breadth First Search
0752 open-the-lock open-the-lock Medium java 100% 83.33% Breadth First Search

Bit Manipulation

总结调整中,草稿内容请参考这里

题号 题目(官网) 题目(中国) 难度 代码 结果 标签
0136 single-number single-number Easy java 100% 100% Bit Manipulation
0137 single-number-ii single-number-ii Medium java 100% 100% Bit Manipulation
0190 reverse-bits reverse-bits Easy java 100.00% 92.12% Bit Manipulation
0191 number-of-1-bits number-of-1-bits Easy java 100% 100% Bit Manipulation
0260 single-number-iii single-number-iii Medium java 100% 16.67% Bit Manipulation
0371 sum-of-two-integers sum-of-two-integers Easy java 100% 8.00% Bit Manipulation
0397 integer-replacement integer-replacement Medium java 100% 8.00% Bit Manipulation

Backtracking

总结调整中,草稿内容请参考这里

题号 题目(官网) 题目(中国) 难度 代码 结果 标签
0017 letter-combinations-of-a-phone-number letter-combinations-of-a-phone-number Medium java 100.00% 84.17% Backtracking
0037 sudoku-solver sudoku-solver Hard java 97.00% 94.25% Backtracking
0051 n-queens n-queens Hard- java 100% 100% Backtracking
0079 word-search word-search Medium java 99.91% 100.00% Backtracking
0212 word-search-ii word-search-ii Hard java 99.98% 77.78% Backtracking
0679 24-game 24-game Hard java 93.33% 14.29% Backtracking
0784 letter-case-permutation letter-case-permutation Easy java 89.19% 100.00% Backtracking

Trie

总结调整中,草稿内容请参考这里

题号 题目(官网) 题目(中国) 难度 代码 结果 标签
0139 word-break word-break Medium java 99.62% 77.20% tree.trie
0140 word-break-ii word-break-ii Hard java 100.00% 92.20% tree.trie
0208 implement-trie-prefix-tree implement-trie-prefix-tree Medium- java 99.79% 98.24% Trie
0211 design-add-and-search-words-data-structure design-add-and-search-words-data-structure Medium java 100.00% 76.32% Trie
0720 longest-word-in-dictionary longest-word-in-dictionary Easy java 100.00% 97.61% Trie
1023 camelcase-matching camelcase-matching Medium java 100.00% 99.58% Trie

Find Pattern

总结调整中,草稿内容请参考这里

题号 题目(官网) 题目(中国) 难度 代码 结果 标签
mst01.05 one-away-lcci one-away-lcci Medium java 100.00% 5.04% Find Pattern
0005 longest-palindromic-substring longest-palindromic-substring Medium java 87.40% 69.11% String
0006 zigzag-conversion zigzag-conversion Medium java 99.87% 93.46% String
0009 palindrome-number palindrome-number Easy java 100.00% 5.02% Math
0022 generate-parentheses generate-parentheses Medium java 100.00% 68.18% Backtracking
0048 rotate-image rotate-image Medium java 100% 100% Find Pattern
0055 jump-game jump-game Medium java 100% 5.09% Dynamic Programming
0125 valid-palindrome valid-palindrome Easy java 100% 100% String
0234 palindrome-linked-list palindrome-linked-list Easy+ java 99.87% 7.54% findpattern.palindromic
0516 longest-palindromic-subsequence longest-palindromic-subsequence Medium java 100% 100% Dynamic Programming
0647 palindromic-substrings palindromic-substrings Medium java 99.97% 100.00% Dynamic Programming
0680 valid-palindrome-ii valid-palindrome-ii Easy java 99.68% 94.44% String

Depth-First Search

总结调整中,草稿内容请参考这里

题号 题目(官网) 题目(中国) 难度 代码 结果 标签
0112 path-sum path-sum Easy java 100.00% 6.52% Depth-First Search
0113 path-sum-ii path-sum-ii Medium java 65.46% 5.26% Depth-First Search
0113 path-sum-ii path-sum-ii Hard java 99.67% 1ms 7.69% Depth-First Search
0129 sum-root-to-leaf-numbers sum-root-to-leaf-numbers Medium java 100.00% 87.92% Depth-First Search
0257 binary-tree-paths binary-tree-paths Easy java 93.46% 37.08% Depth-First Search

Greedy

总结调整中,草稿内容请参考这里

题号 题目(官网) 题目(中国) 难度 代码 结果 标签
0012 integer-to-roman integer-to-roman Medium- java 100.00% 100.00% Greedy
0013 roman-to-integer roman-to-integer Easy java 94.96% 94.49% Math
0053 maximum-subarray maximum-subarray Easy java 100.00% 99.53% Greedy, DP
0392 is-subsequence is-subsequence Easy java 100.00% 100.00% Greedy
0751 ip-to-cidr ip-to-cidr Easy+ java 100.00% 100.00% Greedy

Minimax

总结调整中,草稿内容请参考这里

题号 题目(官网) 题目(中国) 难度 代码 结果 标签
0292 nim-game nim-game Easy java 100.00% 100.00% Minimax
0375 guess-number-higher-or-lower-ii guess-number-higher-or-lower-ii Medium java 99.47% 5.41% Minimax
0486 predict-the-winner predict-the-winner Medium java 100.00% 5.45% Minimax
0877 stone-game stone-game Medium java 100.00% 100.00% Minimax
1140 stone-game-ii stone-game-ii Medium java 100.00% 100.00% Minimax

String Match

总结调整中,草稿内容请参考这里

题号 题目(官网) 题目(中国) 难度 代码 结果 标签
0028 implement-strstr implement-strstr Easy+ java 53.86% 64.88% String
0030 substring-with-concatenation-of-all-words substring-with-concatenation-of-all-words Hard java 47.38% 5.00% String Match
0758 bold-words-in-string bold-words-in-string Easy + java 96.18% 100.00% String Match

Ordered Map

总结调整中,草稿内容请参考这里

题号 题目(官网) 题目(中国) 难度 代码 结果 标签
0220 contains-duplicate-iii contains-duplicate-iii Medium java 90.80% 5.28% Ordered Map
0352 data-stream-as-disjoint-intervals data-stream-as-disjoint-intervals Hard java 75.24% 75.00% Ordered Map
0729 my-calendar-i my-calendar-i Medium java 55.27% 19.51% Ordered Map
0731 my-calendar-ii my-calendar-ii Medium+ java 100.00% 70.83% Ordered Map

Sliding Window

总结调整中,草稿内容请参考这里

题号 题目(官网) 题目(中国) 难度 代码 结果 标签
0003 longest-substring-without-repeating-characters longest-substring-without-repeating-characters Medium java 99.83% 80.19% Sliding Window
0076 minimum-window-substring minimum-window-substring Hard java 42.34% 13.33% Sliding Window
0239 sliding-window-maximum sliding-window-maximum Hard java 39.53% 6.67% Sliding Window
0424 longest-repeating-character-replacement longest-repeating-character-replacement Medium java 33.67% 100.00% Sliding Window

Geometry

总结调整中,草稿内容请参考这里

题号 题目(官网) 题目(中国) 难度 代码 结果 标签
0892 surface-area-of-3d-shapes surface-area-of-3d-shapes Easy java 77.35% 100.00% Math
0963 minimum-area-rectangle-ii minimum-area-rectangle-ii Medium+ java 52.63% 100.00% Geometry
1401 circle-and-rectangle-overlapping circle-and-rectangle-overlapping Medium java 100.00% 100.00% Geometry

Tree

总结调整中,草稿内容请参考这里

题号 题目(官网) 题目(中国) 难度 代码 结果 标签
0095 unique-binary-search-trees-ii unique-binary-search-trees-ii Medium java 100.00% 99.41% Binary Search Tree;Dynamic Programming
0096 unique-binary-search-trees unique-binary-search-trees Medium java 100.00% 99.41% Binary Search Tree;Dynamic Programming
0098 validate-binary-search-tree validate-binary-search-tree Medium java 100.00% 5.80% Binary Search Tree
0100 same-tree same-tree Easy java 100.00% 0ms 5.33% Binary Tree
0101 symmetric-tree symmetric-tree Easy java 100.00% 26.66% Binary Tree
0104 maximum-depth-of-binary-tree maximum-depth-of-binary-tree Easy java 100.00% 25.42% Binary Tree
0105 construct-binary-tree-from-preorder-and-inorder-traversal construct-binary-tree-from-preorder-and-inorder-traversal Medium java 77.57% 70.00% Binary Tree
0106 construct-binary-tree-from-inorder-and-postorder-traversal construct-binary-tree-from-inorder-and-postorder-traversal Medium java 74.17% 61.90% Binary Tree
0108 convert-sorted-array-to-binary-search-tree convert-sorted-array-to-binary-search-tree Easy java 100.00% 5.06% Binary Search Tree
0110 balanced-binary-tree balanced-binary-tree Easy java 99.69% 1ms 23.53% Binary Tree
0114 flatten-binary-tree-to-linked-list flatten-binary-tree-to-linked-list Medium java 100% 99.89% Morris Traversal
0116 populating-next-right-pointers-in-each-node populating-next-right-pointers-in-each-node Medium java 100% 100% Binary Tree
0117 populating-next-right-pointers-in-each-node-ii populating-next-right-pointers-in-each-node-ii Medium java 45.96% 50.00% Binary Tree
0139 word-break word-break Medium java 99.62% 77.20% tree.trie
0140 word-break-ii word-break-ii Hard java 100.00% 92.20% tree.trie
0173 binary-search-tree-iterator binary-search-tree-iterator Medium java 72.82% 100% Binary Search Tree,Stack
0208 implement-trie-prefix-tree implement-trie-prefix-tree Medium- java 99.79% 98.24% Trie
0211 design-add-and-search-words-data-structure design-add-and-search-words-data-structure Medium java 100.00% 76.32% Trie
0226 invert-binary-tree invert-binary-tree Easy- java 100.00% 48.73% Binary Tree
0235 lowest-common-ancestor-of-a-binary-search-tree lowest-common-ancestor-of-a-binary-search-tree Easy java 99.85% 6.06% Binary Search Tree
0236 lowest-common-ancestor-of-a-binary-tree lowest-common-ancestor-of-a-binary-tree null java 100.00% 44.21% Binary Tree
0236 lowest-common-ancestor-of-a-binary-tree lowest-common-ancestor-of-a-binary-tree null java 100% 19.83% Binary Tree
0297 serialize-and-deserialize-binary-tree serialize-and-deserialize-binary-tree Hard java 26.24% 33.57% Binary Tree
0404 sum-of-left-leaves sum-of-left-leaves Easy java 100.00% 88.90% Binary Tree
0450 delete-node-in-a-bst delete-node-in-a-bst Medium+ java 100.00% 20.00% Binary Search Tree
0501 find-mode-in-binary-search-tree find-mode-in-binary-search-tree Easy java 100% 100% Morris Traversal
0530 minimum-distance-between-bst-nodes minimum-distance-between-bst-nodes null java 100.00% 52.53% Binary Search Tree
0538 convert-bst-to-greater-tree convert-bst-to-greater-tree Easy java 98.33% 62.29% Binary Search Tree
0543 diameter-of-binary-tree diameter-of-binary-tree Easy+ java 100.00% 23.72% tree.binarytree
0563 binary-tree-tilt binary-tree-tilt Easy java 100.00% 31.25% tree.binarytree
0589 n-ary-tree-preorder-traversal n-ary-tree-preorder-traversal Easy java 100.00% 17.07% Tree
0617 merge-two-binary-trees merge-two-binary-trees Easy java 100.00% 17.28% Binary Tree
0671 second-minimum-node-in-a-binary-tree second-minimum-node-in-a-binary-tree null java 100.00% 93.19% Binary Tree
0700 search-in-a-binary-search-tree search-in-a-binary-search-tree Easy- java 100.00% 9.09% Binary Search Tree
0720 longest-word-in-dictionary longest-word-in-dictionary Easy java 100.00% 97.61% Trie
1023 camelcase-matching camelcase-matching Medium java 100.00% 99.58% Trie

Design

总结调整中,草稿内容请参考这里

题号 题目(官网) 题目(中国) 难度 代码 结果 标签
Offer20 biao-shi-shu-zhi-de-zi-fu-chuan-lcof biao-shi-shu-zhi-de-zi-fu-chuan-lcof Medium java 66.54% 58.76% Math
0146 lru-cache lru-cache Medium java 91.27% 67.29% Design
Offer09 yong-liang-ge-zhan-shi-xian-dui-lie-lcof yong-liang-ge-zhan-shi-xian-dui-lie-lcof Easy java 69.99% 40.92% Queue, Stack

Pure Programming

总结调整中,草稿内容请参考这里

题号 题目(官网) 题目(中国) 难度 代码 结果 标签
0151 reverse-words-in-a-string reverse-words-in-a-string Easy java 100.00% 16.01% Pure Programming
1360 number-of-days-between-two-dates number-of-days-between-two-dates Easy java 100% 100% Details
mst16.04 tic-tac-toe-lcci tic-tac-toe-lcci Medium java 75.80% 5.19% Pure Programming

Morris Traversal

总结调整中,草稿内容请参考这里

题号 题目(官网) 题目(中国) 难度 代码 结果 标签
0114 flatten-binary-tree-to-linked-list flatten-binary-tree-to-linked-list Medium java 100% 99.89% Morris Traversal
0501 find-mode-in-binary-search-tree find-mode-in-binary-search-tree Easy java 100% 100% Morris Traversal

Merge

总结调整中,草稿内容请参考这里

题号 题目(官网) 题目(中国) 难度 代码 结果 标签
0021 merge-two-sorted-lists merge-two-sorted-lists Easy java 100.00% 79.05% Linked List, Recursion
0023 merge-k-sorted-lists merge-k-sorted-lists Hard java 84.07% 48.81% Divide & Conquer

Union Find

总结调整中,草稿内容请参考这里

题号 题目(官网) 题目(中国) 难度 代码 结果 标签
0547 friend-circles friend-circles Medium java 99.93% 96.00% Union Find
0990 satisfiability-of-equality-equations satisfiability-of-equality-equations Medium java 100.00% 16.67% Union Find

Divide & Conquer

总结调整中,草稿内容请参考这里

题号 题目(官网) 题目(中国) 难度 代码 结果 标签
0215 kth-largest-element-in-an-array kth-largest-element-in-an-array Medium java 99.87% 5.15% Divide & Conquer, Heap
0241 different-ways-to-add-parentheses different-ways-to-add-parentheses Medium java 100% 100% Divide & Conquer

Concurrency

总结调整中,草稿内容请参考这里

题号 题目(官网) 题目(中国) 难度 代码 结果 标签
1114 print-in-order print-in-order Easy java 100% 100% Concurrency

Fast Slow Pointers

总结调整中,草稿内容请参考这里

题号 题目(官网) 题目(中国) 难度 代码 结果 标签
0019 remove-nth-node-from-end-of-list remove-nth-node-from-end-of-list Medium- java 100.00% 94.24% Two Pointers

Hash Function

总结调整中,草稿内容请参考这里

题号 题目(官网) 题目(中国) 难度 代码 结果 标签
0939 minimum-area-rectangle minimum-area-rectangle Medium java 77.35% 100.00% Hash Function

Graph

总结调整中,草稿内容请参考这里

题号 题目(官网) 题目(中国) 难度 代码 结果 标签
0997 find-the-town-judge find-the-town-judge null java 98.73% 100.00% Graph

Greatest Common Divisor

总结调整中,草稿内容请参考这里

题号 题目(官网) 题目(中国) 难度 代码 结果 标签
1071 greatest-common-divisor-of-strings greatest-common-divisor-of-strings Easy java 97.81% 100.00% Greatest Common Divisor

Heap

总结调整中,草稿内容请参考这里

题号 题目(官网) 题目(中国) 难度 代码 结果 标签
0703 kth-largest-element-in-a-stream kth-largest-element-in-a-stream null java 99.55% 64.02% Heap

Recursion

总结调整中,草稿内容请参考这里

题号 题目(官网) 题目(中国) 难度 代码 结果 标签

Releases

No releases published

Packages

No packages published

Languages