Month October 2024

Leetcode 209: Minimum Size Subarray Sum

The original question can be found here. The question is asking us to the minimum length of subarray that it’s sum is no less than target value. Brute Force The brute force we can immediately think of is to enumerate…

Leetcode 74: Search a 2D Matrix

The original question can be found here. The question is asking us to find the target element in a 2-dimensional array. Each row is greater than the row above it. Within each row, elements are sorted as well. Brute Force…

Leetcode 35: Search Insert Position

The original question can be found here. The question is asking for a specific target value, if it exists in the array, return the index. Otherwise, return the index position that it should be inserted. Brute Force We just iterate…