| English | 简体中文 |


My LeetCode Solutions

Last updated: 2021-01-16 23:37:05

# Title Solutions Acceptance Difficulty Tags
1203 Sort Items by Groups Respecting Dependencies Go 64.9% hard Depth-first Search, Graph, Topological Sort
1202 Smallest String With Swaps❤️ Go 49.7% medium Union Find, Array
1046 Last Stone Weight Go 65.9% easy Heap, Greedy
1018 Binary Prefix Divisible By 5 Go 51.7% easy Array
509 Fibonacci Number Go 68.3% easy Array
947 Most Stones Removed with Same Row or Column Go 60.9% medium Depth-first Search, Union Find
887 Super Egg Drop Go 28.9% hard Math, Binary Search, Dynamic Programming
861 Score After Flipping Matrix Go 81.1% medium Greedy
860 Lemonade Change Go 58.3% easy Greedy
842 Split Array into Fibonacci Sequence Go 49.4% medium Greedy, String, Backtracking
830 Positions of Large Groups Go 54.3% easy Array
803 Bricks Falling When Hit Go 49.0% hard Union Find
787 Cheapest Flights Within K Stops Go 36.6% medium Heap, Breadth-first Search, Dynamic Programming
763 Partition Labels Go 76.6% medium Greedy, Two Pointers
746 Min Cost Climbing Stairs Go 54.6% easy Array, Dynamic Programming
744 Find Smallest Letter Greater Than Target Go 45.6% easy Binary Search
739 Daily Temperatures❤️ Go 65.8% medium Stack, Hash Table
738 Monotone Increasing Digits Go 50.2% medium Greedy
714 Best Time to Buy and Sell Stock with Transaction Fee Go 69.8% medium Greedy, Array, Dynamic Programming
695 Max Area of Island Go 64.5% medium Depth-first Search, Array
687 Longest Univalue Path Go 42.4% medium Tree, Recursion
685 Redundant Connection II Go 44.4% hard Tree, Depth-first Search, Union Find, Graph
684 Redundant Connection Go 66.0% medium Tree, Union Find, Graph
671 Second Minimum Node In a Binary Tree Go 46.5% easy Tree
669 Trim a Binary Search Tree Go 67.1% easy Tree
665 Non-decreasing Array Go 23.4% easy Array
649 Dota2 Senate Go 48.1% medium Greedy
647 Palindromic Substrings Go 64.7% medium String, Dynamic Programming
637 Average of Levels in Binary Tree Go 68.8% easy Tree
633 Sum of Square Numbers Go 34.7% medium Math
621 Task Scheduler Go 55.5% medium Greedy, Queue, Array
617 Merge Two Binary Trees Go 78.7% easy Tree
605 Can Place Flowers Go 34.2% easy Greedy, Array
581 Shortest Unsorted Continuous Subarray Go 35.7% medium Array
572 Subtree of Another Tree Go 47.2% easy Tree
560 Subarray Sum Equals K❤️ Go 44.9% medium Array, Hash Table
547 Number of Provinces Go 61.2% medium Depth-first Search, Union Find
543 Diameter of Binary Tree❤️ Go 52.1% easy Tree
540 Single Element in a Sorted Array Go 59.5% medium Binary Search
538 Convert BST to Greater Tree Go 65.0% medium Tree
524 Longest Word in Dictionary through Deleting Go 47.0% medium Sort, Two Pointers
513 Find Bottom Left Tree Value Go 72.2% medium Tree, Depth-first Search, Breadth-first Search
501 Find Mode in Binary Search Tree Go 49.9% easy Tree
494 Target Sum Go 44.5% medium Depth-first Search, Dynamic Programming
461 Hamming Distance Go 78.5% easy Bit Manipulation
460 LFU Cache Go 43.1% hard Design
455 Assign Cookies Go 57.8% easy Greedy
452 Minimum Number of Arrows to Burst Balloons Go 51.1% medium Greedy, Sort
451 Sort Characters By Frequency Go 66.3% medium Heap, Hash Table
448 Find All Numbers Disappeared in an Array Go 61.2% easy Array
441 Arranging Coins Go 41.9% easy Math, Binary Search
438 Find All Anagrams in a String❤️ Go 48.6% medium Hash Table
437 Path Sum III❤️ Go 56.5% medium Tree
435 Non-overlapping Intervals Go 49.1% medium Greedy
416 Partition Equal Subset Sum❤️ Go 49.2% medium Dynamic Programming
406 Queue Reconstruction by Height Go 72.0% medium Greedy
404 Sum of Left Leaves Go 56.4% easy Tree
399 Evaluate Division Go 59.6% medium Union Find, Graph
395 Longest Substring with At Least K Repeating Characters❤️ Go 45.6% medium Recursion, Divide and Conquer, Sliding Window
394 Decode String❤️ Go 53.8% medium Stack, Depth-first Search
392 Is Subsequence Go 50.7% easy Greedy, Binary Search, Dynamic Programming
389 Find the Difference Go 69.5% easy Bit Manipulation, Hash Table
387 First Unique Character in a String Go 51.2% easy Hash Table, String
376 Wiggle Subsequence Go 45.1% medium Greedy, Dynamic Programming
349 Intersection of Two Arrays Go 73.5% easy Sort, Hash Table, Two Pointers, Binary Search
347 Top K Frequent Elements Go 61.8% medium Heap, Hash Table
345 Reverse Vowels of a String Go 51.2% easy Two Pointers, String
344 Reverse String Go 74.1% easy Two Pointers, String
338 Counting Bits Go 76.4% medium Bit Manipulation, Dynamic Programming
337 House Robber III Go 60.9% medium Tree, Depth-first Search
330 Patching Array Go 53.7% hard Greedy
328 Odd Even Linked List Go 65.6% medium Linked List
326 Power of Three Go 47.9% easy Math
322 Coin Change Go 42.3% medium Dynamic Programming
316 Remove Duplicate Letters Go 47.6% medium Stack, Greedy, String
309 Best Time to Buy and Sell Stock with Cooldown Go 57.4% medium Dynamic Programming
303 Range Sum Query - Immutable Go 64.4% easy Dynamic Programming
300 Longest Increasing Subsequence❤️ Go 46.6% medium Binary Search, Dynamic Programming
290 Word Pattern Go 45.8% easy Hash Table
287 Find the Duplicate Number Go 66.2% medium Array, Two Pointers, Binary Search
283 Move Zeroes Go 63.6% easy Array, Two Pointers
279 Perfect Squares Go 58.9% medium Breadth-first Search, Math, Dynamic Programming
278 First Bad Version Java 41.8% easy Binary Search
268 Missing Number Go 59.0% easy Bit Manipulation, Array, Math
242 Valid Anagram Go 63.4% easy Sort, Hash Table
241 Different Ways to Add Parentheses Go 72.9% medium Divide and Conquer
240 Search a 2D Matrix II Go 43.5% medium Binary Search, Divide and Conquer
239 Sliding Window Maximum Go 49.6% hard Heap, Sliding Window
238 Product of Array Except Self Go 71.3% medium Array
237 Delete Node in a Linked List Go 83.7% easy Linked List
236 Lowest Common Ancestor of a Binary Tree Go 66.1% medium Tree
234 Palindrome Linked List Go 45.3% easy Linked List, Two Pointers
232 Implement Queue using Stacks Go 65.8% easy Stack, Design
230 Kth Smallest Element in a BST Go 72.7% medium Tree, Binary Search
228 Summary Ranges Go 58.7% easy Array
226 Invert Binary Tree Go 77.8% easy Tree
225 Implement Stack using Queues Go 66.4% easy Stack, Design
221 Maximal Square Go 43.8% medium Dynamic Programming
218 The Skyline Problem❤️ Go 45.2% hard Heap, Binary Indexed Tree, Segment Tree, Divide and Conquer, Line Sweep
217 Contains Duplicate Go 55.0% easy Array, Hash Table
215 Kth Largest Element in an Array Go 64.6% medium Heap, Divide and Conquer
212 Word Search II Go 44.6% hard Trie, Backtracking
210 Course Schedule II Go 52.6% medium Depth-first Search, Breadth-first Search, Graph, Topological Sort
208 Implement Trie (Prefix Tree)❤️ Go 69.6% medium Design, Trie
207 Course Schedule Go 54.8% medium Depth-first Search, Breadth-first Search, Graph, Topological Sort
206 Reverse Linked List Go 71.2% easy Linked List
205 Isomorphic Strings Go 49.7% easy Hash Table
204 Count Primes Go 38.2% easy Hash Table, Math
200 Number of Islands Go 51.9% medium Depth-first Search, Breadth-first Search, Union Find
198 House Robber❤️ Go 47.3% easy Dynamic Programming
191 Number of 1 Bits Go 70.9% easy Bit Manipulation
190 Reverse Bits Go 63.2% easy Bit Manipulation
189 Rotate Array Go 45.4% medium Array
188 Best Time to Buy and Sell Stock IV Go 35.8% hard Dynamic Programming
172 Factorial Trailing Zeroes Go 41.3% easy Math
169 Majority Element Go 65.4% easy Bit Manipulation, Array, Divide and Conquer
167 Two Sum II - Input array is sorted Go 57.3% easy Array, Two Pointers, Binary Search
166 Fraction to Recurring Decimal Go 28.4% medium Hash Table, Math
160 Intersection of Two Linked Lists Go 57.3% easy Linked List
155 Min Stack Go 56.0% easy Stack, Design
153 Find Minimum in Rotated Sorted Array Go 52.2% medium Array, Binary Search
152 Maximum Product Subarray Go 40.9% medium Array, Dynamic Programming
149 Max Points on a Line❤️ Go 23.5% hard Hash Table, Math
148 Sort List Go 67.7% medium Sort, Linked List
146 LRU Cache❤️ Go 51.4% medium Design
145 Binary Tree Postorder Traversal Go 73.9% medium Stack, Tree
144 Binary Tree Preorder Traversal Go 68.9% medium Stack, Tree
142 Linked List Cycle II Go 54.2% medium Linked List, Two Pointers
141 Linked List Cycle Go 50.6% easy Linked List, Two Pointers
140 Word Break II Go 44.3% hard Dynamic Programming, Backtracking
139 Word Break❤️ Go 48.8% medium Dynamic Programming
136 Single Number Go 70.7% easy Bit Manipulation, Hash Table
135 Candy Go 48.2% hard Greedy
131 Palindrome Partitioning Go 70.1% medium Depth-first Search, Dynamic Programming, Backtracking
130 Surrounded Regions Go 42.3% medium Depth-first Search, Breadth-first Search, Union Find
127 Word Ladder Go 45.7% hard Breadth-first Search
125 Valid Palindrome Go 46.8% easy Two Pointers, String
123 Best Time to Buy and Sell Stock III Go 50.7% hard Array, Dynamic Programming
122 Best Time to Buy and Sell Stock II Go 66.1% easy Greedy, Array
121 Best Time to Buy and Sell Stock❤️ Go 55.6% easy Array, Dynamic Programming
118 Pascal’s Triangle Go 69.8% easy Array
114 Flatten Binary Tree to Linked List Go 71.7% medium Tree, Depth-first Search
112 Path Sum Go 51.6% easy Tree, Depth-first Search
111 Minimum Depth of Binary Tree Go 46.2% easy Tree, Depth-first Search, Breadth-first Search
110 Balanced Binary Tree Go 55.1% easy Tree, Depth-first Search, Recursion
105 Construct Binary Tree from Preorder and Inorder Traversal Go 68.8% medium Tree, Depth-first Search, Array
104 Maximum Depth of Binary Tree❤️ Go 75.6% easy Tree, Depth-first Search, Recursion
103 Binary Tree Zigzag Level Order Traversal Go 57.0% medium Stack, Tree, Breadth-first Search
102 Binary Tree Level Order Traversal Go 64.0% medium Tree, Breadth-first Search
101 Symmetric Tree❤️ Go 53.4% easy Tree, Depth-first Search, Breadth-first Search
98 Validate Binary Search Tree❤️ Go 33.3% medium Tree, Depth-first Search, Recursion
96 Unique Binary Search Trees❤️ Go 69.2% medium Tree, Dynamic Programming
95 Unique Binary Search Trees II Go 66.8% medium Tree, Dynamic Programming
94 Binary Tree Inorder Traversal Go 74.6% medium Stack, Tree, Hash Table
88 Merge Sorted Array Go 49.1% easy Array, Two Pointers
86 Partition List Go 62.3% medium Linked List, Two Pointers
85 Maximal Rectangle Go 51.6% hard Stack, Array, Hash Table, Dynamic Programming
83 Remove Duplicates from Sorted List Go 51.9% easy Linked List
79 Word Search❤️ Go 44.0% medium Array, Backtracking
78 Subsets Go 79.4% medium Bit Manipulation, Array, Backtracking
75 Sort Colors❤️ Go 57.2% medium Sort, Array, Two Pointers
70 Climbing Stairs❤️ Go 51.3% easy Dynamic Programming
69 Sqrt(x) Go 39.1% easy Math, Binary Search
64 Minimum Path Sum Go 68.0% medium Array, Dynamic Programming
62 Unique Paths Go 64.0% medium Array, Dynamic Programming
56 Merge Intervals Go 44.0% medium Sort, Array
55 Jump Game❤️ Go 41.6% medium Greedy, Array
53 Maximum Subarray❤️ Go 53.1% easy Array, Divide and Conquer, Dynamic Programming
49 Group Anagrams Go 65.3% medium Hash Table, String
48 Rotate Image Go 72.1% medium Array
46 Permutations❤️ Go 77.4% medium Backtracking
39 Combination Sum❤️ Go 71.9% medium Array, Backtracking
34 Find First and Last Position of Element in Sorted Array Go 42.1% medium Array, Binary Search
33 Search in Rotated Sorted Array Go 40.2% medium Array, Binary Search
31 Next Permutation❤️ Go 36.3% medium Array
22 Generate Parentheses Go 76.7% medium String, Backtracking
21 Merge Two Sorted Lists Go 65.1% easy Recursion, Linked List
20 Valid Parentheses❤️ Go 43.6% easy Stack, String
19 Remove Nth Node From End of List❤️ Go 40.7% medium Linked List, Two Pointers
17 Letter Combinations of a Phone Number❤️ Go 55.7% medium Depth-first Search, Recursion, String, Backtracking
15 3Sum❤️ Go 30.6% medium Array, Two Pointers
11 Container With Most Water❤️ Go 64.6% medium Array, Two Pointers
5 Longest Palindromic Substring❤️ Go, Rust 32.8% medium String, Dynamic Programming
3 Longest Substring Without Repeating Characters Go, Rust 36.2% medium Hash Table, Two Pointers, String, Sliding Window
2 Add Two Numbers Go, Rust 39.3% medium Recursion, Linked List, Math
1 Two Sum Go, Rust 49.8% easy Array, Hash Table