Skip to main content

Practice (82 Questions · 2 Written Solutions)

Every question connects to the concepts it uses, external practice, and a local solved mark you can update yourself.

Showing 82 of 82 questions
0 / 82 Solved Locally
Basic

Reorder an integer array by a supplied list of distinct priority values, then place the remaining values in ascending order. Frequency counts let you emit every occurrence without losing duplicates.

Requires (Sorting):ArrayLearn:Counting Sort
Basic

Given an integer array sorted in non-decreasing order (including negatives), return an array of the squares of each number sorted in non-decreasing order.

Requires (Sorting):ArrayTwo Pointers
Medium

Sort an integer array in ascending order in strict O(n log n) worst-case time without built-in sort functions, minimizing auxiliary allocations.

Requires (Sorting):ArrayLearn:Merge Sort
Basic

Given unique athlete scores, assign Gold, Silver, Bronze, and numeric placement ranks using heap ordering or index sorting.

Requires (Sorting):ArrayLearn:Heap Sort
Basic

Return the two indices whose elements sum to target in a single O(n) pass using a complement hash map.

Requires (Hashing & Maps):ArrayHash Map
Medium

Given vertical line heights, move inward from the shorter wall to maximize trapped water area (right - left) * min(h[left], h[right]).

Requires (Arrays & Pointers):ArrayTwo Pointers
Medium

Maintain a duplicate-free sliding window [left..right] across a string to find the maximum unique substring length in O(n).

Requires (Arrays & Pointers):Sliding WindowHash Map
Basic

Verify that every opening bracket (, [, { is closed in strict LIFO nested order with no unmatched leftovers.

Requires (Lists, Stacks & Queues):Stack
Medium

For each day, compute how many days you must wait until a warmer temperature using a decreasing monotonic index stack.

Requires (Lists, Stacks & Queues):Monotonic StackArray
Medium

Sort intervals by start coordinate and coalesce all overlapping [start, end] ranges into disjoint intervals.

Requires (Search & Intervals):Merge Intervals
Advanced

Evict the least-frequently accessed key (breaking ties by least-recent access) in O(1) using frequency-indexed doubly linked buckets.

Requires (Caching Systems):Learn:LRU CacheLFU Cache
Basic

Implement exact membership checks, insertions, and removals with your own buckets or direct-address representation.

Requires (Hashing & Maps):Hash Table
Medium

Find the shortest 8-directional clear path from (0, 0) to (n - 1, n - 1) using BFS or A* with Chebyshev heuristic max(|dx|, |dy|).

Requires (Shortest Paths & A*):Graph BFSGrid Graph
Medium

Turn 4 circular combination wheels one digit at a time from "0000" to target while avoiding deadends in the minimum turns.

Requires (Shortest Paths & A*):Graph BFSHash Set
Advanced

Build a sorted structure with randomized layers that supports search, insertion, and deletion in expected logarithmic time.

Requires (Trees & BSTs):Skip List
Medium

Implement insert(word), search(word), and startsWith(prefix) over a character-branching prefix tree.

Requires (Tries & Segment Trees):Trie
Basic

Track the cheapest earlier price and the best later sale in one pass.

Requires (Arrays & Pointers):Array
Medium

Store enough information to answer the minimum query after any push or pop.

Requires (Lists, Stacks & Queues):Min Stack
Medium

Identify which half remains sorted before deciding where the target can lie.

Requires (Search & Intervals):Binary Search
Medium

Locate the rotation boundary by comparing the midpoint with an endpoint.

Requires (Search & Intervals):Binary Search
Medium

Use partition boundaries to select an order statistic without a full sort.

Requires (Heaps & Top-K):Quickselect
Medium

Build target-sum combinations with repeated candidates while avoiding duplicate orderings.

Requires (Backtracking & DP):Backtracking
Medium

Use two prefix lengths as the state for matching or skipping sequence elements.

Requires (Backtracking & DP):2-D Sequence DP
Medium

Reduce balanced partitioning to whether a subset can reach half the total sum.

Requires (Backtracking & DP):Knapsack DP
Medium

Extend prefix-tree lookup so a wildcard explores every possible next branch.

Requires (Tries & Segment Trees):TrieBacktracking

Worked solutions and interactive examples