This repository contains a collection of Jupyter notebooks that provide solutions to various algorithmic problems. The problems are categorized based on their primary techniques or data structures used in the solutions.
Rui Hu - github.com/logreg-n-coffee
The problems were originally developed by LeetCode. These solutions are provided for educational purposes.
Feel free to explore each notebook for detailed explanations and implementations of the solutions. Also, please don't hesitate to submit an issue if you have any questions.
- Array and String
- Two Pointers
- Sliding Window
- Matrix
- Hashmap
- Intervals
- Stack
- Linked List
- Binary Tree - General
- Binary Tree - BFS
- Graph - General
- Graph - BFS
- Trie
- Backtracking
- Divide and Conquer
- Kadane's Algorithm
- Binary Search
- Heap
- Bit Manipulation
- Math
- 1D Dynamic Programming
- Multidimensional Dynamic Programming
- Merge Sorted Array
- Remove Element
- Remove Duplicates from Sorted Array
- Remove Duplicates from Sorted Array II
- Majority Element
- Rotate Array
- Best Time to Buy and Sell Stock
- Best Time to Buy and Sell Stock II
- Jump Game
- Jump Game II
- H-Index
- Insert Delete Get Random O(1)
- Product of Array Except Self
- Gas Station
- Candy
- Trapping Rain Water
- Roman to Integer
- Integer to Roman
- Length of Last Word
- Longest Common Prefix
- Reverse Words in a String
- Zigzag Conversion
- Find the Index of the First Occurrence in a String
- Text Justification
- Valid Palindrome
- Is Subsequence
- Container with Most Water
- Two Sum II - Input Array Is Sorted
- Three Sum
- Happy Number
- Longest Substring Without Repeating Characters
- Minimum Window Substring
- Substring with Concatenation of All Words
- Minimum Size Subarray Sum
- Ransom Note
- Isomorphic Strings
- Word Pattern
- Valid Anagram
- Group Anagrams
- Two Sum
- Contains Duplicate II
- Longest Consecutive Sequence
- Linked List Cycle
- Add Two Numbers
- Merge Two Sorted Lists
- Copy List with Random Pointer
- Reverse Linked List
- Reverse List in K Group
- Remove Nth Node from End of List
- Remove Duplicates from Sorted List II
- Rotate List
- Partition List
- LRU Cache
- Maximum Depth of Binary Tree
- Same Tree
- Invert Binary Tree
- Symmetric Tree
- Construct Binary Tree from Preorder and Inorder Traversal
- Construct Binary Tree from Inorder and Postorder Traversal
- Populating Next Right Pointers in Each Node II
- Flatten Binary Tree to Linked List
- Path Sum
- Sum Root to Leaf Numbers
- Binary Tree Maximum Path Sum
- Binary Search Tree Iterator
- Count Complete Tree Nodes
- Lowest Common Ancestor of a Binary Tree
- Binary Tree Right Side View
- Average of Levels in Binary Tree
- Binary Tree Level Order Traversal
- Binary Tree Zigzag Level Order Traversal
- Minimum Absolute Difference in BST
- Kth Smallest Element in BST
- Validate Binary Search Tree
- Number of Islands
- Surrounded Regions
- Clone Graph
- Evaluate Division
- Course Schedule
- Course Schedule II
- Letter Combination of a Phone Number
- Combinations
- Permutations
- Combination Sum
- N-Queens II
- Generate Parentheses
- Word Search
- Convert Sorted Array to Sorted Binary Search Tree
- Sort List
- Construct Quad Tree
- Merge K Sorted Lists