DEV Community

Cover image for Leetcode Solutions Index

Leetcode Solutions Index

seanpgallivan profile image seanpgallivan Updated on ・7 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
895 Maximum Frequency Stack Frequency Map, Stack
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
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
29 Divide Two Integers (ver. 1) Bit Manipulation
29 Divide Two Integers (ver. 2) Math
31 Next Permutation Array, Math
71 Simplify Path Stack, Sliding Window
86 Partition List Linked List
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
322 Coin Change DFS, Recursion
341 Flatten Nested List Iterator Class, Queue, Recursion
376 Wiggle Subsequence Subsequence
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
581 Shortest Unsorted Continuous Subarray Array
622 Design Circular Queue Linked List
623 Add One Row to Tree Binary Tree, DFS, Recursion
647 Palindromic Substrings Math
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
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
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
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
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
242 Valid Anagram Frequency Map
243 Palindrome Linked List Linked List, Floyd's
268 Missing Number Math
509 Fibonacci Number Math
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
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
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!