since 2019-09-03 19:40
简体中文 | English
This essay records the course of and my emotion to this project from initialisation to 10,000 stars. Milestone for 10,000+ stars
If you are interested in this project, do not mean your star. This project will be supported for a long enough time by the comminity. Thanks for every audience and contributor.
LeetCode Solutions: A Journey of Problem Solving.
This repository is divided into five parts for now:
-
The first part is the solutions to some classic problems on LeetCode, including the idea thinkings, key points and code implementations.
-
The second part is a summary of data structures and algorithms.
-
The third part is Anki flashcards that organizes the LeetCode problems in a certain way to make it easier to remember.
-
The fourth part is daily challenges which were held at group chat. We usually solve one problem altogether to get more feedback. Moreover, the problems can be drafted to add to the problem solving module.
-
The fifth part is a future plannning on content that will be introduced into the above parts.
Only when having mastered the basic data structures and algorithms can you solve complex problems easily.
I, a programmer, am all passionate about technology.
Used to write .net
and Java
, I am a frontend engineer and focused on the engineering, optimization and standardlization for frontend.
If you want to do some contributions or collaborations, just feel free to contact me via [[email protected]].
- For the parts that were added recently, there will be a 🆕 behind.
- For the parts that were updated recently, there will be a 🖊 behind.
- Here will be the place to update Anki Flashcards in the future as well.
- Here is a mind mapping graph showing the summary of categorizations of problems that are questioned frequently in interviews. We could analyze according to the information in the graph.
(Picture credited by LeetCode-cn.)
The algorithms mainly includes:
- Basic skills: Divide-and-Conquer; Binary; Greedy
- Sorting algorithms: Quicksort; Merge Sort; Counting Sort
- Searching algorithms: Backtracking; Recursion; Depth-First-Search (DFS); Breath-First-Search (BFS); Binary Search Tree; etc.
- Graph theory: Shortest Path Problem; Minimal Spanning Tree
- Dynamic Programming: Knapsack Problem; Longest Common Subsequence (LCS) Problem
The data structures mainly includes:
- Array and linked list: Singly/Doubly-Linked List
- Stack and queue
- Hash table
- Heap: Min-Max Heap
- Tree and Graph: Lowest Common Ancestor (LCA); Disjoint-Set
- String: Prefix Tree (Trie); Suffix Tree
-
Top 100 Liked Questions (84 / 100)
-
Top Interview Questions (115 / 145)
Here only lists some representative problems but not all.
- 0001.TwoSum🆕
- 0020.Valid Parentheses
- 0021.MergeTwoSortedLists 🆕
- 0026.remove-duplicates-from-sorted-array
- 0053.maximum-sum-subarray 🆕
- 0088.merge-sorted-array
- 0104.maximum-depth-of-binary-tree
- 0121.best-time-to-buy-and-sell-stock
- 0122.best-time-to-buy-and-sell-stock-ii
- 0125.valid-palindrome 🆕
- 0136.single-number
- 0155.min-stack 🆕
- 0167.two-sum-ii-input-array-is-sorted
- 0172.factorial-trailing-zeroes
- 0169.majority-element
- 0190.reverse-bits
- 0191.number-of-1-bits
- 0198.house-robber
- 0203.remove-linked-list-elements
- 0206.reverse-linked-list
- 0219.contains-duplicate-ii
- 0226.invert-binary-tree
- 0232.implement-queue-using-stacks 🆕
- 0263.ugly-number
- 0283.move-zeroes
- 0342.power-of-four
- 0371.sum-of-two-integers
- 0349.intersection-of-two-arrays
- 0437.path-sum-iii 🆕
- 0455.AssignCookies 🆕
- 0501.find-mode-in-binary-search-tree 🆕
- 0575.distribute-candies
- 0002. Add Two Numbers
- 0003. Longest Substring Without Repeating Characters
- 0005.longest-palindromic-substring
- 0011.container-with-most-water
- 0015.3-sum
- 0017.Letter-Combinations-of-a-Phone-Number 🆕
- 0019. Remove Nth Node From End of List
- 0022.GenerateParentheses 🆕
- 0024. Swap Nodes In Pairs
- 0029.divide-two-integers
- 0031.next-permutation
- 0033.search-in-rotated-sorted-array
- 0039.combination-sum
- 0040.combination-sum-ii
- 0046.permutations
- 0047.permutations-ii
- 0048.rotate-image
- 0049.group-anagrams
- 0055.jump-game
- 0056.merge-intervals
- 0062.unique-paths
- 0073.set-matrix-zeroes
- 0075.sort-colors
- 0078.subsets
- 0079.word-search
- 0086.partition-list
- 0090.subsets-ii
- 0091.decode-ways
- 0092.reverse-linked-list-ii
- 0094.binary-tree-inorder-traversal
- 0098.validate-binary-search-tree
- 0102.binary-tree-level-order-traversal
- 0103.binary-tree-zigzag-level-order-traversal
- 105.Construct-Binary-Tree-from-Preorder-and-Inorder-Traversal.md
- 0113.path-sum-ii
- 0129.sum-root-to-leaf-numbers
- 0130.surrounded-regions
- 0131.palindrome-partitioning
- 0139.word-break
- 0144.binary-tree-preorder-traversal
- 0150.evaluate-reverse-polish-notation
- 0152.maximum-product-subarray
- 0199.binary-tree-right-side-view
- 0200.number-of-islands 🆕
- 0201.bitwise-and-of-numbers-range
- 0208.implement-trie-prefix-tree
- 0209.minimum-size-subarray-sum
- 0215.kth-largest-element-in-an-array 🆕
- 0221.maximal-square
- 0229.majority-element-ii 🆕
- 0230.kth-smallest-element-in-a-bst
- 0236.lowest-common-ancestor-of-a-binary-tree
- 0238.product-of-array-except-self
- 0240.search-a-2-d-matrix-ii
- 0279.perfect-squares
- 0309.best-time-to-buy-and-sell-stock-with-cooldown
- 0322.coin-change
- 0328.odd-even-linked-list
- 0334.increasing-triplet-subsequence
- 0365.water-and-jug-problem
- 0378.kth-smallest-element-in-a-sorted-matrix
- 0416.partition-equal-subset-sum
- 0445.add-two-numbers-ii
- 0454.4-sum-ii
- 0474.ones-and-zeros
- 0494.target-sum
- 0516.longest-palindromic-subsequence
- 0518.coin-change-2
- 0547.friend-circles 🆕
- 0609.find-duplicate-file-in-system
- 0875.koko-eating-bananas
- 0877.stone-game
- 0887.super-egg-drop
- 0900.rle-iterator
- 0912.sort-an-array 🆕
- 1031.maximum-sum-of-two-non-overlapping-subarrays
- 1218.longest-arithmetic-subsequence-of-given-difference.md 🆕
- 0004.median-of-two-sorted-array 🆕
- 0023.merge-k-sorted-lists
- 0025.reverse-nodes-in-k-group 🆕
- 0032.longest-valid-parentheses 🆕
- 0042.trapping-rain-water
- 0052.N-Queens-II 🆕
- 0124.binary-tree-maximum-path-sum
- 0128.longest-consecutive-sequence
- 0145.binary-tree-postorder-traversal
- 0239.sliding-window-maximum
- 0295.find-median-from-data-stream 🆕
- 0301.remove-invalid-parentheses
- 0460.lfu-cache 🆕
- 1168.optimize-water-distribution-in-a-village 🆕
- Data Structure (Drafts)
- Basic AlgorithmDrafts
- Binary Tree Traversal
- Dynamic Programming
- Huffman Encode and Run Length Encode
- Bloom Filter
- String Problems
Anki falshcards would be mainly two parts: the mappings from key points to problems; the mappings from problems to idea thinks, key points and code implementations.
All flashcards are put in anki-card.
Please check here for more about the usage of Anki.
Latest updated flashcards (only lists the front page):
- What is the key point of the binary search algorithm? Related problems?
- How to simplify the operations using the features of stacks? Related problems?
- The thinkings and related problems of double-pointers problems?
- The thinkings and related problems of sliding window problems?
- The thinkings and related problems of backtracking?
- The thinkings and related problems of number theory?
- The thinkings and related problems of bit operations?
WIP: the translation of the flashcards are on the way.
problems added:#2 #3 #11
We're still on the early stage, so feedback from community is very welcome. For sake of reducing the costs of communication, I created some chat groups.
(Add this bot and reply "leetcode" to join the group.)
- If you have any ideas, Issues or chat in groups.
- If you want to commit to the repository, Pull Request is welcome.
- If you want to edit images resources in this project, here lists the files that can be edited on draw.io.
A big Thank you to every contributor of this project.