Illustration showing a matrix rotated 90 degrees clockwise

Rotate Image (Blind 75): 90° Matrix Rotation Explained

Problem Overview We are given a 2D matrix of size n * n. The matrix represents an image. Our goal is to rotate the image by 90 degrees clockwise. The solution must use constant extra space (in-place). LeetCode - Rotate Image Example Input: matrix = [[1,2,3], [4,5,6], [7,8,9]] Output: [[7,4,1], [8,5,2], [9,6,3]] Intuition If we remember basic matrix properties: Transpose of a matrix Reverse of each row If we: First take the transpose (swap (i,j) with (j,i)) Then reverse every row We effectively rotate the matrix 90° clockwise. ...

February 24, 2026 · 2 min · 394 words · Hitesh Patel
Illustration of the 'Container With Most Water' problem showing vertical bars and the maximum water area highlighted

Find the container with most water (Blind 75) — O(n) Solution

Problem Overview We are given an array heights of size n. The value at each index represents the height of a vertical bar. We need to find two bars such that together they can hold the maximum amount of water. Note: We are not allowed to slant the container. LeetCode - Container With Most Water Example Input: height = [1,8,6,2,5,4,8,3,7] Output: 49 ...

February 17, 2026 · 3 min · 435 words · Hitesh Patel
Illustration showing two-pointer technique to find unique triplets that sum to zero

Three Sum (Blind 75) — O(n²) Solution

Problem Overview We are given an integer array nums, We need to find all unique triplets [nums[i], nums[j], nums[k]] such that: i != j, i != k, j != k nums[i] + nums[j] + nums[k] == 0 We need to return unique triplets Notice that the order of the output and the order of the triplets does not matter. LeetCode - Three Sum Example Input: [-1, 0, 1, 2, -1, -4] Output: [[-1,-1,2], [-1,0,1]] Explanation: ...

February 15, 2026 · 4 min · 716 words · Hitesh Patel
Illustration showing binary search technique to find a target in a rotated sorted array

Search in Rotated Sorted Array (Blind 75) — O(log n) Solution

Problem Overview We are given a sorted array nums of distinct integers The array has been possibly rotated at some pivot k (unknown). Example: Original: [0,1,2,4,5,6,7] Rotated : [4,5,6,7,0,1,2] We must return the index of target if it exists in the array else return -1. The required time complexity is O(log n). LeetCode - Search in Rotated Sorted Array Brute Force Approach The simplest approach is to scan the entire array. ...

February 13, 2026 · 3 min · 480 words · Hitesh Patel
Illustration showing binary search on a rotated sorted array to find the minimum element

Blind 75: Find Minimum in Rotated Sorted Array — Understanding Binary Search Deeper

Problem Overview We are given an array nums The array was originally sorted in ascending order and then left-rotated by k positions, where 1 < k < n All elements in the array are unique We need to find the minimum element in the array The goal is to design a solution with O(log n) time complexity How I Approached the Problem I follow a strict rule when solving problems like this: ...

February 11, 2026 · 2 min · 373 words · Hitesh Patel
Illustration showing a one-pass greedy approach to find the best day to buy and sell stock for maximum profit

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

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 · 4 min · 681 words · Hitesh Patel
Illustration showing how a hash map is used to find two numbers that add up to a target

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 · 578 words · Hitesh Patel