Problems
Pick a problem and write your solution in the built-in editor. The judge runs it against real test cases while you watch, and the wider archive is open to read whenever you like.
Total results1,789 problems
| Title | Level | Topics | Solved | Time limit | Memory limit | Judge |
|---|---|---|---|---|---|---|
| Normal SortImplement a custom string comparator that treats embedded numeric runs (with optional signs) by numeric value and letters case-insensitively, then compare pairs of strings accordingly. | Medium5 | StringImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Remove ParenthesesGiven an expression with up to 10 matching parenthesis pairs, output every distinct string formed by removing one or more full pairs, sorted lexicographically. | Medium5 | StringBit manipulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Cup HolderGiven a seat row with regular seats and adjacent couple-seat pairs that lack a middle cup holder, compute the maximum number of people who can access a cup holder, matching people to holders one per holder. | Medium5 | GreedyString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Trimming StringsFind how many top rows can be removed one at a time from a grid while all column strings (read top to bottom) remain pairwise distinct. | Medium5 | Binary searchString+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Pleasant WordCount ways to fill blanks in a word with uppercase letters so it avoids three consecutive vowels or consonants and contains at least one 'L'. | Medium5 | Dynamic programmingString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Word SearchGiven N database words compared in order against a query using character-by-character matching that also checks for word-end, compute total comparisons per query. | Medium5 | TrieString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| TennisValidate whether recorded tennis set scores form a legal best-of-three match, with a special rule that one named player never loses a set. | Medium5 | SimulationImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Peter Pan FrameDraw a 5-row banner where each letter of a word sits in a diamond of '#' or '*' depending on its position, with overlapping frames resolved by priority. | Medium5 | SimulationString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Sangbeom's Secret MessageGiven a Vigenere-style encrypted message and a known substring of the plaintext, deduce the repeating key and decrypt the full message. | Medium5 | StringBrute force+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Sidewalk PillarsGiven a sidewalk string and up to N extra pillars, place pillars in free segments to minimize the count of length-L parking spots, breaking ties by using fewest pillars. | Medium5 | GreedyString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Restoring a Scrambled EmailGiven a scrambled string formed by replacing '@' with 'at' and optionally inserting 'nospam' once, output all distinct valid email addresses that could produce it. | Medium5 | StringBrute force+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Foot TypingGiven two words and their interleaving, output the lexicographically smallest sequence of 1s and 2s marking which word produced each character. | Medium5 | Dynamic programmingString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| T9Simulate a T9 keypad predictor that maps key-press sequences to dictionary words, splitting on key 1 as space and marking unmatched words with asterisks. | Medium5 | StringHash map+1 | No attempts yet | 1s | 128 MB | Judgeable |
| PINCount pairs of 4-character PINs (from a given list) that differ in exactly D of their four positions. | Medium5 | Hash mapCombinatorics+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Ancient ManuscriptCount ways to fill '*' letters in a word so runs of vowels/consonants respect maximum length and maximum equal-letter-repeat limits, using DP over letter classes and previous letter identity. | Medium5 | Dynamic programmingString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Decoding Morse SequencesCount the number of ways to split a given Morse code string into a sequence of dictionary words, using dynamic programming with Morse-to-word conversion. | Medium5 | Dynamic programmingString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Simple ArithmeticSimulate long addition, subtraction, and multiplication of big numbers, printing the numbers and partial products aligned like on paper. | Medium5 | StringSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Enchanted MirrorDecide if bricks with fixed (real,mirror) letter pairs can be permuted so the row reads T1 and its mirror reads T2, given initial words S1,S2. | Medium5 | Hash mapString+2 | No attempts yet | 3s | 256 MB | Judgeable |
| i18nGiven text lines, expand i18n-style abbreviations back into previously seen full words when the expansion is valid and unique, preserving capitalization and separators. | Medium5 | StringHash map+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Horn ClausesParse Horn clause formulas and decide satisfiability by computing the minimal true-variable assignment via forward chaining, or report unsatisfiable. | Medium5 | GraphImplementation+1 | No attempts yet | 2s | 64 MB | Judgeable |
| Breaking the CipherGiven plaintext, ciphertext, and block size, count permutations of size k that transform every plaintext block into the matching ciphertext block. | Medium5 | CombinatoricsString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| JBCGiven a custom digit ordering and numbers written in it, sum the decimal value of each number over every valid base from 2 up to the digit count. | Medium5 | MathString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Arne SaknussemmReverse a described scrambling procedure that pads, reverses, and writes a message column by column into a table, given its row fragments, to recover the original text. | Medium5 | StringSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Pathological PathsGiven a set of file paths defining a directory tree, resolve query paths (with '.', '..', and index.html shortcuts) and decide if two paths refer to the same existing file. | Medium5 | StringHash map+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Good WordsA word of A's and B's is good when its letters can be paired by equal letters with non-crossing arcs; count how many of the given words are good. | Medium5 | StackString+2 | No attempts yet | 1s | 256 MB | Judgeable |
| PalindrometerGiven an odometer reading with fixed digit positions, find the smallest number of kilometers to drive until it reads as a palindrome, counting leading zeros. | Medium5 | StringMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| BuzzwordsFor each line, strip spaces and report the highest occurrence count among substrings of length 1, 2, 3, and so on, stopping at the first length where no substring repeats. | Medium5 | StringHash map+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Scrolling SignGiven k-wide words, find the minimum total letters scrolled in so that each word appears in order, allowing overlap between consecutive words. | Medium5 | Dynamic programmingString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Open SourceCount distinct students per project, drop any student who signed up for more than one project, then sort projects by count descending and name. | Medium5 | Hash mapSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Chat RoomsFor each submitted line, decide accept or reject using consonant-run length, the count of recent suspicious lines, and recent duplicate counts over a sliding window of the last 10 lines. | Medium5 | Sliding windowString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Evil Straw Warts LiveFor each string, find the fewest adjacent swaps needed to rearrange it into a palindrome, or report that no palindrome is possible. | Medium5 | GreedyTwo pointers+2 | No attempts yet | 1s | 128 MB | Judgeable |
| String ExponentiationGiven a string, find the largest exponent n such that the string is a repetition of some base string a raised to n. | Medium5 | StringString matching+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Blue JeansGiven up to 10 DNA strings of length 60, find the longest substring that appears in all of them, breaking ties alphabetically, or report none of length 3 or more. | Medium5 | StringBrute force+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Index GenerationParse markers in a multi-page document, collect page references for primary and secondary index entries, and print the index sorted case-insensitively. | Medium5 | StringSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Mark-up ProcessorStrip a small mark-up language from text: handle bold, italic, size, and a toggle that turns processing off, printing only the plain characters. | Medium5 | StringSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Abstract ExtractFor each article, pick the topic sentence of every paragraph with three or more sentences and print them in order. | Medium5 | StringSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Reverse Roman NotationSimulate a stack calculator where operands are Roman numerals; parse and print them, and handle underflow, division by zero, and out-of-range errors. | Medium5 | ImplementationStack+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Normal FormEvaluate a fully parenthesized AND/OR tree where odd levels are AND and even levels are OR, for several long test cases. | Medium5 | TreeImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Introduction to Digital CircuitsParse three-valued logic expressions over P, Q, R and count how many of the 27 assignments make the expression evaluate to 2. | Medium5 | RecursionImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Organize Your Train part IICount distinct strings obtainable by splitting an input string at any point, optionally reversing each part, and concatenating the two parts in either order. | Medium5 | StringBrute force+2 | No attempts yet | 1s | 128 MB | Judgeable |
| lsGiven a wildcard pattern where * matches any run of characters, print the input file names that match it, keeping input order. | Medium5 | Dynamic programmingString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Playfair CipherBuild a 5x5 Playfair key table from a key phrase, split the plaintext into digraphs with X padding, and apply the row, column, or rectangle substitution rules. Output the uppercase ciphertext. | Medium5 | SimulationMatrix+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Overlap!Given each course's exam day and time slot and each student's course list, count students who have two or more finals that overlap in time. | Medium5 | ImplementationSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Biomedical EngineeringGiven a target string and a set of reusable component strings, find the minimum number of components whose concatenation equals the target, or report that it is impossible. | Medium5 | Dynamic programmingString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Decimal to FractionConvert a decimal string, with an optional repeating block in parentheses, into the exact fraction in lowest terms. | Medium5 | MathNumber theory+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Jumbled LettersFor each query, find the longest dictionary word that can be formed using the query letters at most once, breaking ties alphabetically, or report IMPOSSIBLE. | Medium5 | StringHash map+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Baby's BlocksGiven a multiset of letters, find the 0-based rank of a given distinct permutation among all distinct permutations in lexicographic order. | Medium5 | CombinatoricsString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| IOIOICount the occurrences of the alternating string P_N (N+1 I's and N O's) as a substring of S, counting overlaps. | Medium5 | StringSliding window+2 | No attempts yet | 1s | 256 MB | Judgeable |
| JOIOI TowerGiven a string of J, O, I disks by increasing radius, find the maximum number of disjoint triples spelling JOI or IOI. | Medium5 | GreedyArray+1 | No attempts yet | 1s | 128 MB | Judgeable |
| JJOOIIFind the largest k such that k J's, then k O's, then k I's appear consecutively in the given string. | Medium5 | StringPrefix sum+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Longest Common SubstringGiven two uppercase strings of length up to 4000, find the length of the longest substring that occurs contiguously in both. | Medium5 | Dynamic programmingString+2 | No attempts yet | 2s | 256 MB | Judgeable |
| Largest Prime SubstringGiven a digit string, find the largest-valued contiguous substring that is prime and at most 100000. | Medium5 | StringBrute force+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Clumsy CowsGiven an even-length string of parentheses, find the minimum number of characters to flip so the string becomes balanced. | Medium5 | GreedyString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| TypoGiven a bracket string with at most one typo, count how many single-character flips turn it into a valid balanced bracket string. | Medium5 | StringImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Word MorphGiven a dictionary of equal-length words, find the fewest one-letter changes needed to turn the start word into the end word through valid words. | Medium5 | BFSGraph+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Hexadecimal to Octal ConversionConvert a hexadecimal number of up to 100,000 digits into its octal form with no leading zeros, using binary as the intermediate step. | Medium5 | StringMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Cow TypingGiven a dictionary and short email words, simulate the cow's letter selector with a trie and count total button presses, including circular highlight moves and prints. | Medium5 | TrieString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| String ConstructionRepeatedly take the leftmost or rightmost character of S and append it to T; among all such T, output the lexicographically smallest, wrapping lines at 80 characters. | Medium5 | GreedyString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| String Construction 2Build the lexicographically smallest string by repeatedly taking either the first or last character of the remaining string and appending it, with ties broken by comparing inward. | Medium5 | GreedyTwo pointers+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Crazy SearchCount how many distinct length-N substrings appear in a given text, where the text uses characters from an alphabet of size NC. | Medium5 | StringHash map+2 | No attempts yet | 1s | 128 MB | Judgeable |
| FORCALRead text lines in blocks and scan each line into FORCAL tokens (identifiers, literals, symbols, keywords), printing TOKEN ERROR and skipping the block on an invalid string. | Medium5 | StringImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| String ComputerCompute the minimum number of single-character insert, delete, or change operations needed to turn one string into another. | Medium5 | Dynamic programmingString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| SlurpysGiven up to 10 short strings, decide whether each one is a Slurpy, meaning a Slimp followed by a Slump under the recursive grammar in the statement. | Medium5 | RecursionString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Broken KeyboardFor each test case, find the length of the longest substring of the sentence that contains at most m distinct characters. | Medium5 | Sliding windowString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Automatic Typo CorrectionGiven a dictionary, classify each queried word as correct, a misspelling of the first similar dictionary word, or unknown, using three specific edit types. | Medium5 | StringHash map+2 | No attempts yet | 1s | 128 MB | Judgeable |
| The Sierpinski FractalDraw the outline of a depth-n Sierpinski triangle in ASCII, 2^n rows tall, with no trailing spaces and blank lines between the test cases. | Medium5 | Divide and conquerRecursion+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Anagram GroupsGroup distinct words that are anagrams of each other, then print the five largest groups sorted by size and smallest word. | Medium5 | Hash mapSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Counting Fibonacci NumbersFor each query pair a and b up to 10^100, count how many Fibonacci numbers fall in the closed interval [a, b]. | Medium5 | MathBinary search+2 | No attempts yet | 1s | 256 MB | Judgeable |
| FriendsEvaluate set expressions over uppercase letters using union, intersection, and difference, where * binds tighter than + and - and equal operators left-associate. | Medium5 | StringStack+2 | No attempts yet | 1s | 128 MB | Judgeable |
| String EncryptionClean the plaintext (drop spaces, uppercase), then invert the given transposition decryption rule to produce the matching ciphertext. | Medium5 | StringImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| ShuffleGiven a permutation of 27 characters, apply it N times to a short string and print the result. | Medium5 | ImplementationMath+2 | No attempts yet | 2s | 512 MB | Judgeable |
| SnowflakesGiven up to 100,000 snowflakes of six arm lengths each, find whether two are identical under cyclic rotation or reversal. | Medium5 | Hash mapString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| BananasDecide for each word whether it fits the recursive grammar of a monkey language, where words wrap other words in N and in B...S. | Medium5 | StringRecursion+2 | No attempts yet | 1s | 128 MB | Judgeable |
| ScribbleGiven seven tiles with letter values and a dictionary of up to 100000 words, find the highest-scoring dictionary word formable from the tiles, or 0 if none is. | Medium5 | StringHash map+2 | No attempts yet | 1s | 128 MB | Judgeable |
| SpamCount trigram frequencies in sample spam and non-spam messages, then classify each test message by which sample it matches more closely under the cosine similarity measure. | Medium5 | StringHash map+2 | No attempts yet | 1s | 128 MB | Judgeable |
| All Roads Lead Where?Given a tree of cities rooted at Rome and query pairs, print the unique shortest path between each pair as the first letters of the cities on the route. | Medium5 | TreeDFS+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Geocaching CoordinatesGiven a coordinate formula with lowercase letter slots and rules for each variable's allowed values, print every distinct resulting coordinate in lexicographic order. | Medium5 | Brute forceCombinatorics+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| Dynamic Declaration Language (DDL)Simulate a tiny language with dynamic variable declarations, jumps, and increments, printing a repeated-declaration or undeclared-reference error each time one occurs. | Medium5 | SimulationImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Spell CheckerGiven a dictionary and query words, mark each query correct, or list dictionary words reachable by one deletion, replacement, or insertion. | Medium5 | StringHash map+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Magic TrickFor each of three paragraphs, follow the rule of jumping forward by the current word's length; list all distinct outcomes in the third paragraph, or -outside- if a jump overruns the text. | Medium5 | SimulationImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Apocalyptic AlignmentGiven two A/B strings of equal length, find the minimum number of operations that repaint a contiguous segment with one fruit type to turn the first string into the second. | Medium5 | Dynamic programmingGreedy+1 | No attempts yet | 1s | 128 MB | Judgeable |
| No Pause TelegraphGiven a string of dots and dashes and seven fixed letter codes, split it into codewords that minimize the resulting message alphabetically, or report that no split exists. | Medium5 | Dynamic programmingString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Binary WitchGiven a binary string, predict the next L digits by matching suffixes of length 13 down to 1 against earlier occurrences, using the rightmost match. | Medium5 | StringString matching+2 | No attempts yet | 1s | 128 MB | Judgeable |
| The Very Dirty ChainFor each circular string, output the lexicographically smallest rotation, without reversing the chain. | Medium5 | StringTwo pointers | No attempts yet | 1s | 128 MB | Judgeable |
| Cash DispenserCount 4-digit PINs whose digits appear as a subsequence of every recorded finger-movement sequence. | Medium5 | StringDynamic programming+1 | No attempts yet | 3s | 128 MB | Judgeable |
| RepetitionsGiven up to five lowercase words of length at most 2000, find the length of the longest substring that appears as a contiguous fragment in every word. | Medium5 | StringBinary search+2 | No attempts yet | 3s | 128 MB | Judgeable |
| Two WordsAfter each swap of one character between the two strings, report which string is lexicographically larger. | Medium5 | Segment treeString | No attempts yet | 1s | 512 MB | Judgeable |
| Palindrome NumbersGiven a decimal integer with up to 1000 digits, print its representation in each base from 2 to 10 where it reads as a palindrome. | Medium5 | MathString+1 | No attempts yet | 1s | 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 |
| 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 |
| Bonus WordFind every pair of dictionary words that joins to ten letters and matches each query fixed and shuffled letters, listed in order. | Medium5 | StringBrute force+1 | 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 |
| Square CipherEncode each message into letter pairs with a 5x5 square built from the keyword, applying the row, column, and rectangle substitution rules. | Medium5 | SimulationMatrix+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 |
| 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 |
| 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 |
| 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 |
| SMS PollNormalize phone formats to identify each sender, keep only the earliest valid vote per sender, and print truncated percentages and participant count. | Medium5 | StringHash map+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 |
| Blue Gene, Jr.Simulate the recursive mutation rules on each short alphanumeric code and print the stabilized code. | Medium5 | RecursionSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |