Skip to content

adrien-perello/leetcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Content


By data structure

Bit, String and Integer

# Title Solution Difficulty Data Structure Paradigm & Implementation
0009 Palindrome Number Python Easy πŸ₯‰ Integer
0014 Longest Common Prefix Python Easy πŸ₯‰ String
0020 Valid Parentheses Python Easy πŸ₯‰ String, Stack
0067 Add Binary πŸ”’ Python Easy πŸ₯‰ Binary Number, String
0136 Single Number Python Easy πŸ₯‰ Hash Table Bit Manipulation
0190 Reverse Bits Python Easy πŸ₯‰ Binary Number Bit Manipulation
0204 Count Primes Python Easy πŸ₯‰
0070 Climbing Stairs Python Easy πŸ₯‰ Integer Recursion, Dynamic Programming
0268 Missing Number Python Easy πŸ₯‰ Array, Hash Table Sort, Bit Manipulation
0387 First Unique Character in a String Python Easy πŸ₯‰ String, Hash Table
0392 Is Subsequence πŸ”’ Python Easy πŸ₯‰ String Two Pointers, Greedy, Recursion, Dynamic Programming, Binary Search
0929 Unique Email Addresses Python Easy πŸ₯‰ String
1022 Sum of Root To Leaf Binary Numbers Python Easy πŸ₯‰ Tree Recursion, DFS, BFS, Bit Manipulation
1290 Convert Binary Number in a Linked List to Integer Python Easy πŸ₯‰ Linked Lists Recursion, Bit Manipulation
0003 Longest Substring Without Repeating Characters πŸ”’ Python Medium πŸ₯ˆ String, Hash Table Sliding Windows
0005 Longest Palindromic Substring Python Medium πŸ₯ˆ String Dynamic Programming
0022 Generate Parentheses Python Medium πŸ₯ˆ String Recursion, Dynamic Programming
0078 Subsets Python Medium πŸ₯ˆ Array Backtracking, Bit Manipulation
0338 Counting BitsπŸ”’ Python Medium πŸ₯ˆ Binary Number Bit Manipulation, Dynamic Programming

Back to content

Array

# Title Solution Difficulty Data Structure Paradigm & Implementation
0001 Two Sum Python Easy πŸ₯‰ Array, Hash Table
0035 Search Insert Position πŸ”’ Python Easy πŸ₯‰ Array Binary Search
0053 Maximum Subarray πŸ”’ Python Easy πŸ₯‰ Array Dynamic Programming, Divide and Conquer, Recursion
0118 Pascal's Triangle Python Easy πŸ₯‰ Array Recursion, Dynamic Programming
0121 Best Time to Buy and Sell Stock Python Easy πŸ₯‰ Array Dynamic Programming
0122 Best Time to Buy and Sell Stock II Python Easy πŸ₯‰ Array Greedy
0169 Majority Element Python Easy πŸ₯‰ Array, Hash Table Sort
0171 Excel Sheet Column Number πŸ”’ Python Easy πŸ₯‰ Array
0217 Contains Duplicate Python Easy πŸ₯‰ Array, Hash Table Sort
0242 Valid Anagram Python Easy πŸ₯‰ Array, Hash Table Sort
0268 Missing Number Python Easy πŸ₯‰ Array, Hash Table Sort, Bit Manipulation
0283 Move Zeroes Python Easy πŸ₯‰ Array Two Pointers
0344 Reverse String Python Easy πŸ₯‰ Array Two Pointers
0349 Intersection of Two Arrays Python Easy πŸ₯‰ Array, Hash Table Sort, Binary Search, Two Pointers
0350 Intersection of Two Arrays II πŸ”’ Python Easy πŸ₯‰ Array, Hash Table Sort, Two Pointers
0448 Find All Numbers Disappeared in an Array πŸ”’ Python Easy πŸ₯‰ Array, Hash Table
0463 Island Perimeter πŸ”’ Python Easy πŸ₯‰ Array
0704 Binary Search Python Easy πŸ₯‰ Array Binary Search, Recursion
0746 Min Cost Climbing Stairs Python Easy πŸ₯‰ Array Recursion, Dynamic Programming
1337 The K Weakest Rows in a Matrix πŸ”’ Python Easy πŸ₯‰ Array, Heap Binary Search
1351 Count Negative Numbers in a Sorted Matrix Python Easy πŸ₯‰ Array Binary Search
0046 Permutations πŸ”’ Python Medium πŸ₯ˆ Array Recursion, Backtracking
0048 Rotate Image Python Medium πŸ₯ˆ Array
0078 Subsets Python Medium πŸ₯ˆ Array Backtracking, Bit Manipulation
0189 Rotate Array Python Medium πŸ₯ˆ Array
0198 House Robber πŸ”’ Python Medium πŸ₯ˆ Array Recursion, Dynamic Programming
0238 Product of Array Except Self Python Medium πŸ₯ˆ Array Two Pointers
0322 Coin Change Python Medium πŸ₯ˆ Array, Hash Table Dynamic Programming, Recursion, Sort

