#Leetcode

LeetCode HARD 37 Sudoku Solver Summary

Generated by Codex with GPT-5

Quick facts

  • Difficulty: HARD
  • Problem: Sudoku Solver
  • Main tags: Array, Hash Table, Backtracking, Matrix

What the problem is really asking

This problem is a constraint satisfaction problem disguised as a puzzle.

The board is almost complete already. The task is to fill each . with a digit so that three rules are always true:

Continue ...

LeetCode MEDIUM 300 Longest Increasing Subsequence Summary

Generated by Codex with GPT-5

Quick facts

What the problem is really asking

An array of integers is given. The task is to find the length of the longest subsequence whose values are strictly increasing.

The key word is subsequence, not subarray.

Continue ...

LeetCode MEDIUM 39 Combination Sum Summary

Generated by Codex with GPT-5

Quick facts

What the problem is really asking

The input gives a set of distinct candidate numbers and a target. The task is to return every unique combination of candidates whose sum is exactly the target.

Two details define the real problem:

Continue ...

LeetCode MEDIUM 6 Zigzag Conversion Summary

Generated by Codex with GPT-5

Quick facts

What the problem is really asking

The problem gives a string and a row count, then asks for the string that would appear if the characters were written in a zigzag pattern and read row by row.

Continue ...

LeetCode MEDIUM 62 Unique Paths Summary

Generated by Codex with GPT-5

Quick facts

  • Difficulty: MEDIUM
  • Problem: Unique Paths
  • Main tags: Math, Dynamic Programming, Combinatorics

What the problem is really asking

There is an m x n grid. A robot starts in the top-left corner and wants to reach the bottom-right corner. The robot can only move right or down.

Continue ...

LeetCode MEDIUM 74 Search a 2D Matrix Summary

Generated by Codex with GPT-5

Quick facts

What the problem is really asking

The matrix looks two-dimensional, but the key rule makes it behave like one long sorted array:

  • each row is sorted from left to right
  • the first value in a row is greater than the last value in the previous row

So the task is not really “search a grid.” It is “search a sorted sequence” while remembering that the sequence happens to be stored in matrix form.

Continue ...

LeetCode MEDIUM 904 Fruit Into Baskets Summary

Generated by Codex with GPT-5

Quick facts

What the problem is really asking

The story sounds specific, but the core problem is simple:

find the length of the longest contiguous subarray that contains at most two distinct values.

Continue ...

LeetCode HARD 23 Merge k Sorted Lists Summary

Generated by Codex with GPT-5

Quick facts

  • Difficulty: HARD
  • Problem: Merge k Sorted Lists
  • Main tags: Linked List, Divide and Conquer, Heap (Priority Queue), Merge Sort

What the problem is really asking

Each input list is already sorted. The task is to combine all of them into one final sorted linked list without losing that order.

Continue ...

LeetCode MEDIUM 17 Letter Combinations of a Phone Number Summary

Generated by Codex with GPT-5

Quick facts

What the problem is really asking

Each digit from 2 to 9 maps to a small set of letters, just like an old phone keypad. Given a string of digits, the task is to return every possible letter string that could be formed by choosing one mapped letter for each digit.

Continue ...

LeetCode MEDIUM 18 4Sum Summary

Generated by Codex with GPT-5

Quick facts

  • Difficulty: MEDIUM
  • Problem: 4Sum
  • Main tags: Array, Two Pointers, Sorting

What the problem is really asking

The surface task is to return every unique quadruplet whose sum equals target.

The harder part is not the arithmetic. It is avoiding duplicate answers while still searching efficiently.

Continue ...