刷题咖啡馆

qr

View My GitHub Profile

Problems

力扣题解

Problem Solution Supplementary
1. Two Sum 代码实现 —-
3. Longest Substring Without Repeating Characters 代码实现 —-
4. Median of Two Sorted Arrays 代码实现
6. ZigZag Conversion 代码实现 —-
11. Container With Most Water 代码实现
15. 3Sum 代码实现 视频
16. 3Sum Closest 代码实现 —–
17. Letter Combinations of a Phone Number 代码实现 —–
18. 4Sum 代码实现 视频
19. Remove Nth Node From End of List 代码实现 —–
20. Valid Parentheses 代码实现 —–
22. Generate Parentheses 代码实现 视频
24. Swap Nodes in Pairs 代码实现 —-
26. Remove Duplicates from Sorted Array 代码实现 视频
27. Remove Element 代码实现 —-
28. Implement strStr() 代码实现 —-
30. Substring with Concatenation of All Words 代码实现 —-
31. Next Permutation 代码实现 视频
33. Search in Rotated Sorted Array 代码实现 视频
36. Valid Sudoku 代码实现
37. Sudoku Solver 代码实现
39. Combination Sum 代码实现
40. Combination Sum II 代码实现
42. Trapping Rain Water 代码实现 视频
45. Jump Game II 代码实现 视频
46. Permutations 代码实现
47. Permutations II 代码实现
48. Rotate Image 代码实现
50. Pow(x, n) 代码实现
51. N-Queens 代码实现
53. Maximum Subarray 代码实现
54. Spiral Matrix 代码实现 —-
55. Jump Game 代码实现 视频
56. Merge Intervals 代码实现 —-
59. Spiral Matrix II 代码实现 —-
60. Permutation Sequence 代码实现 视频
62. Unique Paths 代码实现 —-
63. Unique Paths II 代码实现 —-
66. Plus One 代码实现
70. Climbing Stairs 代码实现 —-
71. Simplify Path 代码实现 —-
72. Edit Distance 代码实现 —-
73. Set Matrix Zeroes 代码实现
77. Combinations 代码实现
78. Subsets 代码实现
80. Remove Duplicates from Sorted Array II 代码实现 视频
81. Search in Rotated Sorted Array II 代码实现 视频
84. Largest Rectangle in Histogram 代码实现
89. Gray Code 代码实现 视频, 题解
90. Subsets II 代码实现
93. Restore IP Addresses 代码实现
94. Binary Tree Inorder Traversal 代码实现
96. Unique Binary Search Trees 代码实现
98. Validate Binary Search Tree 代码实现
99. Recover Binary Search Tree 代码实现
100. Same Tree 代码实现
101. Symmetric Tree 代码实现 —-
102. Binary Tree Level Order Traversal 代码实现 —-
104. Maximum Depth of Binary Tree 代码实现 —-
106. Construct Binary Tree from Inorder and Postorder Traversal 代码实现 —-
108. Convert Sorted Array to Binary Search Tree 代码实现 —-
110. Balanced Binary Tree 代码实现 —-
111. Minimum Depth of Binary Tree 代码实现 —-
112. Path Sum 代码实现 —-
113. Path Sum II 代码实现 —-
115. Distinct Subsequences 代码实现 —-
120. Triangle 代码实现 —-
121. Best Time to Buy and Sell Stock 代码实现
122. Best Time to Buy and Sell Stock II 代码实现
123. Best Time to Buy and Sell Stock III 代码实现
128. Longest Consecutive Sequence 代码实现 视频
131. Palindrome Partitioning 代码实现
133. Clone Graph 代码实现
134. Gas Station 代码实现 视频
135. Candy 代码实现 —-
136. Single Number 代码实现
137. Single Number II 代码实现 —–
139. Word Break 代码实现 —–
141. Linked List Cycle 代码实现 —-
142. Linked List Cycle II 代码实现 —–
144. Binary Tree Preorder Traversal 代码实现 —–
145. Binary Tree Postorder Traversal 代码实现 —-
150. Evaluate Reverse Polish Notation 代码实现 —–
151. Reverse Words in a String 代码实现 —–
160. Intersection of Two Linked Lists 代码实现
172. Factorial Trailing Zeroes 代码实现  
188. Best Time to Buy and Sell Stock IV 代码实现
190. Reverse Bits 代码实现
198. House Robber 代码实现
202. Happy Number 代码实现
203. Remove Linked List Elements 代码实现
206. Reverse Linked List 代码实现
209. Minimum Size Subarray Sum 代码实现
213. House Robber II 代码实现
216. Combination Sum III 代码实现
219. Contains Duplicate II 代码实现 题解
222. Count Complete Tree Nodes 代码实现
225. Implement Stack using Queues 代码实现
232. Implement Queue using Stacks 代码实现 —-
235. Lowest Common Ancestor of a Binary Search Tree 代码实现 —-
236. Lowest Common Ancestor of a Binary Tree 代码实现 —-
239. Sliding Window Maximum 代码实现 —-
241. Different Ways to Add Parentheses 代码实现
242. Valid Anagram 代码实现
256. Paint House 代码实现
257. Binary Tree Paths 代码实现
258. Add Digits 代码实现 题解
260. Single Number III 代码实现
268. Missing Number 代码实现
269. Alien Dictionary 代码实现 题解, 视频
279. Perfect Squares 代码实现 —-
300. Longest Increasing Subsequence 代码实现 —-
306. Additive Number 代码实现 题解, 视频
307. Range Sum Query - Mutable 代码实现 题解, 视频
309. Best Time to Buy and Sell Stock with Cooldown 代码实现 —-
318. Maximum Product of Word Lengths 代码实现
322. Coin Change 代码实现
324. Wiggle Sort II 代码实现
332. Reconstruct Itinerary 代码实现
334. Increasing Triplet Subsequence 代码实现 题解
337. House Robber III 代码实现
343. Integer Break 代码实现
344. Reverse String 代码实现
349. Intersection of Two Arrays 代码实现
357. Count Numbers with Unique Digits 代码实现 题解, 视频
372. Super Pow 代码实现 题解
373. Find K Pairs with Smallest Sums 代码实现 题解
376. Wiggle Subsequence 代码实现
377. Combination Sum IV 代码实现
380. Insert Delete GetRandom O(1) 代码实现 题解, 视频
382. Linked List Random Node 代码实现
383. Ransom Note 代码实现
385. Mini Parser 代码实现 题解, 视频
386. Lexicographical Numbers 代码实现 题解, 视频
388. Longest Absolute File Path 代码实现 题解, 视频
390. Elimination Game 代码实现
392. Is Subsequence 代码实现
393. UTF-8 Validation 代码实现 题解
395. Longest Substring with At Least K Repeating Characters 代码实现
396. Rotate Function 代码实现 题解
397. Integer Replacement 代码实现
398. Random Pick Index 代码实现 题解
404. Sum of Left Leaves 代码实现
406. Queue Reconstruction by Height 代码实现
415. Add Strings 代码实现 —-
416. Partition Equal Subset Sum 代码实现 —-
417. Pacific Atlantic Water Flow 代码实现 题解视频
419. Battleships in a Board 代码实现 —-
420. Strong Password Checker 代码实现 题解视频
427. Construct Quad Tree 代码实现 题解视频
429. N-ary Tree Level Order Traversal 代码实现  
432. All O one Data Structure 代码实现 题解视频
433. Minimum Genetic Mutation 代码实现 题解
435. Non-overlapping Intervals 代码实现 —-
440. K-th Smallest in Lexicographical Order 代码实现 题解视频
429. N-ary Tree Level Order Traversal 代码实现  
436. Find Right Interval 代码实现 题解
442. Find All Duplicates in an Array 代码实现 —-
449. Serialize and Deserialize BST 代码实现 —-
450. Delete Node in a BST 代码实现 题解, 视频
452. Minimum Number of Arrows to Burst Balloons 代码实现 —-
454. 4Sum II 代码实现 —-
455. Assign Cookies 代码实现 —-
458. Poor Pigs 代码实现 —-
459. Repeated Substring Pattern 代码实现 —-
461. Hamming Distance 代码实现 —-
462. Minimum Moves to Equal Array Elements II 代码实现 题解, 视频
464. Can I Win 代码实现 题解
467. Unique Substrings in Wraparound String 代码实现 题解
468. Validate IP Address 代码实现 —-
473. Matchsticks to Square 代码实现 题解, 视频
474. Ones and Zeroes 代码实现 —-
475. Heaters 代码实现 题解
478. Generate Random Point in a Circle 代码实现 —-
479. Largest Palindrome Product 代码实现 题解, 视频
491. Increasing Subsequences 代码实现
494. Target Sum 代码实现 —-
496. Next Greater Element I 代码实现 —-
497. Random Point in Non-overlapping Rectangles 代码实现
498. Diagonal Traverse 代码实现
501. Find Mode in Binary Search Tree 代码实现 —-
503. Next Greater Element II 代码实现 —-
504. Base 7 代码实现 题解
506. Relative Ranks 代码实现 —-
507. Perfect Number 代码实现 —-
508. Most Frequent Subtree Sum 代码实现 —-
509. Fibonacci Number 代码实现 —-
513. Find Bottom Left Tree Value 代码实现 —-
515. Find Largest Value in Each Tree Row 代码实现 —-
516. Longest Palindromic Subsequence 代码实现 —-
518. Coin Change 2 代码实现 —-
521. Longest Uncommon Subsequence I 代码实现 题解
522. Longest Uncommon Subsequence II 代码实现 —-
524. Longest Word in Dictionary through Deleting 代码实现 题解
530. Minimum Absolute Difference in BST 代码实现 —-
532. K-diff Pairs in an Array 代码实现 题解
535. Encode and Decode TinyURL 代码实现 —-
537. Complex Number Multiplication 代码实现 题解
538. Convert BST to Greater Tree 代码实现 —-
539. Minimum Time Difference 代码实现 题解
540. Single Element in a Sorted Array 代码实现 题解
541. Reverse String II 代码实现
553. Optimal Division 代码实现 题解视频
556. Next Greater Element III 代码实现
559. Maximum Depth of N-ary Tree 代码实现
563. Binary Tree Tilt 代码实现
564. Find the Closest Palindrome 代码实现 题解视频
572. Subtree of Another Tree 代码实现
583. Delete Operation for Two Strings 代码实现
587. Erect the Fence 代码实现 题解
589. N-ary Tree Preorder Traversal 代码实现 题解
590. N-ary Tree Postorder Traversal 代码实现 题解
591. Tag Validator 代码实现 题解, 视频
599. Minimum Index Sum of Two Lists 代码实现 题解
606. Construct String from Binary Tree 代码实现  
617. Merge Two Binary Trees 代码实现
647. Palindromic Substrings 代码实现
648. Replace Words 代码实现
653. Two Sum IV - Input is a BST 代码实现  
654. Maximum Binary Tree 代码实现
661. Image Smoother 代码实现 题解
668. Kth Smallest Number in Multiplication Table 代码实现 题解视频
669. Trim a Binary Search Tree 代码实现
674. Longest Continuous Increasing Subsequence 代码实现
675. Cut Off Trees for Golf Event 代码实现 题解
682. Baseball Game 代码实现 题解
688. Knight Probability in Chessboard 代码实现 题解视频
689. Maximum Sum of 3 Non-Overlapping Subarrays 代码实现 题解
691. Stickers to Spell Word 代码实现 题解视频
692. Top K Frequent Words 代码实现
693. Binary Number with Alternating Bits 代码实现
699. Falling Squares 代码实现 题解视频
700. Search in a Binary Search Tree 代码实现
701. Insert into a Binary Search Tree 代码实现
704. Binary Search 代码实现
707. Design Linked List 代码实现
708. Insert into a Cyclic Sorted List 代码实现 题解, 视频
709. To Lower Case 代码实现
710. Random Pick with Blacklist 代码实现
713. Subarray Product Less Than K 代码实现 题解视频
714. Best Time to Buy and Sell Stock with Transaction Fee 代码实现
715. Range Module 代码实现 题解视频
717. 1-bit and 2-bit Characters 代码实现 题解
718. Maximum Length of Repeated Subarray 代码实现
719. Find K-th Smallest Pair Distance 代码实现 题解
720. Longest Word in Dictionary 代码实现 题解视频
728. Self Dividing Numbers 代码实现
729. My Calendar I 代码实现
730. Count Different Palindromic Subsequences 代码实现
732. My Calendar III 代码实现 题解视频
736. Parse Lisp Expression 代码实现 题解视频
738. Monotone Increasing Digits 代码实现
739. Daily Temperatures 代码实现
746. Min Cost Climbing Stairs 代码实现
747. Largest Number At Least Twice of Others 代码实现 题解
748. Shortest Completing Word 代码实现
763. Partition Labels 代码实现
780. Reaching Points 代码实现 题解
786. K-th Smallest Prime Fraction 代码实现
794. Valid Tic-Tac-Toe State 代码实现 题解
798. Smallest Rotation with Highest Score 代码实现 题解视频
804. Unique Morse Code Words 代码实现 题解
806. Number of Lines To Write String 代码实现
807. Max Increase to Keep City Skyline 代码实现
812. Largest Triangle Area 代码实现 题解, 视频
819. Most Common Word 代码实现 题解
821. Shortest Distance to a Character 代码实现 题解
829. Consecutive Numbers Sum 代码实现 题解视频
838. Push Dominoes 代码实现 题解视频
846. Hand of Straights 代码实现
860. Lemonade Change 代码实现
868. Binary Gap 代码实现 题解
871. Minimum Number of Refueling Stops 代码实现
875. Koko Eating Bananas 代码实现
883. Projection Area of 3D Shapes 代码实现 题解
884. Uncommon Words from Two Sentences 代码实现 题解
890. Find and Replace Pattern 代码实现
905. Sort Array By Parity 代码实现 题解
908. Smallest Range I 代码实现
911. Online Election 代码实现
913. Cat and Mouse 代码实现
917. Reverse Only Letters 代码实现 题解
926. Flip String to Monotone Increasing 代码实现 题解
929. Unique Email Addresses 代码实现
933. Number of Recent Calls 代码实现 题解
937. Reorder Data in Log Files 代码实现 题解
942. DI String Match 代码实现 题解
953. Verifying an Alien Dictionary 代码实现  
954. Array of Doubled Pairs 代码实现 题解, 视频
961. N-Repeated Element in Size 2N Array 代码实现 题解, 视频
965. Univalued Binary Tree 代码实现
968. Binary Tree Cameras 代码实现
969. Pancake Sorting 代码实现 题解
977. Squares of a Sorted Array 代码实现
997. Find the Town Judge 代码实现 题解
1001. Grid Illumination 代码实现 题解视频
1005. Maximize Sum Of Array After K Negations 代码实现 ——
1020. Number of Enclaves 代码实现 题解
1021. Remove Outermost Parentheses 代码实现 题解
1022. Sum of Root To Leaf Binary Numbers 代码实现 题解
1034. Coloring A Border 代码实现 ——
1035. Uncrossed Lines 代码实现 ——
1036. Escape a Large Maze 代码实现 —–
1037. Valid Boomerang 代码实现 题解
1047. Remove All Adjacent Duplicates In String 代码实现 ——
1049. Last Stone Weight II 代码实现 ——
1051. Height Checker 代码实现 题解
1089. Duplicate Zeros 代码实现 ——
1143. Longest Common Subsequence 代码实现 ——
1154. Day of the Year 代码实现 题解
1175. Prime Arrangements 代码实现 ——
1185. Day of the Week 代码实现 ——
1189. Maximum Number of Balloons 代码实现 题解
1200. Minimum Absolute Difference 代码实现 ——
1219. Path with Maximum Gold 代码实现 题解
1220. Count Vowels Permutation 代码实现 题解
1305. All Elements in Two Binary Search Trees 代码实现  
1332. Remove Palindromic Subsequences 代码实现 题解
1342. Number of Steps to Reduce a Number to Zero 代码实现 题解
1345. Jump Game IV 代码实现 题解
1356. Sort Integers by The Number of 1 Bits 代码实现 ——
1380. Lucky Numbers in a Matrix 代码实现 题解
1405. Longest Happy String 代码实现 题解, 视频
1414. Find the Minimum Number of Fibonacci Numbers Whose Sum Is K 代码实现 题解
1447. Simplified Fractions 代码实现  
1449. Form Largest Integer With Digits That Add up to Target 代码实现 视频
1518. Water Bottles 代码实现 题解
1576. Replace All ?’s to Avoid Consecutive Repeating Characters 代码实现 题解
1601. Maximum Number of Achievable Transfer Requests 代码实现 题解视频
1606. Find Servers That Handled Most Number of Requests 代码实现 题解视频
1610. Maximum Number of Visible Points 代码实现 ——
1614. Maximum Nesting Depth of the Parentheses 代码实现 ——
1629. Slowest Key 代码实现 ——
1672. Richest Customer Wealth 代码实现 ——
1688. Count of Matches in Tournament 代码实现 ——
1706. Where Will the Ball Fall 代码实现 题解
1716. Calculate Money in Leetcode Bank 代码实现 题解
1719. Number Of Ways To Reconstruct A Tree 代码实现 题解视频
1723. Find Minimum Time to Finish All Jobs 代码实现 题解
1725. Number Of Rectangles That Can Form The Largest Square 代码实现 题解
1748. Sum of Unique Elements 代码实现 题解
1763. Longest Nice Substring 代码实现 题解, 视频
1765. Map of Highest Peak 代码实现 题解
1791. Find Center of Star Graph 代码实现 题解
1816. Truncate Sentence 代码实现 ——
1823. Find the Winner of the Circular Game 代码实现 题解, 视频
1984. Minimum Difference Between Highest and Lowest of K Scores 代码实现  
1994. The Number of Good Subsets 代码实现 题解, 视频
1996. The Number of Weak Characters in the Game 代码实现 题解, 视频
2000. Reverse Prefix of Word 代码实现 题解
2006. Count Number of Pairs With Absolute Difference K 代码实现  
2013. Detect Squares 代码实现 题解, 视频
2016. Maximum Difference Between Increasing Elements 代码实现 题解
2022. Convert 1D Array Into 2D Array 代码实现 ——
2024. Maximize the Confusion of an Exam 代码实现 题解视频
2028. Find Missing Observations 代码实现 题解
2029. Stone Game IX 代码实现 题解, 视频
2034. Stock Price Fluctuation 代码实现 ——
2038. Remove Colored Pieces if Both Neighbors are the Same Color 代码实现 题解
2039. The Time When the Network Becomes Idle 代码实现 题解视频
2044. Count Number of Maximum Bitwise-OR Subsets 代码实现 题解视频
2045. Second Minimum Time to Reach Destination 代码实现 题解
2047. Number of Valid Words in a Sentence 代码实现 ——
2049. Count Nodes With the Highest Score 代码实现 题解
2055. Plates Between Candles 代码实现 题解视频
2062. Count Vowel Substrings of a String 代码实现 ——
2063. Vowels of All Substrings 代码实现 ——
2100. Find Good Days to Rob the Bank 代码实现 题解视频
2104. Sum of Subarray Ranges 代码实现 题解视频
5194. Minimum Moves to Reach Target Score 代码实现 题解
5259. Calculate Amount Paid in Taxes 代码实现 —–
5270. Minimum Path Cost in a Grid 代码实现 —–
5289. Fair Distribution of Cookies 代码实现 视频
5976. Check if Every Row and Column Contains All Numbers 代码实现 题解
5977. Minimum Swaps to Group All 1’s Together II 代码实现 —–
5982. Solving Questions With Brainpower 代码实现 题解
5992. Maximum Good People Based on Statements 代码实现 题解, 视频
6003. Minimum Time to Remove All Cars Containing Illegal Goods 代码实现 题解, 视频
6094. Naming a Company 代码实现 视频

剑指 Offer

Problem Solution Supplementary
剑指 Offer 05. 替换空格 代码实现 ——
剑指 Offer 58 - II. 左旋转字符串 代码实现 ——

程序员面试金典

Problem Solution Supplementary
面试题 04.06. 后继者 代码实现 题解, 视频
面试题 17.11. 单词距离 代码实现 题解, 视频