Back to content

Stack and Queue

# Title Solution Difficulty Data Structure Paradigm & Implementation
0020 Valid Parentheses Python Easy πŸ₯‰ String, Stack
0155 Min Stack πŸ”’ Python Easy πŸ₯‰ Stack, Heaps
0232 Implement Queue using Stacks Python Easy πŸ₯‰ Stack, Queue

Back to content

Hash Table

# Title Solution Difficulty Data Structure Paradigm & Implementation
0001 Two Sum Python Easy πŸ₯‰ Array, Hash Table
0136 Single Number Python Easy πŸ₯‰ Hash Table Bit Manipulation
0141 Linked List Cycle Python Easy πŸ₯‰ Linked List, Hash Table Two Pointers
0160 Intersection of Two Linked Lists Python Easy πŸ₯‰ Linked List, Hash Table Two Pointers
0169 Majority Element Python Easy πŸ₯‰ Array, Hash Table Sort
0202 Happy Number πŸ”’ Python Easy πŸ₯‰ Hash Table
0217 Contains Duplicate Python Easy πŸ₯‰ Array, Hash Table Sort
0242 Valid Anagram Python Easy πŸ₯‰ Array, Hash Table Sort
0268 Missing Number Python Easy πŸ₯‰ Array, Hash Table Sort, Bit Manipulation
0349 Intersection of Two Arrays Python Easy πŸ₯‰ Array, Hash Table Sort, Binary Search, Two Pointers
0350 Intersection of Two Arrays II πŸ”’ Python Easy πŸ₯‰ Array, Hash Table Sort, Two Pointers
0387 First Unique Character in a String Python Easy πŸ₯‰ String, Hash Table
0448 Find All Numbers Disappeared in an Array πŸ”’ Python Easy πŸ₯‰ Array, Hash Table
0771 Jewels and Stones πŸ”’ Python Easy πŸ₯‰ Hash Table
0003 Longest Substring Without Repeating Characters πŸ”’ Python Medium πŸ₯ˆ String, Hash Table Sliding Windows
0236 Lowest Common Ancestor of a Binary Tree Python Medium πŸ₯ˆ Tree, Hash Table Recursion, DFS
0322 Coin Change Python Medium πŸ₯ˆ Array, Hash Table Dynamic Programming, Recursion, Sort
0347 Top K Frequent Elements Python Medium πŸ₯ˆ Heaps, Hash Table Sort

Back to content

Linked list

# Title Solution Difficulty Data Structure Paradigm & Implementation
0021 Merge Two Sorted Lists πŸ”’ Python Easy πŸ₯‰ Linked list Recursion, Two Pointers
0083 Remove Duplicates from Sorted List Python Easy πŸ₯‰ Linked List Two Pointers
0141 Linked List Cycle Python Easy πŸ₯‰ Linked List, Hash Table Two Pointers
0160 Intersection of Two Linked Lists Python Easy πŸ₯‰ Linked List, Hash Table Two Pointers
0206 Reverse Linked List Python Easy πŸ₯‰ Linked List Recursion, Two Pointers
0234 Palindrome Linked List πŸ”’ Python Easy πŸ₯‰ Linked List Two Pointers
0876 Middle of the Linked List Python Easy πŸ₯‰ Linked Lists Two Pointers
1290 Convert Binary Number in a Linked List to Integer Python Easy πŸ₯‰ Linked Lists Recursion, Bit Manipulation
0002 Add Two Numbers Python Medium πŸ₯ˆ Linked Lists Recursion, Two Pointers

