SOLUTIONS
LEETCODE.

Analysis and solutions for algorithmic problems.

Problem Difficulty Complexity Date
0076 Minimum Window Substring Hard T: O(N + M) / S: O(1) Mar 2026
0084 Largest Rectangle in Histogram Hard T: O(N) / S: O(N) Mar 2026
0085 Maximal Rectangle Hard T: O(R * C) / S: O(C) Mar 2026
0087 Scramble String Hard T: O(N^4) / S: O(N^3) Mar 2026
0110 Balanced Binary Tree Easy T: O(n) / S: O(n) Mar 2026
0115 Distinct Subsequences Hard T: O(M * N) / S: O(M) Mar 2026
0123 Best Time to Buy and Sell Stock III Hard T: O(N) / S: O(1) Mar 2026
0124 Binary Tree Maximum Path Sum Hard T: O(N) / S: O(H) Mar 2026
0126 Word Ladder II Hard T: O(N * M * 26) / S: O(N * M) Mar 2026
0127 Word Ladder Hard T: O(M^2 * N) / S: O(M^2 * N) Mar 2026
0132 Palindrome Partitioning II Hard T: O(N^2) / S: O(N) Mar 2026
0135 Candy Hard T: O(N) / S: O(N) Mar 2026
0140 Word Break II Hard T: O(N * 2^N) / S: O(N * 2^N) Mar 2026
0149 Max Points on a Line Hard T: O(N^2) / S: O(N) Mar 2026
0154 Find Minimum in Rotated Sorted Array II Hard T: O(N) worst case, O(log N) average / S: O(1) Mar 2026
0174 Dungeon Game Hard T: O(M * N) / S: O(N) Mar 2026
0188 Best Time to Buy and Sell Stock IV Hard T: O(N * K) / S: O(K) Mar 2026
0212 Word Search II Hard T: O(M * N * 4 * 3^(L-1)) where L is the maximum word length / S: O(W * L) where W is the number of words Mar 2026
0214 Shortest Palindrome Hard T: O(N) where N is the length of the string / S: O(N) for the combined string and the LPS array Mar 2026
0218 The Skyline Problem Hard T: O(N log N) where N is the number of buildings / S: O(N) for the heap and the critical points Mar 2026