/leetcode

Primary LanguagePython

LeetCode

LeetCode explore

Array

ref: https://leetcode.com/explore/learn/card/fun-with-arrays/

# Title Solution Difficulty
26 Remove Duplicates from Sorted Array Python 3 Easy
27 Remove Element Python 3 Easy
88 Merge Sorted Array Python 3 Easy
283 Move Zeroes Python 3 Easy
414 Third Maximum Number Python 3 Easy
448 Find All Numbers Disappeared in an Array Python 3 Easy
485 Max Consecutive Ones Python 3 Easy
905 Sort Array By Parity Python 3 Easy
941 Valid Mountain Array Python 3 Easy
977 Squares of a Sorted Array Python 3 Easy
1089 Duplicate Zeros Python 3 Easy
1051 Height Checker Python 3 Easy
1295 Find Numbers with Even Number of Digits Python 3 Easy
1299 Replace Elements with Greatest Element on Right Side Python 3 Easy
1346 Check If N and Its Double Exist Python 3 Easy

Array and string

ref: https://leetcode.com/explore/learn/card/array-and-string/

# Title Solution Difficulty
14 Longest Common Prefix Python 3 Easy
28 Implement strStr() Python 3 Easy
54 Spiral Matrix Python 3 Medium
67 Add Binary Python 3 Easy
66 Plus One Python 3 Easy
118 Pascal's Triangle Python 3 Easy
151 Reverse Words in a String Python 3 Medium
167 Two Sum II - Input array is sorted Python 3 Easy
189 Rotate Array Python 3 Medium
209 Minimum Size Subarray Sum Python 3 Medium
498 Diagonal Traverse Python 3 Medium
557 Reverse Words in a String III Python 3 Easy
724 Find Pivot Index Python 3 Easy
747 Largest Number At Least Twice of Others Python 3 Easy

Linked List

ref: https://leetcode.com/explore/learn/card/linked-list/

# Title Solution Difficulty
2 Add Two Numbers Python 3 Medium
19 Remove Nth Node From End of List Python 3 Medium
21 Merge Two Sorted Lists Python 3 Easy
61 Rotate List Python 3 Medium
138 Copy List with Random Pointer Python 3 Medium
141 Linked List Cycle Python 3 Easy
142 Linked List Cycle II Python 3 Medium
160 Intersection of Two Linked Lists Python 3 Easy
203 Remove Linked List Elements Python 3 Easy
206 Reverse Linked List Python 3 Easy
234 Palindrome Linked List Python 3 Easy
328 Odd Even Linked List Python 3 Medium
430 Flatten a Multilevel Doubly Linked List Python 3 Medium
707 Design Linked List Python 3 Medium

Binary Tree

ref: https://leetcode.com/explore/learn/card/data-structure-tree/

# Title Solution Difficulty
94 Binary Tree Inorder Traversal Python 3 Easy
101 Symmetric Tree Python 3 Easy
102 Binary Tree Level Order Traversal Python 3 Medium
104 Maximum Depth of Binary Tree Python 3 Easy
105 Construct Binary Tree from Preorder and Inorder Traversal Python 3 Medium
106 Construct Binary Tree from Inorder and Postorder Traversal Python 3 Medium
112 Path Sum Python 3 Easy
116 Populating Next Right Pointers in Each Node Python 3 Medium
117 Populating Next Right Pointers in Each Node II Python 3 Medium
144 Binary Tree Preorder Traversal Python 3 Easy
145 Binary Tree Postorder Traversal Python 3 Easy
236 Lowest Common Ancestor of a Binary Tree Python 3 Medium
297 Serialize and Deserialize Binary Tree Python 3 Hard

N-ary Tree

ref: https://leetcode.com/explore/learn/card/n-ary-tree/

# Title Solution Difficulty
429 N-ary Tree Level Order Traversal Python 3 Medium
559 Maximum Depth of N-ary Tree Python 3 Easy
589 N-ary Tree Preorder Traversal Python 3 Easy
590 N-ary Tree Postorder Traversal Python 3 Easy

Binary Search Tree

ref: https://leetcode.com/explore/learn/card/introduction-to-data-structure-binary-search-tree/

# Title Solution Difficulty
98 Validate Binary Search Tree Python 3 Medium
108 Convert Sorted Array to Binary Search Tree Python 3 Easy
110 Balanced Binary Tree Python 3 Easy
173 Binary Search Tree Iterator Python 3 Medium
220 Contains Duplicate III Python 3 Medium
235 Lowest Common Ancestor of a Binary Search Tree Python 3 Easy
450 Delete Node in a BST Python 3 Medium
701 Insert into a Binary Search Tree Python 3 Medium
703 Kth Largest Element in a Stream Python 3 Easy

Recursion I

ref: https://leetcode.com/explore/learn/card/recursion-i/

# Title Solution Difficulty
21 Merge Two Sorted Lists Python 3 Easy
24 Swap Nodes in Pairs Python 3 Medium
50 Pow(x, n) Python 3 Medium
70 Climbing Stairs Python 3 Easy
95 Unique Binary Search Trees II Python 3 Medium
119 Pascal's Triangle II Python 3 Easy
206 Reverse Linked List Python 3 Easy
344 Reverse String Python 3 Easy
509 Fibonacci Number Python 3 Easy
700 Search in a Binary Search Tree Python 3 Easy
779 K-th Symbol in Grammar Python 3 Medium

Recursion II

ref: https://leetcode.com/explore/learn/card/recursion-ii