Back to content

Heap

# Title Solution Difficulty Data Structure Paradigm & Implementation
0155 Min Stack πŸ”’ Python Easy πŸ₯‰ Stack, Heaps
0703 Kth Largest Element in a Stream Python Easy πŸ₯‰ Heap
1337 The K Weakest Rows in a Matrix πŸ”’ Python Easy πŸ₯‰ Array, Heap Binary Search
0347 Top K Frequent Elements Python Medium πŸ₯ˆ Heaps, Hash Table Sort

Back to content

Tree

# Title Solution Difficulty Data Structure Paradigm & Implementation
0100 Same Tree Python Easy πŸ₯‰ Tree Recursion, DFS
0101 Symmetric Tree Python Easy πŸ₯‰ Tree Recursion
0104 Maximum Depth of Binary Tree πŸ”’ Python Easy πŸ₯‰ Tree Recursion, DFS, BFS
0108 Convert Sorted Array to Binary Search Tree πŸ”’ Python Easy πŸ₯‰ Tree Recursion
0110 Balanced Binary Tree πŸ”’ Python Easy πŸ₯‰ Tree Recursion, DFS, BFS
0111 Minimum Depth of Binary Tree πŸ”’ Python Easy πŸ₯‰ Tree Recursion, DFS, BFS
0112 Path Sum ο€— πŸ”’ Python Easy πŸ₯‰ Tree Recursion, DFS, BFS
0226 Invert Binary Tree Python Easy πŸ₯‰ Tree Recursion
0235 Lowest Common Ancestor of a Binary Search Tree Python Easy πŸ₯‰ Tree Recursion
0257 Binary Tree Paths πŸ”’ Python Easy πŸ₯‰ Tree Recursion, DFS, BFS
0543 Diameter of Binary Tree Python Easy πŸ₯‰ Tree Recursion, DFS, BFS
0559 Maximum Depth of N-ary Tree πŸ”’ Python Easy πŸ₯‰ Tree Recursion, DFS, BFS
0572 Subtree of Another Tree Python Easy πŸ₯‰ Tree, String Recursion
0589 N-ary Tree Preorder Traversal πŸ”’ Python Easy πŸ₯‰ Tree Recursion, DFS
0590 N-ary Tree Postorder Traversal πŸ”’ Python Easy πŸ₯‰ Tree Recursion, DFS
0617 Merge Two Binary Trees Python Easy πŸ₯‰ Tree Recursion, DFS
0669 Trim a Binary Search Tree Python Easy πŸ₯‰ Tree Recursion, DFS
0700 Search in a Binary Search Tree πŸ”’ Python Easy πŸ₯‰ Tree Recursion, DFS
0897 Increasing Order Search Tree Python Easy πŸ₯‰ Tree Recursion, DFS
0938 Range Sum of BST πŸ”’ Python Easy πŸ₯‰ Tree Recursion, DFS, BFS
0965 Univalued Binary Tree Python Easy πŸ₯‰ Tree Recursion, DFS, BFS
1022 Sum of Root To Leaf Binary Numbers Python Easy πŸ₯‰ Tree Recursion, DFS, BFS, Bit Manipulation
0094 Binary Tree Inorder Traversal Python Medium πŸ₯ˆ Tree Recursion
0230 Kth Smallest Element in a BST Python Medium πŸ₯ˆ Tree Recursion
0236 Lowest Common Ancestor of a Binary Tree Python Medium πŸ₯ˆ Tree, Hash Table Recursion, DFS

Back to content


By implementation

Search

