LeetCode 503: Where Does the Right Side End in a Circular Array?

Problem Requirement You are given a circular integer array nums. Return an array answer. For every index i: answer[i] = the first value strictly greater than nums[i] when moving right If one full trip around the array finds no greater value, answer[i] = -1. “Circular” means that moving past the final position continues from index 0. An index cannot travel one full circle and use itself as its own answer. ...

July 20, 2026 · 9 min · map[name:Jeanphilo]

LeetCode 84: Which Bar Limits a Contiguous Rectangle?

Problem Requirement You are given a non-negative integer array heights. Each heights[i] is the height of a bar with width 1, and all bars are adjacent. Return the area of the largest rectangle that can be formed in the histogram. A legal rectangle covers a contiguous interval of bars. Its width is the number of bars in that interval, and its height cannot exceed the shortest bar in the interval. ...

July 20, 2026 · 10 min · map[name:Jeanphilo]

LeetCode 136: Single Number Without Growing Extra Storage

Problem Requirement You are given a non-empty integer array nums. Exactly one element appears once. Every other element appears exactly twice. Return the element that appears once. LeetCode provides this method contract: singleNumber(nums: List[int]) -> int The solution must also satisfy two resource requirements: O(n) time O(1) extra space Example 1 Input: nums = [2,2,1] Output: 1 2 appears twice. Only 1 appears once. Example 2 Input: nums = [4,1,2,1,2] Output: 4 Both 1 and 2 have matching copies. Only 4 remains unpaired. ...

July 15, 2026 · 6 min · map[name:Jeanphilo]

LeetCode 739: Daily Temperatures and the First Warmer Day to the Right

Problem Requirement You are given an integer array temperatures, where temperatures[i] is the temperature on day i. Return an array answer where: answer[i] = the number of days after day i until a warmer temperature If no later day is warmer, answer[i] = 0. “Warmer” means strictly greater. An equal temperature does not resolve a waiting day. LeetCode provides this method contract: dailyTemperatures(temperatures: List[int]) -> List[int] Example Input: temperatures = [73,74,75,71,69,72,76,73] Output: [1,1,4,2,1,1,0,0] Constraints 1 <= temperatures.length <= 10^5 30 <= temperatures[i] <= 100 Step 1: The Answer Is a Waiting Time, Not a Temperature Start with a smaller input: ...

July 15, 2026 · 6 min · map[name:Jeanphilo]

LeetCode 45: Jump Game II From Reachability to Minimum Jumps

Subtitle / Summary Jump Game II is not just reachability. It asks how many coverage layers are needed to reach the last index. Reading time: 8-10 min Tags: Hot100, greedy, array, reachability boundary SEO keywords: LeetCode 45, Jump Game II, greedy, current_end, farthest, minimum jumps Meta description: A pressure-first Python guide to LeetCode 45 that derives the minimum-jump greedy scan from coverage layers. Problem Requirement You are given an integer array nums. ...

July 8, 2026 · 9 min · map[name:Jeanphilo]

LeetCode 121: Best Time to Buy and Sell Stock With Greedy

Subtitle / Summary The greedy idea is not “buy low, sell high” as a slogan. The precise rule is: if today is the sell day, the best buy day must be the lowest price before today. Reading time: 8-10 min Tags: Hot100, greedy, array, stock SEO keywords: LeetCode 121, Best Time to Buy and Sell Stock, greedy, historical minimum price Meta description: A pressure-first Python guide to LeetCode 121 that derives brute force, historical minimum price, and the final one-pass greedy solution. Problem Requirement You are given an array prices, where prices[i] is the stock price on day i. ...

July 3, 2026 · 6 min · map[name:Jeanphilo]

LeetCode 55: Jump Game With Farthest Reach Greedy

Subtitle / Summary Jump Game is not about guessing one path. It is about maintaining how far all reachable positions can cover. Reading time: 8-10 min Tags: Hot100, greedy, array, reachability SEO keywords: LeetCode 55, Jump Game, greedy, farthest reach, reachability Meta description: A pressure-first Python guide to LeetCode 55 that derives a reachable-array baseline and compresses it into the farthest reachable range. Problem Requirement You are given an integer array nums. ...

July 3, 2026 · 6 min · map[name:Jeanphilo]

Hot100: First Missing Positive In-Place Index Placement ACERS Guide

Subtitle / Summary First Missing Positive is a classic in-place indexing problem. Place each valid value x into slot x-1, then scan for the first mismatch. This ACERS guide explains the derivation, invariant, pitfalls, and production-style transfer. Reading time: 12-15 min Tags: Hot100, array, in-place hashing SEO keywords: First Missing Positive, in-place hashing, index mapping, O(n), Hot100, LeetCode 41 Meta description: O(n)/O(1) solution for First Missing Positive using in-place index placement, with complexity analysis, engineering scenarios, and runnable multi-language code. Target Readers Hot100 learners building stable array templates Intermediate developers who want to master in-place indexing techniques Engineers who need linear-time, constant-space array normalization Background / Motivation “Find the smallest missing positive” is fundamentally a placement problem. ...

February 10, 2026 · 10 min · map[name:Jeanphilo]

Hot100: Spiral Matrix (Boundary Shrinking Simulation ACERS Guide)

Subtitle / Summary Spiral traversal looks like “just printing in a fancy order”, but the real difficulty is getting boundaries and invariants right. This ACERS guide gives a reusable boundary-shrinking template and runnable multi-language solutions. Reading time: 12–15 min Tags: Hot100, matrix, simulation, boundary shrinking SEO keywords: Hot100, Spiral Matrix, clockwise traversal, boundary shrinking, LeetCode 54 Meta description: O(mn) spiral order traversal using boundary shrinking, with pitfalls, engineering scenarios, and runnable code. A — Algorithm Problem Restatement Given an m × n matrix matrix, return all elements in clockwise spiral order. ...

February 3, 2026 · 13 min · map[name:Jeanphilo]

LeetCode 42: How Much Rain Water Can an Elevation Map Hold?

Problem Requirement You are given n non-negative integers in height. Each integer is the height of a bar with width 1, and all bars are adjacent from left to right. After rain, taller bars on both sides may hold water above shorter bars. Return the total amount of water trapped by the entire elevation map. LeetCode expects this interface: class Solution: def trap(self, height: List[int]) -> int: ... Example 1 Input: height = [0,1,0,2,1,0,1,3,2,1,2,1] Output: 6 Example 2 Input: height = [4,2,0,3,2,5] Output: 9 Constraints n == len(height) 1 <= n <= 2 * 10^4 0 <= height[i] <= 10^5 Step 1: First Answer How Much Water One Position Holds Do not calculate the whole elevation map yet. Focus on one position: ...

January 24, 2026 · 14 min · map[name:Jeanphilo]