LeetCode MEDIUM 981 Time Based Key-Value Store Summary

Generated by Codex with GPT-5

Quick facts

Problem gist

Design a key-value store that remembers history. A normal hash map answers “what is the current value for this key?” This problem asks “what was the value for this key at this timestamp?”

Continue ...

LeetCode MEDIUM 103 Binary Tree Zigzag Level Order Traversal Summary

Generated by Codex with GPT-5

Difficulty: MEDIUM
Problem: Binary Tree Zigzag Level Order Traversal

Problem gist

The input is the root of a binary tree. The task is to return the node values level by level, but the direction alternates:

  • The root level is read from left to right.
  • The next level is read from right to left.
  • The next level flips back to left to right, and so on.

For example, a tree with levels [3], [9, 20], and [15, 7] should return three rows: [3], then [20, 9], then [15, 7].

Continue ...

LeetCode MEDIUM 153 Find Minimum in Rotated Sorted Array Summary

Generated by Codex with GPT-5

Quick facts

What the problem is really asking

The input array was originally sorted in ascending order, then rotated. For example, [0, 1, 2, 4, 5, 6, 7] might become [4, 5, 6, 7, 0, 1, 2].

Continue ...

LeetCode MEDIUM 179 Largest Number Summary

Generated by Codex with GPT-5

Quick facts

  • Difficulty: MEDIUM
  • Problem: Largest Number
  • Main tags: Array, String, Greedy, Sorting

What the problem is really asking

The input is a list of non-negative integers. The task is to reorder them so that their decimal representations form the largest possible concatenated number, then return that number as a string.

Continue ...

LeetCode MEDIUM 209 Minimum Size Subarray Sum Summary

Generated by Codex with GPT-5

Quick facts

Problem gist

Given an array of positive integers nums and a positive integer target, find the shortest contiguous subarray whose sum is at least target. If no such subarray exists, return 0.

Continue ...

LeetCode MEDIUM 99 Recover Binary Search Tree Summary

Generated by Codex with GPT-5

Quick facts

Problem gist

A binary search tree should produce values in sorted order when walked with inorder traversal: left subtree, current node, then right subtree. In this problem, exactly two node values were swapped by mistake. The tree shape is still the same, but the values break the BST ordering rule.

Continue ...

LeetCode HARD 778 Swim in Rising Water Summary

Generated by Codex with GPT-5

Quick facts

  • Difficulty: HARD
  • Problem: Swim in Rising Water
  • Main tags: Array, Binary Search, Depth-First Search, Breadth-First Search, Union-Find, Heap (Priority Queue), Matrix

What the problem is really asking

The input is an n x n grid of elevations. At time t, the water level is also t, and a cell is swimmable only if its elevation is at most t.

Continue ...

LeetCode MEDIUM 1015 Smallest Integer Divisible by K Summary

Generated by Codex with GPT-5

Quick facts

What the problem is really asking

The input is a positive integer k. The task is to find the length of the smallest positive integer made only of the digit 1 that is divisible by k.

Continue ...

LeetCode MEDIUM 1838 Frequency of the Most Frequent Element Summary

Generated by Codex with GPT-5

Quick facts

What the problem is really asking

Given an array of positive integers and a budget k, one operation lets us increase one element by 1. The goal is to make some value appear as many times as possible after using at most k total increments.

Continue ...

LeetCode MEDIUM 767 Reorganize String Summary

Generated by Codex with GPT-5

Quick facts

  • Difficulty: MEDIUM
  • Problem: Reorganize String
  • Main tags: Hash Table, String, Greedy, Heap, Counting

What the problem is really asking

The input is a string s. The task is to rearrange its characters so that no two adjacent characters are equal. If no such rearrangement exists, return the empty string. Any valid rearrangement is accepted.

Continue ...