Curated sets
Interview core
The mediums that show up in real onsite loops.
Total results1,547 problems
| Topics | Judge | |||||
|---|---|---|---|---|---|---|
| More Garden TroublesFind the fewest flamethrower shots that clear every plot when each shot halves a plot and its two neighbors, rounding down. | Medium5 | GreedyMath+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Poetry with an AsteriskCount for each one-asterisk query how many dictionary words start with its prefix and end with its suffix without overlap. | Medium5 | Hash mapString | No attempts yet | 5s | 128 MB | Judgeable |
| BoardsFrom the smallest power of two at least K, find the fewest board halvings so some pieces sum to exactly K. | Medium5 | Bit manipulationGreedy | No attempts yet | 1s | 128 MB | Judgeable |
| 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. | Medium5 | GreedySorting+1 | No attempts yet | 5s | 128 MB | Judgeable |
| 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. | Medium5 | GreedyString | No attempts yet | 1s | 128 MB | Judgeable |
| Neon SignCount the triples of vertices whose three connecting tubes all share the same color in a red-blue complete graph. | Medium5 | CombinatoricsGraph | No attempts yet | 3s | 256 MB | Judgeable |
| MCSCount every length-k substring of a DNA string by its letter composition and report the size of the largest group. | Medium5 | Sliding windowHash map | No attempts yet | 5s | 128 MB | Judgeable |
| SalesmenGiven a graph and a reported vertex sequence, find the fewest entries to change so consecutive vertices stay put or follow an edge. | Medium5 | Dynamic programmingGraph | No attempts yet | 1s | 128 MB | Judgeable |
| SymmetryDecide whether the given dots mirror exactly across some vertical line, printing YES or NO for each test case. | Medium5 | Hash mapGeometry+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Graceful Prime DecompositionCount ordered sums of N from primes up to K where no two neighboring primes are equal. | Medium5 | Dynamic programmingNumber theory | No attempts yet | 1s | 128 MB | Judgeable |
| Math NotebookChoose a contiguous block from both sequences to maximize its dot product with the reversed second block. | Medium5 | Brute forceArray | No attempts yet | 1s | 128 MB | Judgeable |
| Parcel DeliveryChoose how many boxes of each shipment to load onto a one-way truck of capacity C to maximize total delivered boxes. | Medium5 | GreedySorting | No attempts yet | 1s | 128 MB | Judgeable |
| TaekwondoSort both weight lists and pair players to minimize the total absolute weight difference across all matches. | Medium5 | Dynamic programmingSorting | No attempts yet | 1s | 128 MB | Judgeable |
| BridgeFind the bridge height that minimizes the total crossing distance over every pair of left and right houses. | Medium5 | SortingMath | No attempts yet | 3s | 128 MB | Judgeable |
| Canoe AthletesPick one weight from each of four lists so the total is closest to the target, preferring the smaller total on ties. | Medium5 | Binary searchSorting+1 | No attempts yet | 3s | 256 MB | Judgeable |
| OrderRecover the permutation from counts of smaller previous elements, printing IMPOSSIBLE when the counts allow no permutation. | Medium5 | SimulationMath | No attempts yet | 1s | 128 MB | Judgeable |
| Sum of Two NumbersCount the pairs of distinct given integers whose sum has the smallest absolute difference from K. | Medium5 | Two pointersSorting | No attempts yet | 1s | 128 MB | Judgeable |
| Widest PathFind the path between two given nodes whose smallest edge weight is as large as possible. | Medium5 | Minimum spanning treeUnion-find+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Message BroadcastingCompute the fewest rounds to spread a message from the root when each informed node calls at most one child per round. | Medium5 | GreedyTree+2 | No attempts yet | 1s | 128 MB | Judgeable |
| 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. | Medium5 | GreedySorting | No attempts yet | 1s | 128 MB | Judgeable |
| MinesweeperCount the largest possible number of second-row mines, including the marked ones, that fits the first-row digit clues. | Medium5 | BacktrackingBrute force | No attempts yet | 1s | 128 MB | Judgeable |
| 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. | Medium5 | GreedySorting | No attempts yet | 1s | 128 MB | Judgeable |
| Tug of WarDecide whether N student weights (4 to 30) split into two teams whose total strengths differ by at most X. | Medium5 | Dynamic programming | No attempts yet | 1s | 128 MB | Judgeable |
| Tiling Up BlocksFind the largest subset of blocks that stacks so both knob counts never decrease from bottom to top. | Medium5 | Dynamic programmingSorting | No attempts yet | 1s | 128 MB | Judgeable |
| 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. | Medium5 | GreedyTwo pointers | No attempts yet | 1s | 128 MB | Judgeable |
| 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. | Medium5 | BFSShortest path+2 | No attempts yet | 1s | 128 MB | Judgeable |
| 77377Split a digit string into dictionary words whose telephone-keypad encoding matches each segment. | Medium5 | Dynamic programmingTrie+1 | No attempts yet | 1s | 128 MB | Judgeable |
| No Left TurnsFind the shortest path from start to finish in a maze where each step goes straight ahead or turns right. | Medium5 | BFSShortest path+1 | No attempts yet | 1s | 128 MB | Judgeable |
| The First TermTrace each given term backward through the reverse look-and-say rule until it reaches its earliest valid ancestor. | Medium5 | SimulationString | No attempts yet | 1s | 128 MB | Judgeable |
| Road TripBuy and resell fuel at each town's price within tank capacity to complete every leg of each journey at minimum cost. | Medium5 | Greedy | No attempts yet | 1s | 128 MB | Judgeable |
| Count Values in a Sorted MatrixCount entries in each query range [X, Y] inside a matrix whose rows and columns are sorted ascending. | Medium5 | Binary searchMatrix | No attempts yet | 15s | 512 MB | Judgeable |
| 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. | Medium5 | Dynamic programming | No attempts yet | 3s | 128 MB | Judgeable |
| Frozen SprinklersCut pipes with minimum total force so no water flows from the central node to any leaf sprinkler in the tree. | Medium5 | Dynamic programmingTree+1 | No attempts yet | 3s | 128 MB | Judgeable |
| 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. | Medium5 | GeometryBrute force+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Opening the SafeDecide for each given quadruple of digits whether its four numbers can be combined with arithmetic operations and parentheses to make 24. | Medium5 | BacktrackingBrute force | No attempts yet | 1s | 128 MB | Judgeable |
| Freeing Up CapacityChoose RAID-1 sets to convert so the gained capacity reaches e GB while the total size of converted sets is minimal. | Medium5 | Dynamic programming | No attempts yet | 2s | 512 MB | Judgeable |
| RoadDecide whether the road between p and q can belong to a cheapest network that connects all cities. | Medium5 | Minimum spanning treeUnion-find+1 | No attempts yet | 2s | 64 MB | Judgeable |
| Cracking the CodeGiven a plaintext and ciphertext candidates under a substitution cipher, keep every consistent match and decrypt X, printing '?' for ambiguous letters. | Medium5 | String matchingBrute force+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Unidentified DestinationList the candidate destinations whose shortest route from s passes through the road between g and h. | Medium5 | Shortest pathGraph | No attempts yet | 3s | 256 MB | Judgeable |
| Wrestling Team SelectionSplit up to 100 wrestlers into two teams of nearly equal size so the total weights differ as little as possible. | Medium5 | Dynamic programming | No attempts yet | 1s | 128 MB | Judgeable |
| VirologyDecide for each 14-gene sample whether the genes split into four triples or runs plus one pair. | Medium5 | BacktrackingBrute force | No attempts yet | 3s | 128 MB | Judgeable |
| Adding NumbersSplit the given digits into two numbers with no leading zero so their sum is as small as possible. | Medium5 | Brute forceSorting+1 | No attempts yet | 1s | 128 MB | Judgeable |
| 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. | Medium5 | GreedySimulation | No attempts yet | 2s | 256 MB | Judgeable |
| Permutation GraphGiven two permutations of 1 to n drawn on two parallel lines, count the pairs of segments joining equal numbers that cross. | Medium5 | Divide and conquerSorting | No attempts yet | 5s | 256 MB | Judgeable |
| Term ProjectEach student picks exactly one partner, only directed cycles form teams, so count the students outside all cycles. | Medium5 | DFSGraph | No attempts yet | 3s | 256 MB | Judgeable |
| SleepyGiven the word seen after X shuffles that weave the back half into the front half, recover the original word. | Medium5 | SimulationMath+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Counting Ones in a RangeAdd up the number of 1 bits in the binary form of every integer from A to B. | Medium5 | Bit manipulationMath | No attempts yet | 1s | 128 MB | Judgeable |
| Encrypted passwordDecide whether the original password's letters can be rearranged to match a contiguous block inside the encrypted password. | Medium5 | Sliding windowHash map+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Crowded CowsCount cows that have a cow at least twice as tall within distance D on both the left and the right. | Medium5 | Sliding windowSorting+1 | No attempts yet | 1s | 128 MB | Judgeable |
| The Alphabet StickerCount completions of a sticker pattern where each question mark becomes a visible letter and every letter forms one contiguous block. | Medium5 | CombinatoricsString | No attempts yet | 1s | 128 MB | Judgeable |
| 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. | Medium5 | Binary searchGreedy | No attempts yet | 1s | 128 MB | Judgeable |
| N-QueenCount the ways to place N non-attacking queens on an N by N board for N under 15. | Medium5 | BacktrackingBit manipulation | No attempts yet | 10s | 128 MB | Judgeable |
| Find the MarblesGiven up to 99 distinct integer points per test case, report the largest number of points that lie on one straight line. | Medium5 | GeometryHash map | No attempts yet | 1s | 128 MB | Judgeable |
| LightsYou press switches that flip the rectangle from the origin to the switch and need the fewest presses to turn every bulb on. | Medium5 | GreedyPrefix sum | No attempts yet | 1s | 128 MB | Judgeable |
| Prefix-Free SubsetsCount the subsets of the given word set in which no word is a prefix of another word. | Medium5 | TrieDynamic programming+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Alike TablesDecide whether two tables with distinct entries match after any row and column reorderings. | Medium5 | Hash mapMatrix | No attempts yet | 1s | 128 MB | Judgeable |
| Minimum Cost SortingFind the cheapest total of moved values needed to sort the array when moving one element to any position costs its value. | Medium5 | Dynamic programmingSorting | No attempts yet | 1s | 128 MB | Judgeable |
| Mod-3 PermutationCount entries by index and value residues mod 3, fix directly swappable pairs first, then resolve each leftover triple with two swaps. | Medium5 | GreedyMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Search SuggestionFor each typed prefix, print the three highest-scoring matching cities, or the match count when more than 1000 names match. | Medium5 | Binary searchString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| 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. | Medium5 | Sliding windowQueue+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Cut the ListSplit the list into K consecutive pieces to minimize the sum of each piece's max minus min. | Medium5 | Dynamic programmingIntervals | No attempts yet | 2s | 128 MB | Judgeable |
| Make the target from four numbersDecide whether the first four integers can form the fifth using each exactly once with +, -, *, / and parentheses. | Medium5 | Brute forceBacktracking+1 | No attempts yet | 1s | 128 MB | Judgeable |
| 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. | Medium5 | Dynamic programmingCombinatorics | No attempts yet | 1s | 128 MB | Judgeable |
| Global WarmingGiven column heights, find the greatest number of maximal above-water runs over all real sea levels. | Medium5 | Union-findSorting+1 | No attempts yet | 2s | 512 MB | Judgeable |
| InvestChoose one of five products to buy each month, respecting minimum holding periods, to maximize the total resale value at the end. | Medium5 | Dynamic programming | No attempts yet | 2s | 512 MB | Judgeable |
| HoleFind the side length of the largest all-zero square in an n by n binary grid given by the positions of its ones. | Medium5 | Dynamic programmingMatrix | No attempts yet | 2s | 512 MB | Judgeable |
| Milk SchedulingSchedule at most one cow per time unit before its deadline to maximize total gallons of milk. | Medium5 | GreedyHeap+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Cow BaseballCount triples of cows in increasing position whose second gap is at least the first gap and at most twice it. | Medium5 | Two pointersSorting | No attempts yet | 1s | 128 MB | Judgeable |
| Recording the MoolympicsSelect the largest set of programs that two tuners can record when one tuner cannot record overlapping programs. | Medium5 | GreedySorting+1 | No attempts yet | 1s | 128 MB | Judgeable |
| 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. | Medium5 | MatrixMath+1 | No attempts yet | 2s | 512 MB | Judgeable |
| CarpetFind the largest area axis-aligned rectangle covering only clear cells in a grid with pillars. | Medium5 | StackMatrix | No attempts yet | 2s | 1024 MB | Judgeable |
| 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. | Medium5 | Shortest pathGraph+1 | No attempts yet | 2s | 1024 MB | Judgeable |
| Shortest Sailing TimeFind the cheapest route from the top-left to the bottom-right of a cost grid where each turn adds 3. | Medium5 | Shortest pathGraph+1 | No attempts yet | 1s | 128 MB | Judgeable |
| String ExplosionRepeatedly delete every occurrence of the explosion string until none remains, printing FRULA when nothing is left. | Medium5 | StackString matching | No attempts yet | 2s | 128 MB | Judgeable |
| 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. | Medium5 | RecursionBit manipulation+1 | No attempts yet | 3s | 128 MB | Judgeable |
| Stacking BlocksReshape both towers into the V-shaped skyline with center height h at the lowest total cost of added and removed blocks. | Medium5 | SortingPrefix sum+1 | No attempts yet | 1s | 128 MB | Judgeable |
| OdometerCount the integers between X and Y whose decimal digits use one repeated digit except for a single different digit. | Medium5 | Brute forceCombinatorics | No attempts yet | 1s | 128 MB | Judgeable |
| Fair PhotographyAfter sorting cows by position, find the widest interval with equal numbers of G and H cows, where single-breed intervals also count. | Medium5 | Prefix sumHash map+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Club ScheduleCount attendance and key-passing schedules over N days where each day's leader attends and the key stays with attendees. | Medium5 | Dynamic programmingCombinatorics | No attempts yet | 1s | 128 MB | Judgeable |
| BaumkuchenSplit the circular cake into three contiguous pieces so the smallest piece is as large as possible. | Medium5 | Binary searchTwo pointers+1 | No attempts yet | 2s | 256 MB | Judgeable |
| 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. | Medium5 | Two pointersPrefix sum+1 | No attempts yet | 5s | 64 MB | Judgeable |
| SightseeingFrom node 1, route each destination along roads to make the weakest road on the path as strong as possible. | Medium5 | HeapMinimum spanning tree+1 | No attempts yet | 3.5s | 512 MB | Judgeable |
| 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. | Medium5 | TreePrefix sum+1 | No attempts yet | 1s | 64 MB | Judgeable |
| Where's That Fuel?Starting with planet P's fuel, repeatedly visit affordable planets to maximize final fuel, then the number of visits. | Medium5 | GreedySorting+1 | No attempts yet | 2s | 256 MB | Judgeable |
| Salad BarFind the longest contiguous block of apples and oranges where oranges never fall behind apples when added from either end. | Medium5 | Prefix sumStack+1 | No attempts yet | 3s | 256 MB | Judgeable |
| Market ShoppingYou choose exactly k prices per query to maximize the odd total, printing -1 when no odd sum exists. | Medium5 | GreedySorting+1 | No attempts yet | 10s | 256 MB | Judgeable |
| Opening CeremonyGiven each block height, find the fewest charges that clear all blocks with whole-block shots and level-wide shots. | Medium5 | SortingGreedy | No attempts yet | 1s | 256 MB | Judgeable |
| Clock PhotosDecide whether two sets of hand angles on a dial coincide after rotating one photo. | Medium5 | SortingString matching | No attempts yet | 1s | 256 MB | Judgeable |
| EquatorEach test case gives city profits around a circle and asks for the most profitable contiguous block, or zero when all are losses. | Medium5 | Dynamic programmingArray | No attempts yet | 1s | 256 MB | Judgeable |
| Word SearchFind each listed word in the letter grid in any of eight directions and output leftover letters, or report missing or ambiguous placements. | Medium5 | String matchingMatrix+1 | No attempts yet | 1s | 256 MB | Judgeable |
| ShopsPick cells with no shared side in an N by 5 profit grid to maximize the summed profit. | Medium5 | Dynamic programmingBit manipulation | No attempts yet | 2s | 256 MB | Judgeable |
| The Kth Anagram in Alphabetical OrderGiven a word and rank K, print the Kth distinct anagram of the word in alphabetical order. | Medium5 | CombinatoricsString | No attempts yet | 1s | 256 MB | Judgeable |
| 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. | Medium5 | MathBrute force | No attempts yet | 5s | 256 MB | Judgeable |
| Intrepid climberStarting from the root of a weighted tree, visit all marked nodes with free descents and costly climbs at minimum total energy. | Medium5 | TreeDFS+1 | No attempts yet | 3s | 256 MB | Judgeable |
| 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. | Medium5 | SortingPrefix sum | No attempts yet | 1s | 256 MB | Judgeable |
| Preorder TraversalsDecide whether each given number list is the preorder traversal of some binary search tree. | Medium5 | StackTree | No attempts yet | 1s | 256 MB | Judgeable |
| 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. | Medium5 | Dynamic programmingPrefix sum | No attempts yet | 1s | 256 MB | Judgeable |
| Erratic AntsGiven a recorded walk on a grid, find the fewest steps from start to end using only walked edges or their reverses. | Medium5 | BFSGraph+1 | No attempts yet | 2s | 256 MB | Judgeable |
| 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. | Medium5 | Dynamic programmingSimulation | No attempts yet | 1s | 256 MB | Judgeable |
| 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. | Medium5 | Dynamic programmingPrefix sum | No attempts yet | 5s | 512 MB | Judgeable |