# Title Solution Difficulty Data Structure Paradigm & Implementation
0035 Search Insert Position πŸ”’ Python Easy πŸ₯‰ Array Binary Search
0100 Same Tree Python Easy πŸ₯‰ Tree Recursion, DFS
0104 Maximum Depth of Binary Tree πŸ”’ Python Easy πŸ₯‰ Tree Recursion, DFS, BFS
0110 Balanced Binary Tree πŸ”’ Python Easy πŸ₯‰ Tree Recursion, DFS, BFS
0111 Minimum Depth of Binary Tree πŸ”’ Python Easy πŸ₯‰ Tree Recursion, DFS, BFS
0112 Path Sum ο€— πŸ”’ Python Easy πŸ₯‰ Tree Recursion, DFS, BFS
0257 Binary Tree Paths πŸ”’ Python Easy πŸ₯‰ Tree Recursion, DFS, BFS
0349 Intersection of Two Arrays Python Easy πŸ₯‰ Array, Hash Table Sort, Binary Search, Two Pointers
0392 Is Subsequence πŸ”’ Python Easy πŸ₯‰ String Two Pointers, Greedy, Recursion, Dynamic Programming, Binary Search
0543 Diameter of Binary Tree Python Easy πŸ₯‰ Tree Recursion, DFS, BFS
0559 Maximum Depth of N-ary Tree πŸ”’ Python Easy πŸ₯‰ Tree Recursion, DFS, BFS
0589 N-ary Tree Preorder Traversal πŸ”’ Python Easy πŸ₯‰ Tree Recursion, DFS
0590 N-ary Tree Postorder Traversal πŸ”’ Python Easy πŸ₯‰ Tree Recursion, DFS
0617 Merge Two Binary Trees Python Easy πŸ₯‰ Tree Recursion, DFS
0669 Trim a Binary Search Tree Python Easy πŸ₯‰ Tree Recursion, DFS
0700 Search in a Binary Search Tree πŸ”’ Python Easy πŸ₯‰ Tree Recursion, DFS
0704 Binary Search Python Easy πŸ₯‰ Array Binary Search, Recursion
0897 Increasing Order Search Tree Python Easy πŸ₯‰ Tree Recursion, DFS
0938 Range Sum of BST πŸ”’ Python Easy πŸ₯‰ Tree Recursion, DFS, BFS
0965 Univalued Binary Tree Python Easy πŸ₯‰ Tree Recursion, DFS, BFS
1022 Sum of Root To Leaf Binary Numbers Python Easy πŸ₯‰ Tree Recursion, DFS, BFS, Bit Manipulation
1337 The K Weakest Rows in a Matrix πŸ”’ Python Easy πŸ₯‰ Array, Heap Binary Search
1351 Count Negative Numbers in a Sorted Matrix Python Easy πŸ₯‰ Array Binary Search

Back to content

Sort

# Title Solution Difficulty Data Structure Paradigm & Implementation
0169 Majority Element Python Easy πŸ₯‰ Array, Hash Table Sort
0217 Contains Duplicate Python Easy πŸ₯‰ Array, Hash Table Sort
0242 Valid Anagram Python Easy πŸ₯‰ Array, Hash Table Sort
0268 Missing Number Python Easy πŸ₯‰ Array, Hash Table Sort, Bit Manipulation
0349 Intersection of Two Arrays Python Easy πŸ₯‰ Array, Hash Table Sort, Binary Search, Two Pointers
0350 Intersection of Two Arrays II πŸ”’ Python Easy πŸ₯‰ Array, Hash Table Sort, Two Pointers
0322 Coin Change Python Medium πŸ₯ˆ Array, Hash Table Dynamic Programming, Recursion, Sort
0347 Top K Frequent Elements Python Medium πŸ₯ˆ Heaps, Hash Table Sort

Back to content

Greedy

# Title Solution Difficulty Data Structure Paradigm & Implementation
0122 Best Time to Buy and Sell Stock II Python Easy πŸ₯‰ Array Greedy
0392 Is Subsequence πŸ”’ Python Easy πŸ₯‰ String Two Pointers, Greedy, Recursion, Dynamic Programming, Binary Search

Back to content

Divide and Conquer

# Title Solution Difficulty Data Structure Paradigm & Implementation
0053 Maximum Subarray πŸ”’ Python Easy πŸ₯‰ Array Dynamic Programming, Divide and Conquer, Recursion

Back to content

Recursion

