Curated sets
Interview warm-up
Short whiteboard tasks to get the rust off.
Total results2,493 problems
| Topics | Judge | |||||
|---|---|---|---|---|---|---|
| Factorial BaseRead each factorial-base number, weight digit at position i (from the right, 1-indexed) by i!, and print the decimal value. | Easy2 | MathImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| PangramRead sentences until a line holding a single asterisk, and print Y if a sentence contains all 26 lowercase letters, otherwise N. | Easy2 | StringHash map+1 | No attempts yet | 1s | 128 MB | Judgeable |
| FeynmanFor each N, count all axis-aligned squares contained in an N by N grid of unit cells, ending at the sentinel 0. | Easy2 | MathImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| Head or TailFor each test case, count the zeros and ones in the list of game results and print how many games Mary and John each won. | Easy2 | ImplementationArray+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Pascal LibraryGiven D attendance rows over N alumni, decide whether some alumnus attended every dinner. | Easy2 | ArrayImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Grade StatisticsFor each class, read the scores, then report the maximum, the minimum, and the largest gap between neighboring scores after sorting in descending order. | Easy2 | SortingImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Roll-call in Woop Woop HighRead each class's answers and count pupils into four groups: correct first try, correct late, never correct, and absent. | Easy2 | ImplementationString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Breed ProximityGiven a line of N cows with breed ids, find the largest breed id whose two occurrences lie within K positions of each other, or -1 if none exist. | Easy2 | ArrayHash map+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Contest TimingShe starts at 11:11 on 11/11. Given the day, hour, and minute she stops, print the minutes elapsed, or -1 if the stop is earlier. | Easy2 | MathImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Odd or EvenRead N large integers up to 10^60 and print odd or even for each, judging parity from the last digit. | Easy2 | StringMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Barn EchoesGiven two lowercase strings, find the length of the longest string that is a prefix of one and a suffix of the other. | Easy2 | StringBrute force+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Papaya JungleBessie moves greedily through a grid, always stepping to the adjacent square with the most uneaten papayas, and we sum the fruit she eats until she reaches the bottom-right corner. | Easy2 | SimulationArray+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Scavenger HuntList every pair (x, y) where x divides P and y divides Q, sorted by x then y. | Easy2 | MathBrute force+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Hay ExpensesGiven N daily hay counts and Q ranges, output the sum of counts over each range from S to E inclusive. | Easy2 | Prefix sumArray | No attempts yet | 1s | 128 MB | Judgeable |
| StatisticsRead N integers, print their mean and median rounded to six decimal places. | Easy2 | ArraySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| TV ReportsTrack daily Dollar prices against the previous day and the running all-time high, printing NTV drop headlines and BBTV record headlines in day order. | Easy2 | ImplementationSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| IBM Minus OneFor each of n uppercase names, shift every letter to the next letter of the alphabet, wrapping Z to A, and print the result with numbered headers. | Easy2 | StringImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Color Me LessRead 16 target RGB colors, then map each following color to the nearest target color by Euclidean distance, breaking ties by earliest appearance. | Easy2 | ImplementationBrute force+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Getting ChordedGiven three note names, decide whether their semitone spacing forms a major or minor chord, then print the echo with the root-named chord or "unrecognized". | Easy2 | ImplementationMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Deli DeliFor each of N words, apply the first matching pluralization rule from a list of irregular forms and four suffix rules, then print the result. | Easy2 | StringHash map+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Next in LineGiven the ages of the youngest and middle of three children in an arithmetic sequence, print the oldest child's age. | Easy2 | MathImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| Rotating LettersGiven a single uppercase word, decide whether every letter belongs to the set of seven letters that look the same after a 180-degree rotation. | Easy2 | StringImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Speed fines are not fine!Given a speed limit and a recorded speed, decide whether the car is speeding and print the matching fine from a three-tier table. | Easy2 | ImplementationMath+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Big Bang SecretsDecode an uppercase word by shifting each letter backward by S = 3P + K positions, where P is the letter's 1-based position. | Easy2 | ImplementationString+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Sumac SequencesStarting from two integers, repeatedly replace the pair with (second, first minus second) until the difference turns negative and report how many terms appear. | Easy2 | SimulationMath | No attempts yet | 2s | 512 MB | Judgeable |
| What is n, Daddy?Count the ordered pairs (a, b) with 1 <= b <= a <= 5 and possibly a single hand, summing to n. | Easy2 | MathBrute force+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Computer PurchaseGiven n computers with RAM, CPU speed, and disk values, sort by the score 2R + 3S + D and print the top two names, breaking ties by smaller name. | Easy2 | SortingImplementation | No attempts yet | 2s | 512 MB | Judgeable |
| ISBN 1-3-SumGiven the last three digits of an ISBN starting with 9780921418, compute the 1-3-sum and print it. | Easy2 | MathImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Do the ShuffleSimulate a fixed 5-song playlist through button presses that rotate left, rotate right, or swap the first two songs, then print the final order. | Easy2 | SimulationImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| It's Cold Here!Read city names with integer temperatures, one per line, and print the name of the city with the lowest temperature. | Easy2 | ImplementationArray+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Who is in the middle?Given the weights of three bowls, print the middle value among the three weights. | Easy2 | SortingImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| Deal or No Deal CalculatorRead eliminated case numbers and a Banker's offer, compute the average of the remaining amounts, and print deal if the offer is higher, otherwise no deal. | Easy2 | ImplementationArray+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Anagram CheckerDecide whether two phrases are anagrams, ignoring spaces and letters only. | Easy2 | Hash mapString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| The Cell SellGiven daytime, evening, and weekend minutes, compute the monthly cost under two phone plans and print the cheaper one. | Easy2 | ImplementationMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Snow CallsConvert each alphanumeric phone number to digits, keep the first 10 digits, and print them in xxx-xxx-xxxx form. | Easy2 | StringImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Mouse MoveThe cursor starts at (0,0) on a screen of width c and height r; each relative move is clamped to the screen edges, and the position after every move must be printed. | Easy2 | SimulationImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| SquaresGiven a number of tiles, find the largest integer side length whose square does not exceed that number. | Easy2 | MathImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Terms of OfficePrint every year from X to Y in which all four offices change, which happens on multiples of lcm(4,2,3,5) = 60, formatted as a fixed sentence. | Easy2 | MathImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Smile with SimilesGiven up to five adjectives and five nouns, print every phrase of the form "<adjective> as <noun>" in nested input order. | Easy2 | ImplementationBrute force+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Constrained PermutationsCount permutations of 1..n (n at most 9) that satisfy given ordering constraints x before y. | Easy2 | Brute forceCombinatorics+2 | No attempts yet | 1s | 128 MB | Judgeable |
| AmeriCanadianRead words one per line until the line quit!, and for each word rewrite a trailing consonant followed by or as our when the word has at least five letters. | Easy2 | StringImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Fraction ActionReduce a numerator and denominator to simplest form, then print it as a whole number, a proper fraction, or a mixed number. | Easy2 | MathNumber theory+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Dressing UpRead an odd height H and print a bow tie of H rows where each side widens as rows approach the middle. | Easy2 | ImplementationSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| CalendarGiven the weekday of the 1st and the number of days, print a month calendar in a fixed weekly layout with right-aligned columns. | Easy2 | ImplementationSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Shift LettersFor each test case, rotate the letters of a word right by n positions and print the result in a fixed sentence format. | Easy2 | StringImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| AnagramsGiven two lowercase words, decide whether one can be rearranged into the other, and print the result with the words. | Easy2 | StringHash map+1 | No attempts yet | 1s | 128 MB | Judgeable |
| StringCollapse every run of identical consecutive letters in a lowercase string into a single letter and print the result. | Easy2 | StringImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| NonogramGiven a grid of black and white squares, print the lengths of the consecutive black blocks in each row and then each column. | Easy2 | ImplementationArray+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| NumbersGiven three distinct digits and one of their six permutations, find that number's 1-based rank when all six permutations are sorted ascending. | Easy2 | MathSorting+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| Building BlocksGiven a target height N and three block heights, pick the kind whose multiples get closest to N, breaking ties by smaller block then shorter tower. | Easy2 | MathBrute force | No attempts yet | 1s | 1024 MB | Judgeable |
| CardsA 52-card deck is missing exactly one card; given the other 51 cards as suit and value pairs, output the missing suit and value. | Easy2 | ArrayHash map+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| The Worm TurnsSimulate a 20-cell worm on a 50x50 grid through a list of moves, stopping when it hits itself, leaves the board, or finishes. | Easy2 | SimulationImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Counting SheepCount how many words in each list match the string "sheep" exactly, case-sensitive, and print the count per list with blank lines between cases. | Easy2 | StringImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| EntropyRead one line of text, count how often each character appears, and print the Shannon entropy rounded to three decimals. | Easy2 | Hash mapMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Right Triangle CheckFor each of n triples of side lengths, decide whether the triangle is right by checking if the largest side squared equals the sum of the other two squared. | Easy2 | MathGeometry+2 | No attempts yet | 1s | 128 MB | Judgeable |
| GaussFor each test case, compute the sum of all integers from n to m inclusive and print the test case number followed by the sum. | Easy2 | MathImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| ExerciseFor each machine, multiply each exercise level's energy rate by its duration and sum the totals per person. | Easy2 | SimulationImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| TeleprimeGiven a six-digit number and a digit to prepend, print Yes if both the original and the resulting seven-digit number are prime. | Easy2 | Number theoryMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Ways to Make RectanglesCount the number of unordered pairs (a, b) with a <= b and a*b <= n. | Easy2 | MathBrute force+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Ant NamesGiven up to 100 lowercase names, print the maximum number of distinct letters found in any single name. | Easy2 | StringImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Rhyming VersesCount pairs of lines with the same number of vowels and identical last k letters ignoring spaces. | Easy2 | StringImplementation | No attempts yet | 1s | 512 MB | Judgeable |
| ParkFor each of up to one million heights in order, output the maximum height to its west and to its east, using its own height when no higher point exists. | Easy2 | Prefix sumArray | No attempts yet | 1s | 512 MB | Judgeable |
| Bagels on a StickSlide a chosen bagel off one end of the stick after removing the fewest bagels it cannot slide through. | Easy2 | Array | No attempts yet | 1s | 512 MB | Judgeable |
| Hidden NumberSum every maximal run of digits in a word of letters and digits, ignoring leading zeros. | Easy2 | StringImplementation | No attempts yet | 1s | 256 MB | Judgeable |
| Caesar CipherDecode a Caesar-shifted uppercase message by matching its most frequent letter to the given original letter. | Easy2 | StringArray+1 | No attempts yet | 1s | 512 MB | Judgeable |
| Sums and DifferencesCount ordered pairs from distinct positions where the difference exceeds the sum, which holds exactly when the second element is negative. | Easy2 | MathCombinatorics | No attempts yet | 1s | 128 MB | Judgeable |
| Step on the FootKozik and Adrian alternately shorten the gap by their foot lengths, and the first player facing a gap shorter than his foot wins. | Easy2 | Math | No attempts yet | 1s | 128 MB | Judgeable |
| Dividing the Chocolate BarTwo brothers split an a by b chocolate bar with one straight cut so the two pieces differ in area as little as possible. | Easy2 | Math | No attempts yet | 1s | 128 MB | Judgeable |
| Overlapping Rectangle AreaGiven two axis-aligned rectangles, compute the area of their overlapping region. | Easy2 | Geometry | No attempts yet | 1s | 128 MB | Judgeable |
| Ranking ManipulationChoose weights on the tasks you solved so you finish first, then count the contestants tied with you. | Easy2 | ArrayImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| Making Grid PaperPick the sheet that yields the most grid cells under the margin and spacing rules, breaking ties by area, and output its area. | Easy2 | MathImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| ThumbtacksFind the smallest jump that crosses the bridge using only planks without thumbtacks. | Easy2 | Array | No attempts yet | 1s | 128 MB | Judgeable |
| ChessEach row holds at most one rook, so take the largest value in every row with a positive maximum and add them. | Easy2 | GreedyArray | No attempts yet | 1s | 128 MB | Judgeable |
| Pear Trees and Apple TreesFind the largest distance between any pear tree and any apple tree in a row of n trees. | Easy2 | Array | No attempts yet | 1s | 128 MB | Judgeable |
| MondaysGiven year length N, week length M, and starting weekday L, count the days from 1 to N that fall on the first weekday. | Easy2 | Math | No attempts yet | 1s | 128 MB | Judgeable |
| KaraokeCount the starting positions where the next K characters of the song string are all vowels. | Easy2 | Sliding windowString | No attempts yet | 2s | 128 MB | Judgeable |
| Palindrome ColoringSplit each A/B string into the fewest palindromic subsequences and output that count. | Easy2 | StringTwo pointers | No attempts yet | 1s | 128 MB | Judgeable |
| Rock Paper ScissorsCompare the two players' winning chances from their move probabilities and print who is more likely to win each match. | Easy2 | ProbabilityMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Shoe FactoryChoose the price p from 1 to N that maximizes the count of buyers willing to pay p times the margin p minus K. | Easy2 | Prefix sumBrute force | No attempts yet | 1s | 128 MB | Judgeable |
| BookmakersDecide whether stakes on both match outcomes can guarantee a profit given decimal odds X and Y. | Easy2 | Math | No attempts yet | 1s | 128 MB | Judgeable |
| Rock Paper ScissorsSimulate k rounds of rock-paper-scissors across N robots, removing round losers until one robot remains or all rounds end in a draw. | Easy2 | Simulation | No attempts yet | 1s | 128 MB | Judgeable |
| TurtleSimulate the turtle's moves from the origin and report the area of the axis-aligned bounding box of its path. | Easy2 | Simulation | No attempts yet | 1s | 128 MB | Judgeable |
| SalesFor each test case, count pairs of days where the earlier day sold no more than the later day and print the total. | Easy2 | Brute forceArray | No attempts yet | 1s | 128 MB | Judgeable |
| Careless AdditionAdd two integers digit by digit from the right with no carries and print the column sums in order. | Easy2 | ImplementationString | No attempts yet | 1s | 128 MB | Judgeable |
| TrainPassengers board in order into the non-full car with the fewest same-initial riders, ties broken by load then car number, and the program prints each car count. | Easy2 | SimulationArray | No attempts yet | 1s | 128 MB | Judgeable |
| Olympic Country RankingCount how many countries beat country K on gold, then silver, then bronze medals, and report its rank. | Easy2 | SortingArray | No attempts yet | 1s | 128 MB | Judgeable |
| Old BillGiven N and middle digits XYZ, fill in the first and last digits of the five-digit total so N divides it, choosing the largest valid total. | Easy2 | Brute forceMath | No attempts yet | 1s | 128 MB | Judgeable |
| ClockFind the time with the median clock-hand angle among five given times, breaking angle ties by earlier time. | Easy2 | MathSorting+1 | No attempts yet | 1s | 128 MB | Judgeable |
| DisplayFit the words of a space-separated text into the fewest rows of width w, breaking a row only when the next word does not fit. | Easy2 | GreedySimulation | No attempts yet | 1s | 128 MB | Judgeable |
| Tidying the Banquet TablesFour teams sit mixed across four tables, and you assign one team to each table so the fewest guests move. | Easy2 | Brute forceMatrix | No attempts yet | 1s | 128 MB | Judgeable |
| Mathematical CuriosityCount pairs 0<a<b<n where a squared plus b squared plus m is divisible by a times b. | Easy2 | Brute forceMath | No attempts yet | 1s | 128 MB | Judgeable |
| Sir Bedavere's Bogus DivisionPrint every three-digit fraction with numerator in L to R that keeps its value after erasing the shared digit. | Easy2 | Brute forceMath | No attempts yet | 1s | 128 MB | Judgeable |
| Consecutive Digits in a Rational NumberReport the base-7 digits in positions f through l after the point for the fraction n over d. | Easy2 | SimulationMath | No attempts yet | 1s | 128 MB | Judgeable |
| Pig LatinConvert each word to Pig Latin by moving leading consonants to the end and appending ay. | Easy2 | StringSimulation | No attempts yet | 1s | 128 MB | Judgeable |
| Crossword Puzzle Clue NumberingScan the letter grid, number each square that starts an across or down word, and list every entry number with its letter count. | Easy2 | SimulationMatrix+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Winning at tic-tac-toeTry each empty cell on the 3x3 board and print the board with the smallest winning move filled. | Easy2 | Brute forceImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| Painting PartyPaint up to 100 filled or one-pixel-border rectangles in order on an N by N grid and print the final colors. | Easy2 | SimulationMatrix | No attempts yet | 5s | 128 MB | Judgeable |
| Integer FlippingReverse the order of the 32 bits of each given unsigned integer and print the resulting value, stopping at -1. | Easy2 | Bit manipulation | No attempts yet | 1s | 128 MB | Judgeable |
| Ironclad Security AlgorithmYou invert the word permutation defined by the two public keys and apply it to the ciphertext to recover the plaintext. | Easy2 | Hash mapArray | No attempts yet | 1s | 256 MB | Judgeable |
| Fast Food PrizesAdd up, over disjoint prize sets, the prize value times the smallest sticker count among its required kinds. | Easy2 | GreedyMath+1 | No attempts yet | 2s | 128 MB | Judgeable |