Blind 75: Best Time to Buy and Sell Stock — One Pass Solution Explained

Best Time to Buy and Sell Stock — From Brute Force to One-Pass Insight Overview You’re given a list of stock prices where each index represents a day. You are allowed only one transaction: Buy on one day Sell on a future day Your goal is simple: maximize profit. If no profit is possible, return 0. Problem Constraints 1 <= prices.length <= 10^5 Expected time complexity: O(n) Only one buy and one sell Sell must happen after buy How I Approached the Problem I follow a strict rule when solving problems like this: ...

February 6, 2026 · 3 min · 625 words

Blind 75: Two Sum — From Brute Force to Hash Map

Problem Overview We are given an array of integers nums and an integer target. Our Goal is to find two distinct integers from the array, such that their sum is equal to the target and return their indices. Constraints: The array contains at least 2 elements. Exactly one valid solution exists. The goal is to design a solution with O(n) time complexity. Lets Fund out how i approached this problem and what were my thoughts while solving this. ...

January 26, 2026 · 3 min · 493 words