# Title Solution Difficulty Data Structure Paradigm & Implementation
0021 Merge Two Sorted Lists πŸ”’ Python Easy πŸ₯‰ Linked list Recursion, Two Pointers
0053 Maximum Subarray πŸ”’ Python Easy πŸ₯‰ Array Dynamic Programming, Divide and Conquer, Recursion
0070 Climbing Stairs Python Easy πŸ₯‰ Recursion, Dynamic Programming
0100 Same Tree Python Easy πŸ₯‰ Tree Recursion, DFS
0101 Symmetric Tree Python Easy πŸ₯‰ Tree Recursion
0104 Maximum Depth of Binary Tree πŸ”’ Python Easy πŸ₯‰ Tree Recursion, DFS, BFS
0108 Convert Sorted Array to Binary Search Tree πŸ”’ Python Easy πŸ₯‰ Tree Recursion
0110 Balanced Binary Tree πŸ”’ Python Easy πŸ₯‰ Tree Recursion, DFS, BFS
0111 Minimum Depth of Binary Tree πŸ”’ Python Easy πŸ₯‰ Tree Recursion, DFS, BFS
0112 Path Sum ο€— πŸ”’ Python Easy πŸ₯‰ Tree Recursion, DFS, BFS
0118 Pascal's Triangle Python Easy πŸ₯‰ Array Recursion, Dynamic Programming
0206 Reverse Linked List Python Easy πŸ₯‰ Linked List Recursion, Two Pointers
0226 Invert Binary Tree Python Easy πŸ₯‰ Tree Recursion
0235 Lowest Common Ancestor of a Binary Search Tree Python Easy πŸ₯‰ Tree Recursion
0257 Binary Tree Paths πŸ”’ Python Easy πŸ₯‰ Tree Recursion, DFS, BFS
0392 Is Subsequence πŸ”’ Python Easy πŸ₯‰ String Two Pointers, Greedy, Recursion, Dynamic Programming, Binary Search
0543 Diameter of Binary Tree Python Easy πŸ₯‰ Tree Recursion, DFS, BFS
0559 Maximum Depth of N-ary Tree πŸ”’ Python Easy πŸ₯‰ Tree Recursion, DFS, BFS
0572 Subtree of Another Tree Python Easy πŸ₯‰ Tree, String Recursion
0589 N-ary Tree Preorder Traversal πŸ”’ Python Easy πŸ₯‰ Tree Recursion, DFS
0590 N-ary Tree Postorder Traversal πŸ”’ Python Easy πŸ₯‰ Tree Recursion, DFS
0617 Merge Two Binary Trees Python Easy πŸ₯‰ Tree Recursion, DFS
0669 Trim a Binary Search Tree Python Easy πŸ₯‰ Tree Recursion, DFS
0700 Search in a Binary Search Tree πŸ”’ Python Easy πŸ₯‰ Tree Recursion, DFS
0704 Binary Search Python Easy πŸ₯‰ Array Binary Search, Recursion
0746 Min Cost Climbing Stairs Python Easy πŸ₯‰ Array Recursion, Dynamic Programming
0897 Increasing Order Search Tree Python Easy πŸ₯‰ Tree Recursion, DFS
0938 Range Sum of BST πŸ”’ Python Easy πŸ₯‰ Tree Recursion, DFS, BFS
0965 Univalued Binary Tree Python Easy πŸ₯‰ Tree Recursion, DFS, BFS
1022 Sum of Root To Leaf Binary Numbers Python Easy πŸ₯‰ Tree Recursion, DFS, BFS, Bit Manipulation
1290 Convert Binary Number in a Linked List to Integer Python Easy πŸ₯‰ Linked Lists Recursion, Bit Manipulation
0002 Add Two Numbers Python Medium πŸ₯ˆ Linked Lists Recursion, Two Pointers
0022 Generate Parentheses Python Medium πŸ₯ˆ String Recursion, Backtracking, Dynamic Programming
0046 Permutations πŸ”’ Python Medium πŸ₯ˆ Array Recursion, Backtracking
0094 Binary Tree Inorder Traversal Python Medium πŸ₯ˆ Tree Recursion
0198 House Robber πŸ”’ Python Medium πŸ₯ˆ Array Recursion, Dynamic Programming
0230 Kth Smallest Element in a BST Python Medium πŸ₯ˆ Tree Recursion
0236 Lowest Common Ancestor of a Binary Tree Python Medium πŸ₯ˆ Tree, Hash Table Recursion, DFS
0322 Coin Change Python Medium πŸ₯ˆ Array, Hash Table Dynamic Programming, Recursion, Sort

