DEV Community

Cover image for Leetcode Solutions Index

Leetcode Solutions Index

seanpgallivan profile image seanpgallivan ・Updated on ・9 min read

This is the master index for my series of Leetcode solution explanations. If you like these solutions or found them useful, please like this post.

Hard Problem Solutions:

32 Longest Valid Parentheses Stack
329 Longest Increasing Path in a Matrix Recursion, DFS, Memoization
354 Russian Doll Envelopes LIS, Binary Search, DP
630 Course Schedule III Priority Queue, Heap
745 Prefix and Suffix Search Trie
895 Maximum Frequency Stack Frequency Map, Stack
906 Super Palindromes Math, Palindromes
936 Stamping The Sequence Character Mask
987 Vertical Order Traversal of a Binary Tree Tree, DFS, Recursion, Bit Manipulation
1074 Number of Submatrices That Sum to Target Matrix, Map
1192 Critical Connections in a Network Tarjan's
1354 Construct Target Array With Multiple Sums PriorityQueue, Heap
1713 Minimum Operations to Make a Subsequence LCS, LIS, Binary Search
1735 Count Ways to Make Array With Product Math
1739 Building Boxes Math

Medium Problem Solutions:

11 Container With Most Water Sliding Window
12 Integer to Roman Math
17 Letter Combinations of a Phone Number DFS, Recursion
19 Remove Nth Node From End of List Linked List
29 Divide Two Integers (ver. 1) Bit Manipulation
29 Divide Two Integers (ver. 2) Math
31 Next Permutation Array, Math
34 Find First and Last Position of Element in Sorted Array Binary Search
45 Jump Game II Array
48 Rotate Image Matrix
63 Unique Paths II Matrix, DP
71 Simplify Path Stack, Sliding Window
86 Partition List Linked List
109 Convert Sorted List to Binary Search Tree Tree, Linked List, In-Order, Recursion, Floyd's
114 Flatten Binary Tree to Linked List Binary Tree, Pre-Order, Recursion
120 Triangle DP
138 Copy List with Random Pointer Linked List
199 Binary Tree Right Side View Tree, BFS, DFS, Recursion
240 Search a 2D Matrix II Matrix, Binary Search
284 Peeking Iterator Class
304 Range Sum Query 2D - Immutable Matrix, DP, Prefix Sum
322 Coin Change DFS, Recursion
341 Flatten Nested List Iterator Class, Queue, Recursion
376 Wiggle Subsequence Subsequence
377 Combination Sum IV DP
413 Arithmetic Slices Math
417 Pacific Atlantic Water Flow DFS, Recursion, DP
423 Reconstruct Original Digits from English Frequency Map
474 Ones and Zeros DP
478 Generate Random Point in a Circle Math
524 Longest Word in Dictionary through Deleting String
535 Encode and Decode TinyURL Map
538 Convert BST to Greater Tree Tree, Inorder
554 Brick Wall Frequency Map
581 Shortest Unsorted Continuous Subarray Array
583 Delete Operation for Two Strings LCS, DP
622 Design Circular Queue Linked List
623 Add One Row to Tree Binary Tree, DFS, Recursion
647 Palindromic Substrings Math
665 Non-decreasing Array Array
667 Beautiful Arrangement II Math
669 Trim a Binary Tree Tree, Recursion
714 Best Time to Buy and Sell Stock with Transaction Fee State Machine
775 Global and Local Inversions Math
784 Letter Case Permutation Recursion, DFS
785 Is Graph Bipartite? BFS, Bit Manipulation
816 Ambiguous Coordinates String
820 Short Encoding of Words (ver. 1) Set
820 Short Encoding of Words (ver. 2) Trie
823 Binary Trees With Factors Binary Tree, Map, Math
841 Keys and Rooms DFS
856 Score of Parentheses Binary, Math
869 Reordered Power of 2 Math
870 Advantage Shuffle Array
916 Word Subsets Frequency Map
923 3Sum With Multiplicity Frequency Map, Combinatorics
946 Validate Stack Sequences Stack, 2-Pointer
966 Vowel Spellchecker Map, Set, Masking
970 Powerful Integers Set
971 Flip Binary Tree To Match Preorder Traversal Binary Tree, DFS, Recursion
991 Broken Calculator Math
1091 Shortest Path in Binary Matrix BFS, Matrix, Bit Manipulation
1209 Remove All Adjacent Duplicates in String II Recursion, Stack
1249 Minimum Remove to Make Valid Parentheses Stack
1302 Deepest Leaves Sum BFS, Queue, DFS, Recursion
1329 Sort the Matrix Diagonally Matrix
1396 Design Underground System Class, Map
1423 Maximum Points You Can Obtain from Cards Sliding Window
1461 Check If a String Contains All Binary Codes of Size K Binary, Bit Manipulation
1551 Minimum Operations to Make Array Equal Math
1631 Path With Minimum Effort BFS, Dijkstra's, Heap
1642 Furthest Building You Can Reach Heap
1663 Smallest String With A Given Numeric Value Math
1673 Find the Most Competitive Subsequence Stack
1675 Minimize Deviation in Array Heap
1680 Concatenation of Consecutive Binary Numbers Binary, Bit Manipulation
1717 Maximum Score From Removing Substrings (ver. 1) DP, Stack
1717 Maximum Score From Removing Substrings (ver. 2) String
1721 Swapping Nodes in a Linked List Linked List
1734 Decode XORed Permutation Bitwise XOR, Math
1737 Change Minimum Characters to Satisfy One of Three Conditions Frequency Map, Math
1738 Find Kth Largest XOR Coordinate Value Bitwise XOR, DP, Heap, Math

Easy Problem Solutions:

13 Roman to Integer Math
141 Linked List Cycle Linked List, Floyd's
160 Intersection of Two Linked Lists Linked List
204 Count Primes Math
242 Valid Anagram Frequency Map
243 Palindrome Linked List Linked List, Floyd's
268 Missing Number Math
326 Power of Three Math
509 Fibonacci Number Math
589 N-ary Tree Preorder Traversal Recursion, DFS
594 Longest Harmonious Subsequence Frequency Map
595 Distribute Candies Set
637 Average of Levels in Binary Tree Binary Tree, BFS
645 Set Mismatch (ver. 1) Array, Math
645 Set Mismatch (ver. 2) Array, Math
696 Count Binary Substrings String, Math
706 Design HashMap (ver. 1) Map, Array
706 Design HashMap (ver. 2) Hashing Function, Linked List
821 Shortest Distance to a Character DP
953 Verifying an Alien Dictionary Map
1332 Remove Palindromic Subsequences String
1337 The K Weakest Rows in a Matrix (ver. 1) Matrix
1337 The K Weakest Rows in a Matrix (ver. 2) Matrix, Binary Search,
Heap, Bit Manipulation
1342 Number of Steps to Reduce a Number to Zero Math
1480 Running Sum of 1d Array Prefix Sum
1704 Determine if String Halves Are Alike String

Discussion (2)

Editor guide
rsousaj profile image
Rafael Sousa

Pretty cool Sean. I'll definitely keep eyes on this series.
Actually, I'll make it better. I'll study one of them a day.


seanpgallivan profile image
seanpgallivan Author

You're welcome, Rafael!

I've been doing the daily leetcode challenge problem pretty much every day for the past 8 months, and I will definitely agree that a little bit each day really helps!