Skip to content
difficulty

Advanced

Articles whose authoritative difficulty is advanced.

Tagged articles

Advanced articles

21 articles in this tag.

Visual abstraction of neural networks in AI technology, featuring data flow and algorithms.
advanced
13 min read

4Sum

Four choices suggest an O(n^4) search. Sorting changes the last two choices into a controlled walk.

View solution
Laptop with a blank screen placed on a brown velvet chair in a bright room.
advanced
11 min read

Distinct Subsequences

Repeated characters create the trap: different selections from s can produce the same visible text in t, and the problem still counts those selections…

View solution
A historic stone tower rises against a dramatic, moody sky with dark clouds.
advanced
13 min read

Divide Two Integers

Repeated subtraction computes division correctly, but it counts quotient units one at a time. Under interview constraints, that is the wrong scale of…

View solution
Close-up of colorful yarn balls with onion dye in a rustic basket, highlighting natural dyeing techniques.
advanced
13 min read

Edit Distance

The table is easy to memorize and easy to misuse. The durable idea is simpler: track how far you have consumed each string, then let the final operation…

View solution
Intricate network of tangled power and communication cables outdoors.
advanced
12 min read

Interleaving String

When both source strings can provide the next target character, a greedy pointer has to guess. Dynamic programming keeps both possibilities alive until the…

View solution
Minimalist dark-themed workspace with laptop and wireless keyboard.
advanced
12 min read

Longest Valid Parentheses

Counting matching pairs is not enough. The pairs must form one contiguous, well-formed region, and valid regions can nest, touch, or be separated by an…

View solution
Multi-colored cables intertwined against a dark background, showing technology connections.
advanced
12 min read

Merge k Sorted Lists

The heap is only half the solution. The real insight is maintaining exactly one valid frontier node per sorted list.

View solution
Close-up of interlocking metal gears creating an industrial texture.
advanced
13 min read

N-Queens II

The key change from N-Queens is the output contract: you need one integer, so the search should retain only reversible constraints and count valid leaves.

View solution
3D abstract geometric structure with gold lines and black polygons on a dark background.
advanced
13 min read

N-Queens

The board is only the output surface. The real N-Queens solution is a depth-n search over column assignments, with three constraints checked before each…

View solution
Black computer cables splayed on a vibrant yellow surface, highlighting technology connection themes.
advanced
11 min read

Next Permutation

The reliable way to solve Next Permutation is to stop thinking in four memorized steps. Read the suffix, identify where it is already maximal, then make…

View solution
Detailed view of a sewing machine needle stitching fabric, highlighting sewing process and textile technology.
advanced
12 min read

Recover Binary Search Tree

A binary search tree has a structural invariant that is more useful than its parent-child relationships: inorder traversal visits values in sorted order.…

View solution
A broken laptop screen displayed with colorful glitch being held by a person.
advanced
12 min read

Text Justification

A line can contain the correct words and still be wrong: one space in the wrong gap, one missing trailing space, or full justification applied to the final…

View solution
Skilled craftsman sharpens a blade on a grinding wheel, creating sparks in a workshop.
advanced
12 min read

Trapping Rain Water

The picture suggests moving inward from both ends. The proof requires more: finalize only the side whose limiting boundary is already certified.

View solution
Two ancient columns stand majestically against a serene hillside backdrop.
advanced
12 min read

Valid Number

A decimal point and an exponent are easy to track. The hard part is proving that every numeric component actually contains the digits the grammar requires.

View solution