C++ practice in Data Structures & Algorithms
Browse the rooms before signing in. All rooms are free with an account. Practice does not issue certificates.
Even-Channel Filter
The diagnostics board only counts channels with even IDs. Tally them.
arrays. Free with an account.
Peak Reading
A sensor array reports the hottest cell. Find the maximum reading.
arrays. Free with an account.
Telemetry Total
Mission control needs the total packet count before the downlink window closes.
arrays. Free with an account.
Valley Floor
An altimeter logged the descent. Report the lowest reading in the buffer.
arrays. Free with an account.
Access Pair
Two key cards must sum to the vault code. The card list is sorted; find their slots.
two-pointers. Free with an account.
Best Window
A revenue stream has good days and bad. Find the largest sum any contiguous run of days produces.
kadane. Free with an account.
Bracket Integrity
A config parser rejects malformed nesting. Validate the brackets.
stack. Free with an account.
Log Reversal
The flight recorder writes backward. Reverse the buffer to read it forward.
two-pointers. Free with an account.
Find the Target
A sorted index needs fast lookups. Binary-search for a key and return its position, or -1.
binary-search. Free with an account.
Index Locator
A sorted manifest needs a part looked up fast. Binary search it.
binary-search. Free with an account.
Schedule Merge
Overlapping maintenance windows must be merged before the rollout.
sorting. Free with an account.
Top Priority
The dispatch queue must surface the k-th highest priority job.
heap. Free with an account.
Climb the Stairs
A staircase can be climbed one or two steps at a time. Count the distinct ways to reach the top with dynamic programming.
dynamic-programming. Free with an account.
Credit Exchange
A vending controller must pay an exact amount with the fewest coins, or report failure.
dp. Free with an account.
Territory Count
A drone map marks land as 1 and water as 0. Count the separate landmasses.
grid, dfs. Free with an account.
Upgrade Ladder
A firmware version ladder accepts only strictly increasing picks. Find the longest run.
dp. Free with an account.
Common Divisor
A scheduler aligns two cycle lengths. Compute their greatest common divisor with Euclid's algorithm.
math. Free with an account.
Sentinel Placement
Place n non-attacking sentinels on an n-by-n grid. Count the valid arrangements.
backtracking. Free with an account.
Shortest Relay
A mesh network must report the shortest weighted relay distance from a source to every node.
dijkstra. Free with an account.
String Morph
A protocol upgrader counts the minimum edits to migrate one token to another.
dp. Free with an account.