Curated sets

Interview core

The mediums that show up in real onsite loops.

All problems
Total results1,547 problems
TopicsJudge
More Garden TroublesFind the fewest flamethrower shots that clear every plot when each shot halves a plot and its two neighbors, rounding down.Medium5GreedyMath+1No attempts yet2s128 MBJudgeable
Poetry with an AsteriskCount for each one-asterisk query how many dictionary words start with its prefix and end with its suffix without overlap.Medium5Hash mapStringNo attempts yet5s128 MBJudgeable
BoardsFrom the smallest power of two at least K, find the fewest board halvings so some pieces sum to exactly K.Medium5Bit manipulationGreedyNo attempts yet1s128 MBJudgeable
Portal KombatHektor absorbs the strength of each weaker opponent he beats, and the goal is the fewest wins that let him defeat the strongest opponent.Medium5GreedySorting+1No attempts yet5s128 MBJudgeable
Memory Bit Electrode OperationsYou receive start and target binary strings and compute the fewest prefix or suffix flips that turn the start into the target.Medium5GreedyStringNo attempts yet1s128 MBJudgeable
Neon SignCount the triples of vertices whose three connecting tubes all share the same color in a red-blue complete graph.Medium5CombinatoricsGraphNo attempts yet3s256 MBJudgeable
MCSCount every length-k substring of a DNA string by its letter composition and report the size of the largest group.Medium5Sliding windowHash mapNo attempts yet5s128 MBJudgeable
SalesmenGiven a graph and a reported vertex sequence, find the fewest entries to change so consecutive vertices stay put or follow an edge.Medium5Dynamic programmingGraphNo attempts yet1s128 MBJudgeable
SymmetryDecide whether the given dots mirror exactly across some vertical line, printing YES or NO for each test case.Medium5Hash mapGeometry+1No attempts yet1s128 MBJudgeable
Graceful Prime DecompositionCount ordered sums of N from primes up to K where no two neighboring primes are equal.Medium5Dynamic programmingNumber theoryNo attempts yet1s128 MBJudgeable
Math NotebookChoose a contiguous block from both sequences to maximize its dot product with the reversed second block.Medium5Brute forceArrayNo attempts yet1s128 MBJudgeable
Parcel DeliveryChoose how many boxes of each shipment to load onto a one-way truck of capacity C to maximize total delivered boxes.Medium5GreedySortingNo attempts yet1s128 MBJudgeable
TaekwondoSort both weight lists and pair players to minimize the total absolute weight difference across all matches.Medium5Dynamic programmingSortingNo attempts yet1s128 MBJudgeable
BridgeFind the bridge height that minimizes the total crossing distance over every pair of left and right houses.Medium5SortingMathNo attempts yet3s128 MBJudgeable
Canoe AthletesPick one weight from each of four lists so the total is closest to the target, preferring the smaller total on ties.Medium5Binary searchSorting+1No attempts yet3s256 MBJudgeable
OrderRecover the permutation from counts of smaller previous elements, printing IMPOSSIBLE when the counts allow no permutation.Medium5SimulationMathNo attempts yet1s128 MBJudgeable
Sum of Two NumbersCount the pairs of distinct given integers whose sum has the smallest absolute difference from K.Medium5Two pointersSortingNo attempts yet1s128 MBJudgeable
Widest PathFind the path between two given nodes whose smallest edge weight is as large as possible.Medium5Minimum spanning treeUnion-find+1No attempts yet1s128 MBJudgeable
Message BroadcastingCompute the fewest rounds to spread a message from the root when each informed node calls at most one child per round.Medium5GreedyTree+2No attempts yet1s128 MBJudgeable
Wiring CostPay for wire pieces so every cheaper piece becomes free, then choose the price tier that reaches the required length at the lowest cost.Medium5GreedySortingNo attempts yet1s128 MBJudgeable
MinesweeperCount the largest possible number of second-row mines, including the marked ones, that fits the first-row digit clues.Medium5BacktrackingBrute forceNo attempts yet1s128 MBJudgeable
Shuttle BusFind the smallest fleet of buses that can run every scheduled trip between the school and the terminal given the one-way travel time.Medium5GreedySortingNo attempts yet1s128 MBJudgeable
Tug of WarDecide whether N student weights (4 to 30) split into two teams whose total strengths differ by at most X.Medium5Dynamic programmingNo attempts yet1s128 MBJudgeable
Tiling Up BlocksFind the largest subset of blocks that stacks so both knob counts never decrease from bottom to top.Medium5Dynamic programmingSortingNo attempts yet1s128 MBJudgeable
Colour SequenceDecide whether a target colour string appears as a subsequence of a card row when each card shows one of its two sides and jokers match any colour.Medium5GreedyTwo pointersNo attempts yet1s128 MBJudgeable
EscapeFind the fewest steps from the start cell to any border cell in a grid while turning at each tile unless both sides are blocked.Medium5BFSShortest path+2No attempts yet1s128 MBJudgeable
77377Split a digit string into dictionary words whose telephone-keypad encoding matches each segment.Medium5Dynamic programmingTrie+1No attempts yet1s128 MBJudgeable
No Left TurnsFind the shortest path from start to finish in a maze where each step goes straight ahead or turns right.Medium5BFSShortest path+1No attempts yet1s128 MBJudgeable
The First TermTrace each given term backward through the reverse look-and-say rule until it reaches its earliest valid ancestor.Medium5SimulationStringNo attempts yet1s128 MBJudgeable
Road TripBuy and resell fuel at each town's price within tank capacity to complete every leg of each journey at minimum cost.Medium5GreedyNo attempts yet1s128 MBJudgeable
Count Values in a Sorted MatrixCount entries in each query range [X, Y] inside a matrix whose rows and columns are sorted ascending.Medium5Binary searchMatrixNo attempts yet15s512 MBJudgeable
PointsPick a subset of targets in a row to maximize the total where each picked target scores based on how many neighbors are also picked.Medium5Dynamic programmingNo attempts yet3s128 MBJudgeable
Frozen SprinklersCut pipes with minimum total force so no water flows from the central node to any leaf sprinkler in the tree.Medium5Dynamic programmingTree+1No attempts yet3s128 MBJudgeable
Property LinesGiven up to 100 claimed rectangles inside a W by H city, compute the area claimed twice or more, at least once, and never.Medium5GeometryBrute force+1No attempts yet1s128 MBJudgeable
Opening the SafeDecide for each given quadruple of digits whether its four numbers can be combined with arithmetic operations and parentheses to make 24.Medium5BacktrackingBrute forceNo attempts yet1s128 MBJudgeable
Freeing Up CapacityChoose RAID-1 sets to convert so the gained capacity reaches e GB while the total size of converted sets is minimal.Medium5Dynamic programmingNo attempts yet2s512 MBJudgeable
RoadDecide whether the road between p and q can belong to a cheapest network that connects all cities.Medium5Minimum spanning treeUnion-find+1No attempts yet2s64 MBJudgeable
Cracking the CodeGiven a plaintext and ciphertext candidates under a substitution cipher, keep every consistent match and decrypt X, printing '?' for ambiguous letters.Medium5String matchingBrute force+1No attempts yet2s128 MBJudgeable
Unidentified DestinationList the candidate destinations whose shortest route from s passes through the road between g and h.Medium5Shortest pathGraphNo attempts yet3s256 MBJudgeable
Wrestling Team SelectionSplit up to 100 wrestlers into two teams of nearly equal size so the total weights differ as little as possible.Medium5Dynamic programmingNo attempts yet1s128 MBJudgeable
VirologyDecide for each 14-gene sample whether the genes split into four triples or runs plus one pair.Medium5BacktrackingBrute forceNo attempts yet3s128 MBJudgeable
Adding NumbersSplit the given digits into two numbers with no leading zero so their sum is as small as possible.Medium5Brute forceSorting+1No attempts yet1s128 MBJudgeable
Energy TycoonPlace each offered one-slot or two-slot plant on an n-slot board, removing blocking plants when full, to maximize the total plant count summed over all turns.Medium5GreedySimulationNo attempts yet2s256 MBJudgeable
Permutation GraphGiven two permutations of 1 to n drawn on two parallel lines, count the pairs of segments joining equal numbers that cross.Medium5Divide and conquerSortingNo attempts yet5s256 MBJudgeable
Term ProjectEach student picks exactly one partner, only directed cycles form teams, so count the students outside all cycles.Medium5DFSGraphNo attempts yet3s256 MBJudgeable
SleepyGiven the word seen after X shuffles that weave the back half into the front half, recover the original word.Medium5SimulationMath+1No attempts yet1s256 MBJudgeable
Counting Ones in a RangeAdd up the number of 1 bits in the binary form of every integer from A to B.Medium5Bit manipulationMathNo attempts yet1s128 MBJudgeable
Encrypted passwordDecide whether the original password's letters can be rearranged to match a contiguous block inside the encrypted password.Medium5Sliding windowHash map+1No attempts yet2s128 MBJudgeable
Crowded CowsCount cows that have a cow at least twice as tall within distance D on both the left and the right.Medium5Sliding windowSorting+1No attempts yet1s128 MBJudgeable
The Alphabet StickerCount completions of a sticker pattern where each question mark becomes a visible letter and every letter forms one contiguous block.Medium5CombinatoricsStringNo attempts yet1s128 MBJudgeable
Omar's BugFor each query with N, X and a flag, build the lexicographically smallest sorted array that makes the buggy lower bound return a right or wrong answer.Medium5Binary searchGreedyNo attempts yet1s128 MBJudgeable
N-QueenCount the ways to place N non-attacking queens on an N by N board for N under 15.Medium5BacktrackingBit manipulationNo attempts yet10s128 MBJudgeable
Find the MarblesGiven up to 99 distinct integer points per test case, report the largest number of points that lie on one straight line.Medium5GeometryHash mapNo attempts yet1s128 MBJudgeable
LightsYou press switches that flip the rectangle from the origin to the switch and need the fewest presses to turn every bulb on.Medium5GreedyPrefix sumNo attempts yet1s128 MBJudgeable
Prefix-Free SubsetsCount the subsets of the given word set in which no word is a prefix of another word.Medium5TrieDynamic programming+1No attempts yet1s128 MBJudgeable
Alike TablesDecide whether two tables with distinct entries match after any row and column reorderings.Medium5Hash mapMatrixNo attempts yet1s128 MBJudgeable
Minimum Cost SortingFind the cheapest total of moved values needed to sort the array when moving one element to any position costs its value.Medium5Dynamic programmingSortingNo attempts yet1s128 MBJudgeable
Mod-3 PermutationCount entries by index and value residues mod 3, fix directly swappable pairs first, then resolve each leftover triple with two swaps.Medium5GreedyMath+1No attempts yet1s128 MBJudgeable
Search SuggestionFor each typed prefix, print the three highest-scoring matching cities, or the match count when more than 1000 names match.Medium5Binary searchString+1No attempts yet1s128 MBJudgeable
2D Max FilterFor every cell of an R by C grid, output the maximum value inside the rectangular window centered on that cell, clipped at the borders.Medium5Sliding windowQueue+1No attempts yet1s128 MBJudgeable
Cut the ListSplit the list into K consecutive pieces to minimize the sum of each piece's max minus min.Medium5Dynamic programmingIntervalsNo attempts yet2s128 MBJudgeable
Make the target from four numbersDecide whether the first four integers can form the fifth using each exactly once with +, -, *, / and parentheses.Medium5Brute forceBacktracking+1No attempts yet1s128 MBJudgeable
Number of LocksCount length-n strings over heights 1 to 4 that use at least three distinct heights and have an adjacent pair differing by exactly 3.Medium5Dynamic programmingCombinatoricsNo attempts yet1s128 MBJudgeable
Global WarmingGiven column heights, find the greatest number of maximal above-water runs over all real sea levels.Medium5Union-findSorting+1No attempts yet2s512 MBJudgeable
InvestChoose one of five products to buy each month, respecting minimum holding periods, to maximize the total resale value at the end.Medium5Dynamic programmingNo attempts yet2s512 MBJudgeable
HoleFind the side length of the largest all-zero square in an n by n binary grid given by the positions of its ones.Medium5Dynamic programmingMatrixNo attempts yet2s512 MBJudgeable
Milk SchedulingSchedule at most one cow per time unit before its deadline to maximize total gallons of milk.Medium5GreedyHeap+1No attempts yet1s128 MBJudgeable
Cow BaseballCount triples of cows in increasing position whose second gap is at least the first gap and at most twice it.Medium5Two pointersSortingNo attempts yet1s128 MBJudgeable
Recording the MoolympicsSelect the largest set of programs that two tuners can record when one tuner cannot record overlapping programs.Medium5GreedySorting+1No attempts yet1s128 MBJudgeable
MatrixFind row addition counts from 0 to 9 that turn matrix A into B with matching column subtraction counts and the smallest row digit string.Medium5MatrixMath+1No attempts yet2s512 MBJudgeable
CarpetFind the largest area axis-aligned rectangle covering only clear cells in a grid with pillars.Medium5StackMatrixNo attempts yet2s1024 MBJudgeable
Electronic Road Pricing (ERP)Find the cheapest route on a grid of roads where going straight is free, left turns cost 1, right turns cost 5, and dead-end U-turns cost 10.Medium5Shortest pathGraph+1No attempts yet2s1024 MBJudgeable
Shortest Sailing TimeFind the cheapest route from the top-left to the bottom-right of a cost grid where each turn adds 3.Medium5Shortest pathGraph+1No attempts yet1s128 MBJudgeable
String ExplosionRepeatedly delete every occurrence of the explosion string until none remains, printing FRULA when nothing is left.Medium5StackString matchingNo attempts yet2s128 MBJudgeable
One Move from Towers of HanoiGiven n disks and an index k, report the disk and the source and destination posts of the kth move in the classic recursive Hanoi solution.Medium5RecursionBit manipulation+1No attempts yet3s128 MBJudgeable
Stacking BlocksReshape both towers into the V-shaped skyline with center height h at the lowest total cost of added and removed blocks.Medium5SortingPrefix sum+1No attempts yet1s128 MBJudgeable
OdometerCount the integers between X and Y whose decimal digits use one repeated digit except for a single different digit.Medium5Brute forceCombinatoricsNo attempts yet1s128 MBJudgeable
Fair PhotographyAfter sorting cows by position, find the widest interval with equal numbers of G and H cows, where single-breed intervals also count.Medium5Prefix sumHash map+1No attempts yet1s128 MBJudgeable
Club ScheduleCount attendance and key-passing schedules over N days where each day's leader attends and the key stays with attendees.Medium5Dynamic programmingCombinatoricsNo attempts yet1s128 MBJudgeable
BaumkuchenSplit the circular cake into three contiguous pieces so the smallest piece is as large as possible.Medium5Binary searchTwo pointers+1No attempts yet2s256 MBJudgeable
VacationFrom a start city on a line with a fixed day budget where each move or city visit costs one day, pick the contiguous block with the most attractions.Medium5Two pointersPrefix sum+1No attempts yet5s64 MBJudgeable
SightseeingFrom node 1, route each destination along roads to make the weakest road on the path as strong as possible.Medium5HeapMinimum spanning tree+1No attempts yet3.5s512 MBJudgeable
Fuleco and the AntGiven positions A and B and a U/D string encoding depth changes along a tree walk, output the tree distance between the two forks.Medium5TreePrefix sum+1No attempts yet1s64 MBJudgeable
Where's That Fuel?Starting with planet P's fuel, repeatedly visit affordable planets to maximize final fuel, then the number of visits.Medium5GreedySorting+1No attempts yet2s256 MBJudgeable
Salad BarFind the longest contiguous block of apples and oranges where oranges never fall behind apples when added from either end.Medium5Prefix sumStack+1No attempts yet3s256 MBJudgeable
Market ShoppingYou choose exactly k prices per query to maximize the odd total, printing -1 when no odd sum exists.Medium5GreedySorting+1No attempts yet10s256 MBJudgeable
Opening CeremonyGiven each block height, find the fewest charges that clear all blocks with whole-block shots and level-wide shots.Medium5SortingGreedyNo attempts yet1s256 MBJudgeable
Clock PhotosDecide whether two sets of hand angles on a dial coincide after rotating one photo.Medium5SortingString matchingNo attempts yet1s256 MBJudgeable
EquatorEach test case gives city profits around a circle and asks for the most profitable contiguous block, or zero when all are losses.Medium5Dynamic programmingArrayNo attempts yet1s256 MBJudgeable
Word SearchFind each listed word in the letter grid in any of eight directions and output leftover letters, or report missing or ambiguous placements.Medium5String matchingMatrix+1No attempts yet1s256 MBJudgeable
ShopsPick cells with no shared side in an N by 5 profit grid to maximize the summed profit.Medium5Dynamic programmingBit manipulationNo attempts yet2s256 MBJudgeable
The Kth Anagram in Alphabetical OrderGiven a word and rank K, print the Kth distinct anagram of the word in alphabetical order.Medium5CombinatoricsStringNo attempts yet1s256 MBJudgeable
FrameYou must answer YES or NO for each of N bar lengths based on whether bars of that length tile the one-cell-thick X by Y frame.Medium5MathBrute forceNo attempts yet5s256 MBJudgeable
Intrepid climberStarting from the root of a weighted tree, visit all marked nodes with free descents and costly climbs at minimum total energy.Medium5TreeDFS+1No attempts yet3s256 MBJudgeable
DebtFor every group size M, choose M loans to minimize M times the largest chosen loan minus their sum, and output the total of these minima.Medium5SortingPrefix sumNo attempts yet1s256 MBJudgeable
Preorder TraversalsDecide whether each given number list is the preorder traversal of some binary search tree.Medium5StackTreeNo attempts yet1s256 MBJudgeable
Travel CardGiven daily bus and train ride counts, compute the cheapest mix of single fares and 1, 7, and 30 day bus and travel passes.Medium5Dynamic programmingPrefix sumNo attempts yet1s256 MBJudgeable
Erratic AntsGiven a recorded walk on a grid, find the fewest steps from start to end using only walked edges or their reverses.Medium5BFSGraph+1No attempts yet2s256 MBJudgeable
A Walk TogetherTwo walkers follow turn-by-turn routes on a grid, and you compute the most blocks they can walk together by waiting and matching identical directed blocks.Medium5Dynamic programmingSimulationNo attempts yet1s256 MBJudgeable
Cent SavingsSplit up to 2000 item prices in order into at most d+1 consecutive groups so the sum of each group rounded to the nearest 10 cents is smallest.Medium5Dynamic programmingPrefix sumNo attempts yet5s512 MBJudgeable