Algorithm Exercises
Algorithm exercises from LeetCode implemented in Java v11.
Solutions
String
-
Sorting Sentence Problem Solution -
Student Attendance Record I Problem Solution -
Reverse Words in a String III Problem Solution -
One Edit Distance Problem Solution -
Find And Replace in String Problem Solution
Array
-
Jewels and Stones Problem Solution -
Rings and Rods Problem Solution -
Concatenation of Array Problem Solution -
Find Target Indices After Sorting Array Problem Solution -
Running Sum of Array Problem Solution -
Parking System Problem Solution
Matrix
-
Max Increase to Keep City Skyline Problem Solution -
Cells with Odd Values in a Matrix Problem Solution -
Island Perimeter Problem Solution -
Valid Sudoku Problem Solution -
Where Will the Ball Fall Problem Solution -
Remove All Ones With Row and Column Flips Problem Solution
HashTable
-
Two Sum Problem Solution -
Destination City Problem Solution -
Number of Good Pairs Problem Solution -
Logger Rate Limiter Problem Solution -
Unique Number of Occurrences Problem Solution -
Snapshot Array Problem Solution
Stack
-
Min Stack Problem Solution -
Valid Parentheses Problem Solution -
Decode String Problem Solution -
Simplify Path Problem Solution -
Longest Absolute File Path Problem Solution -
Remove All Adjacent Duplicates In String Problem Solution -
Binary Tree Inorder Traversal Problem Solution -
Evaluate Reverse Polish Notation Problem Solution -
Basic Calculator Problem Solution
Queue
Heap
-
Top Kth Frequent Elements Problem Solution -
Kth Largest Elements Problem Solution -
Meeting Rooms II Problem Solution -
Find Median From Data Stream Problem Solution -
Stock Price Fluctuation Problem Solution -
Design Twitter Problem Solution -
Employee Free Time Problem Solution -
Process Tasks Using Servers Problem Solution
LinkedList
-
Lowest Common Ancestor Of Binary Tree III Problem Solution -
Browser History Problem Solution -
LRU Cache Problem Solution -
LFU Cache Problem Solution -
Add Two Numbers Problem Solution -
Insertion Sort List Problem Solution -
Insert into a Sorted Circular Linked List Problem Solution
Trie
Sorting
-
Meeting Rooms Problem Solution -
Merge Intervals Problem Solution -
Group Anagrams Problem Solution -
Minimum Time Difference Problem Solution
Binary Search
Two Pointers
-
First Unique Character Problem Solution -
Valid Palindrome Problem Solution -
Is Subsequence Problem -
Squares of a Sorted Array Problem -
Sort Array By Parity Problem Solution -
Minimize Maximum Pair Sum Problem Solution -
Merge Sorted Array Problem Solution -
Partition Labels Problem Solution -
Meeting Scheduler Problem Solution -
Expressive Words Problem Solution -
Longest Word in Dictionary through Deleting Problem Solution -
Swap Adjacent in LR String Problem Solution
Sliding Window
-
Minimum Size Subarray Sum Problem Solution -
Binary Subarrays With Sum Problem Solution -
Maximum Points You Can Obtain from Cards Problem Solution -
Longest Substring Without Repeating Characters Problem Solution -
Sliding Window Maximum Problem Solution
Prefix Sum
-
Product of the Last K Numbers Problem Solution -
Substrings That Begin and End With the Same Letter Problem Solution -
Subarray Sum Equals K Problem Solution
Recursion
-
Closest Binary Search Tree Value Problem -
Subtree Of Another Tree Problem Solution -
Climbing Stairs Problem Solution -
All Possible Full Binary Trees Problem Solution -
Different Ways to Add Parentheses Problem Solution
BFS
-
Binary Tree Level Inorder Traversal Problem Solution -
Binary Tree Zigzag Level Order Traversal Problem Solution -
Binary Tree Right Side View Problem Solution -
Shortest Path in Binary Matrix Problem Solution -
Shortest Path to Get Food Problem Solution -
Shortest Distance from All Buildings Problem Solution -
Find if Path Exists in Graph Problem Solution -
Path with Maximum Probability Problem Solution
DFS
-
Path Sum Problem -
Path Sum II Problem -
Find Leaves of Binary Tree Problem Solution -
Delete Leaves With a Given Value Problem Solution -
All Paths From Source to Target Problem Solution -
Count Univalue Subtrees Problem Solution -
Delete Nodes And Return Forest Problem Solution -
Maximum Product of Split Binary Tree Problem Solution -
Number of Islands Problem Solution -
Battleships in a Board Problem Solution
Backtracking
-
Combinations Problem Solution -
Permutations Problem Solution -
Letter Combinations of a Phone Number Problem Solution -
Combination Sum Problem Solution -
Generate Parentheses Problem Solution -
Word Search Problem Solution -
Word Search II Problem Solution -
Sudoku Solver Problem Solution -
Expression Add Operators Problem Solution
Topological Sort
-
Course Schedule Problem Solution -
Course Schedule II Problem Solution -
Find All Possible Recipes from Given Supplies Problem Solution
Bit Manipulation
-
Single Number Problem Solution -
Subsets Problem Solution -
Hamming Distance Problem Solution -
Counting Bits Problem Solution
Dynamic Programming
-
Best Sightseeing Pair Problem Solution -
Minimum Path Sum Problem Solution -
Minimum Falling Path Sum Problem Solution -
Maximum Number of Points with Cost Problem Solution -
Count Sorted Vowel Strings Problem Solution -
Count Square Submatrices with All Ones Problem Solution -
Partition Equal Subset Sum Problem Solution