LeetCode HARD 76 Minimum Window Substring Summary

Generated by Codex with GPT-5

Quick facts

What the problem is really asking

There are two strings:

  • s, the big string where the answer must come from
  • t, the set of required characters the answer must contain

The task is to return the shortest substring of s that contains every character from t, including duplicates.

Continue ...

LeetCode MEDIUM 237 Delete Node in a Linked List Summary

Generated by Codex with GPT-5

Quick facts

What the problem is really asking

This problem sounds impossible the first time it is heard.

In a normal singly linked list, deleting a node means changing the previous node’s next pointer so it skips the node being removed. But this problem does not give the head of the list or the previous node. It gives only the node that should disappear, and it guarantees that this node is not the tail.

Continue ...

LeetCode MEDIUM 417 Pacific Atlantic Water Flow Summary

Generated by Codex with GPT-5

Quick facts

What the problem is really asking

Each cell in the grid is a height. Water can flow from a cell to one of its four neighbors if the neighbor is at the same height or lower.

Continue ...

LeetCode MEDIUM 494 Target Sum Summary

Generated by Codex with GPT-5

Quick facts

  • Difficulty: MEDIUM
  • Problem: Target Sum
  • Main tags: Array, Dynamic Programming, Backtracking
  • Frequency in source list: 22.1

What the problem is really asking

Each number in nums must receive either a plus sign or a minus sign.

After choosing a sign for every element, the final expression must evaluate to target.

Continue ...

LeetCode MEDIUM 61 Rotate List Summary

Generated by Codex with GPT-5

Quick facts

  • Difficulty: MEDIUM
  • Problem: Rotate List
  • Main tags: Linked List, Two Pointers
  • Frequency in source list: 25.6

What the problem is really asking

The input is a singly linked list and a non-negative integer k.

Rotating the list to the right by k means taking the last k nodes, preserving their order, and moving them to the front.

Continue ...

LeetCode MEDIUM 8 String to Integer (atoi) Summary

Generated by Codex with GPT-5

Quick facts

What the problem is really asking

The input is a string, and the task is to extract the integer prefix that follows a very specific parsing rule:

  1. ignore leading spaces
  2. read at most one optional + or -
  3. read as many consecutive digits as possible
  4. stop as soon as the next character is not a digit
  5. clamp the result into the 32-bit signed integer range

So this is not a math problem. It is a parsing problem with a few edge cases that must be handled in the correct order.

Continue ...

LeetCode MEDIUM 90 Subsets II Summary

Generated by Codex with GPT-5

Quick facts

  • Difficulty: MEDIUM
  • Problem: Subsets II
  • Main tags: Array, Backtracking, Bit Manipulation

What the problem is really asking

This is the power set problem with one extra constraint that changes everything: the input can contain duplicate values, but the output cannot contain duplicate subsets.

If the array were all distinct, the job would be straightforward. At each position, either include the number or skip it, and every path through that decision tree would produce a unique subset.

Continue ...

LeetCode MEDIUM 907 Sum of Subarray Minimums Summary

Generated by Codex with GPT-5

Quick facts

  • Difficulty: MEDIUM
  • Problem: Sum of Subarray Minimums
  • Main tags: Array, Dynamic Programming, Stack, Monotonic Stack
  • Frequency in source list: 22.1

What the problem is really asking

For every contiguous subarray, take its minimum value. Then add all of those minimums together.

That sounds simple until the number of subarrays is considered. An array of length n has about n^2 / 2 subarrays, so listing each one and recomputing its minimum quickly becomes too slow.

Continue ...

LeetCode HARD 124 Binary Tree Maximum Path Sum Summary

Generated by Codex with GPT-5

Quick facts

What the problem is really asking

This problem is easy to misread at first.

The path does not have to start at the root, and it does not have to end at a leaf. It can start anywhere and end anywhere, as long as it follows parent-child edges and does not reuse a node.

Continue ...

LeetCode HARD 44 Wildcard Matching Summary

Generated by Codex with GPT-5

Quick facts

  • Difficulty: HARD
  • Problem: Wildcard Matching
  • Main tags: String, Dynamic Programming, Greedy

What the problem is really asking

The pattern contains two special characters:

  • ? matches exactly one character
  • * matches any sequence of characters, including the empty sequence

The match must cover the entire string. That is the part that makes the problem interesting.

Continue ...