Back to content

Dynamic Programming

# Title Solution Difficulty Data Structure Paradigm & Implementation
0053 Maximum Subarray πŸ”’ Python Easy πŸ₯‰ Array Dynamic Programming, Divide and Conquer, Recursion
0070 Climbing Stairs Python Easy πŸ₯‰ Integer Recursion, Dynamic Programming
0118 Pascal's Triangle Python Easy πŸ₯‰ Array Recursion, Dynamic Programming
0121 Best Time to Buy and Sell Stock Python Easy πŸ₯‰ Array Dynamic Programming
0392 Is Subsequence πŸ”’ Python Easy πŸ₯‰ String Two Pointers, Greedy, Recursion, Dynamic Programming, Binary Search
0746 Min Cost Climbing Stairs Python Easy πŸ₯‰ Array Recursion, Dynamic Programming
0005 Longest Palindromic Substring Python Medium πŸ₯ˆ String Dynamic Programming
0022 Generate Parentheses Python Medium πŸ₯ˆ String Recursion, Dynamic Programming
0198 House Robber πŸ”’ Python Medium πŸ₯ˆ Array Recursion, Dynamic Programming
0322 Coin Change Python Medium πŸ₯ˆ Array, Hash Table Dynamic Programming, Recursion, Sort
0338 Counting Bits πŸ”’ Python Medium πŸ₯ˆ Binary Number Bit Manipulation, Dynamic Programming

Back to content

Backtracking

# Title Solution Difficulty Data Structure Paradigm & Implementation
0022 Generate Parentheses Python Medium πŸ₯ˆ String Recursion, Backtracking, Dynamic Programming
0046 Permutations πŸ”’ Python Medium πŸ₯ˆ Array Recursion, Backtracking
0078 Subsets Python Medium πŸ₯ˆ Array Backtracking, Bit Manipulation

Back to content

Two Pointers and Sliding Windows

# Title Solution Difficulty Data Structure Paradigm & Implementation
0021 Merge Two Sorted Lists πŸ”’ Python Easy πŸ₯‰ Linked list Recursion, Two Pointers
0083 Remove Duplicates from Sorted List Python Easy πŸ₯‰ Linked List Two Pointers
0141 Linked List Cycle Python Easy πŸ₯‰ Linked List, Hash Table Two Pointers
0160 Intersection of Two Linked Lists Python Easy πŸ₯‰ Linked List, Hash Table Two Pointers
0206 Reverse Linked List Python Easy πŸ₯‰ Linked List Recursion, Two Pointers
0234 Palindrome Linked List πŸ”’ Python Easy πŸ₯‰ Linked List Two Pointers
0283 Move Zeroes Python Easy πŸ₯‰ Array Two Pointers
0344 Reverse String Python Easy πŸ₯‰ Array Two Pointers
0349 Intersection of Two Arrays Python Easy πŸ₯‰ Array, Hash Table Sort, Binary Search, Two Pointers
0350 Intersection of Two Arrays II πŸ”’ Python Easy πŸ₯‰ Array, Hash Table Sort, Two Pointers
0392 Is Subsequence πŸ”’ Python Easy πŸ₯‰ String Two Pointers, Greedy, Recursion, Dynamic Programming, Binary Search
0876 Middle of the Linked List Python Easy πŸ₯‰ Linked Lists Two Pointers
0002 Add Two Numbers Python Medium πŸ₯ˆ Linked Lists Recursion, Two Pointers
0003 Longest Substring Without Repeating Characters πŸ”’ Python Medium πŸ₯ˆ String, Hash Table Sliding Windows
0238 Product of Array Except Self Python Medium πŸ₯ˆ Array Two Pointers

Back to content

About

Solutions to the most famous leetcode problems

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published