LeetCode 115: two solutions - Space optimization using a 1D array
See how a simple 1D array optimization reduces space complexity from O(n * m) to O(m) while keeping O(n * m) time complexity.
Read moreSee how a simple 1D array optimization reduces space complexity from O(n * m) to O(m) while keeping O(n * m) time complexity.
Read moreWe're used to evaluating an algorithm's Time complexity, but we often overlook its Space complexity. However, often the best solution for Time complexity is a brute-force solution for Space complexity and vice versa.
Read moreThe Basic Prefix Sum pattern is the foundation of all Prefix Sum variations. Start with this pattern to understand how prefix sums work before learning more advanced Prefix Sum patterns for coding interviews.
Read moreLeetCode 3875 is a surprisingly simple and interesting problem that can be solved with just one line of code.
Read moreThe Parity pattern is obviously not one of the most famous coding patterns. However, it is an important pattern when you need to determine whether a number is odd or even.
Read more