# Title Solution Difficulty
17 Letter Combinations of a Phone Number Python 3 Medium
22 Generate Parentheses Python 3 Medium
37 Sudoku Solver Python 3 Hard
46 Permutations Python 3 Medium
52 N-Queens II Python 3 Hard
77 Combinations Python 3 Medium
84 Largest Rectangle in Histogram Python 3 Hard
98 Validate Binary Search Tree Python 3 Medium
240 Search a 2D Matrix II Python 3 Medium
912 Sort an Array Python 3 Medium

Hash Table

ref: https://leetcode.com/explore/learn/card/hash-table

# Title Solution Difficulty
1 Two Sum Python 3 Easy
3 Longest Substring Without Repeating Characters Python 3 Medium
36 Valid Sudoku Python 3 Medium
49 Group Anagrams Python 3 Medium
136 Single Number Python 3 Easy
202 Happy Number Python 3 Easy
205 Isomorphic Strings Python 3 Easy
217 Contains Duplicate Python 3 Easy
219 Contains Duplicate II Python 3 Easy
347 Top K Frequent Elements Python 3 Medium
349 Intersection of Two Arrays Python 3 Easy
350 Intersection of Two Arrays II Python 3 Easy
380 Insert Delete GetRandom O(1) Python 3 Medium
387 First Unique Character in a String Python 3 Easy
454 4Sum II Python 3 Medium
599 Minimum Index Sum of Two Lists Python 3 Easy
652 Find Duplicate Subtrees Python 3 Medium
705 Design HashSet Python 3 Easy
706 Design HashMap Python 3 Easy
771 Jewels and Stones Python 3 Easy

Queue & Stack

ref: https://leetcode.com/explore/learn/card/queue-stack

# Title Solution Difficulty
20 Valid Parentheses Python 3 Easy
133 Clone Graph Python 3 Medium
150 Evaluate Reverse Polish Notation Python 3 Medium
155 Min Stack Python 3 Medium
200 Number of Islands Python 3 Medium
225 Implement Stack using Queues Python 3 Easy
232 Implement Queue using Stacks Python 3 Easy
279 Perfect Squares Python 3 Medium
394 Decode String Python 3 Medium
494 Target Sum Python 3 Medium
542 01 Matrix Python 3 Medium
622 Design Circular Queue Python 3 Medium
733 Flood Fill Python 3 Easy
739 Daily Temperatures Python 3 Medium
752 Open the Lock Python 3 Medium
841 Keys and Rooms Python 3 Medium

Trie

ref: https://leetcode.com/explore/learn/card/trie/

# Title Solution Difficulty
208 Implement Trie (Prefix Tree) Python 3 Medium
211 Design Add and Search Words Data Structure Python 3 Medium
212 Word Search II Python 3 Hard
336 Palindrome Pairs Python 3 Hard
421 Maximum XOR of Two Numbers in an Array Python 3 Medium
648 Replace Words Python 3 Medium
677 Map Sum Pairs) Python 3 Medium

Leetcode topic

ref: https://leetcode.com/study-plan/algorithm/

Binary Search

# Title Solution Difficulty
33 Search in Rotated Sorted Array Python 3 Medium
34 Find First and Last Position of Element in Sorted Array Python 3 Medium
35 Search Insert Position Python 3 Easy
74 Search a 2D Matrix Python 3 Medium
153 Find Minimum in Rotated Sorted Array Python 3 Medium
162 Find Peak Element Python 3 Medium
278 First Bad Version Python 3 Easy
704 Binary Search Python 3 Easy

Two Pointers

# Title Solution Difficulty
15 3Sum Python 3 Medium
844 Backspace String Compare Python 3 Easy
876 Middle of the Linked List Python 3 Easy

Sliding Window

# Title Solution Difficulty
438 Find All Anagrams in a String Python 3 Medium
567 Permutation in String Python 3 Medium
713 Subarray Product Less Than K Python 3 Medium

Breadth-First Search / Depth-First Search

# Title Solution Difficulty
130 Surrounded Regions Python 3 Medium
547 Number of Provinces Python 3 Medium
572 Subtree of Another Tree Python 3 Easy
617 Merge Two Binary Trees Python 3 Easy
695 Max Area of Island Python 3 Medium
797 All Paths From Source to Target Python 3 Medium
994 Rotting Oranges Python 3 Medium
1091 Shortest Path in Binary Matrix Python 3 Medium

Recursion / Backtracking

# Title Solution Difficulty
39 Combination Sum Python 3 Medium
40 Combination Sum II Python 3 Medium
47 Permutations II Python 3 Medium
78 Subsets Python 3 Medium
79 Word Search Python 3 Medium
90 Subsets II Python 3 Medium
784 Letter Case Permutation Python 3 Medium

Dynamic Programming

# Title Solution Difficulty
5 Longest Palindromic Substring Python 3 Medium
45 Jump Game II Python 3 Medium
55 Jump Game Python 3 Medium
62 Unique Paths Python 3 Medium
91 Decode Ways Python 3 Medium
139 Word Break Python 3 Medium
198 House Robber Python 3 Medium
213 House Robber II Python 3 Medium
300 Longest Increasing Subsequence Python 3 Medium
413 Arithmetic Slices Python 3 Medium

Others

Sliding Window

# Title Solution Difficulty
1509 Minimum Difference Between Largest and Smallest Value in Three Moves Python 3 Medium
1525 Number of Good Ways to Split a String Python 3 Medium