#Leetcode

LeetCode MEDIUM 215 Kth Largest Element in an Array Summary

Generated by Codex with GPT-5

Quick facts

What the problem is really asking

This problem asks for the value that would appear in position k if the array were sorted in descending order.

Continue ...

LeetCode MEDIUM 253 Meeting Rooms II Summary

Generated by Codex with GPT-5

Quick facts

  • Difficulty: MEDIUM
  • Problem: Meeting Rooms II
  • Main tags: Array, Two Pointers, Greedy, Sorting, Heap (Priority Queue)

What the problem is really asking

Each interval represents one meeting with a start time and an end time.

The question is not really about building a calendar or labeling rooms. It is asking:

Continue ...

LeetCode MEDIUM 347 Top K Frequent Elements Summary

Generated by Codex with GPT-5

Quick facts

What the problem is really asking

The input is an array of integers and a number k.

The task is not to sort the array itself. It is to:

Continue ...

LeetCode MEDIUM 875 Koko Eating Bananas Summary

Generated by Codex with GPT-5

Quick facts

What the problem is really asking

Koko has several piles of bananas and exactly h hours before the guards return. In one hour, she chooses one pile and eats up to k bananas from that pile. If the pile has fewer than k, she finishes it and the rest of that hour is wasted.

Continue ...

LeetCode HARD 212 Word Search II Summary

Generated by Codex with GPT-5

Quick facts

  • Difficulty: HARD
  • Problem: Word Search II
  • Main tags: Array, String, Backtracking, Trie, Matrix

What the problem is really asking

The input gives a letter grid and a list of candidate words. A word is valid if it can be traced through horizontally or vertically adjacent cells without reusing the same cell inside that one word.

Continue ...

LeetCode HARD 2402 Meeting Rooms III Summary

Generated by Codex with GPT-5

Quick facts

  • Difficulty: HARD
  • Problem: Meeting Rooms III
  • Main tags: Array, Sorting, Heap (Priority Queue), Simulation
  • Frequency in source list: 17.6

What the problem is really asking

This is not the classic “how many meeting rooms are needed?” question.

The number of rooms is fixed up front, and every meeting has to be assigned under three rules:

Continue ...

LeetCode HARD 312 Burst Balloons Summary

Generated by Codex with GPT-5

Quick facts

  • Difficulty: HARD
  • Problem: Burst Balloons
  • Main tags: Array, Dynamic Programming

What the problem is really asking

This problem looks like a simulation question, but the hard part is not the simulation itself. The hard part is that every burst changes the future.

When balloon i is burst, the coins earned are:

Continue ...

LeetCode HARD 407 Trapping Rain Water II Summary

Generated by Codex with GPT-5

Quick facts

  • Difficulty: HARD
  • Problem: Trapping Rain Water II
  • Main tags: Array, Breadth-First Search, Heap (Priority Queue), Matrix
  • Frequency in source list: 17.6

What the problem is really asking

This is the 2D version of Trapping Rain Water.

Instead of one row of bars, there is a full grid of elevations. After rain falls, water can sit on low cells, but only if every path from that cell to the outer border is blocked by walls that are high enough.

Continue ...

LeetCode MEDIUM 138 Copy List with Random Pointer Summary

Generated by Codex with GPT-5

Quick facts

What the problem is really asking

Each node in the list has two outgoing pointers:

  • next, which gives the usual linked-list order
  • random, which can point to any node in the list or to None

The task is to build a deep copy, not just another pointer to the same nodes.

Continue ...

LeetCode MEDIUM 29 Divide Two Integers Summary

Generated by Codex with GPT-5

Quick facts

What the problem is really asking

Two integers are given: dividend and divisor.

The task is to return the integer quotient of dividend / divisor, but with three constraints that make the problem interesting:

Continue ...