Curated sets
Strings and text
Parsing, matching, and tries.
Total results1,816 problems
| Topics | Judge | |||||
|---|---|---|---|---|---|---|
| Spelling BeRead a dictionary and several emails, then report for each email whether all its words are known and list the unknown words in order. | Easy3 | Hash mapString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Counting PagesGiven a document's page count and a comma-separated list of page ranges, count the distinct pages that are actually printed, ignoring empty ranges and pages past the end. | Easy3 | ImplementationString+2 | No attempts yet | 1s | 256 MB | Judgeable |
| DanceCheck a sequence of dance steps against five textual rules and report which rules it violates, uppercasing any misplaced dip. | Easy3 | ImplementationString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Look and SayFor each input string of digits, produce the next look-and-say element by counting runs of equal digits and writing each count followed by the digit. | Easy3 | StringImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| Seven-Segment Display AdditionDecode two seven-segment code strings into integers, add them, then re-encode the sum using the given digit codes. | Easy3 | StringImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Casting Out NinesFor each line like a+b=c. or a*b=c., compute digit sums modulo 9 and print PASS if the operation is congruent, otherwise NOT!. | Easy3 | MathNumber theory+2 | No attempts yet | 1s | 128 MB | Judgeable |
| A Balanced WorldFor each line ending in a period, decide whether its round and square brackets are properly matched and nested, printing yes or no. | Easy3 | StackString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| MCXI Numeral SystemRead two MCXI-strings, add their values, and print the canonical MCXI-string for the sum. | Easy3 | StringImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Car ParkSimulate a sequence of car entry and exit signals for a car park of capacity S starting with C cars, stopping early if an exit occurs while empty. | Easy3 | SimulationImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| ShirtsMerge two already sorted lists of shirts and print one merged list ordered by size, then by colour letter. Multiple scenarios end with a 0. | Easy3 | SortingTwo pointers+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Letter ReplacementReplace each repeated letter in a word with a symbol assigned in the order letters first repeat, comparing case-insensitively. | Easy3 | StringImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| TargetGiven all solution words of a letter puzzle, recover the 9 grid letters and place the letter common to every word in the middle. | Easy3 | ArrayHash map+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Coded CommunicationGiven n binary strings of length b and a received string r, find the minimum Hamming distance from r to any of the n strings. | Easy3 | StringBrute force+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Grocery ShoppingFor each grocery item, find its matching store item by case-insensitive name and add the club-card saving on the units actually bought. | Easy3 | Hash mapString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Subway FaresGiven a per-stop fare table and an ordered list of station names, find the number of stops between two stations and print the corresponding fare. | Easy3 | ArrayString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Campus BuildingsGiven building names and an abbreviation, list the names whose letters contain the abbreviation as a case-insensitive subsequence, in input order. | Easy3 | StringTwo pointers+1 | No attempts yet | 1s | 128 MB | Judgeable |
| A Minor and C MajorSplit the score at bar lines, count how many measure-initial notes are A, D, E versus C, F, G, and break ties with the last note. | Easy3 | StringImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| Base KConvert each n to base k and report whether every digit from 0 to k-1 appears, formatting the output line exactly as specified. | Easy3 | MathImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Longest Decreasing SuffixFor each string, print its longest suffix whose characters strictly decrease from left to right. | Easy3 | StringImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Mining MapsParse each graph block, count distinct node names, and count distinct undirected tunnels including self-loops. | Easy3 | Hash mapGraph+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Parity BitSplit each line into 8-bit blocks, check whether the parity bit matches the parity of the first 7 bits, and count the mismatches. | Easy3 | ImplementationString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| PLU CountFor each text string, find the largest k such that PLU repeated k times is a subsequence, ignoring case. | Easy3 | GreedyString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Duplicate SSNRead a list of Social Security numbers until the sentinel 000-00-0000, then print every number that appears more than once in ascending order. | Easy3 | Hash mapSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| DecoderEach word contributes one letter: the first letter of the first word, then the k-th letter of each word where k is the previous word's length; spaces appear when the previous word is too long. | Easy3 | StringImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Secret LetterGiven a ciphertext, undo a 90-degree clockwise rotation of a square grid to recover the original letter. | Easy3 | ImplementationArray+2 | No attempts yet | 1s | 128 MB | Judgeable |
| RingsCount how many of N rings, each a 10-letter circular string, contain a given search string when read around the circle. | Easy3 | StringString matching+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Look-and-Say StringApply the look-and-say run-length encoding to a digit string n times and print the resulting string. | Easy3 | StringImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Character ConversionMap each character according to a conversion table where every replacement happens exactly once, and print the resulting string. | Easy3 | Hash mapImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Calculator ProgramRead alternating numbers and operators, evaluate left to right ignoring precedence, and print the value when = appears. | Easy3 | ImplementationSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Rotary DialGiven an uppercase word, map each letter to its phone digit and sum the dial times, where digit d costs d+1 seconds and 0 costs 11. | Easy3 | ImplementationString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Longest WordScan text until the token E-N-D, split it into words made of letters and hyphens, and print the longest such word in lowercase, breaking ties by first occurrence. | Easy3 | StringImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| In BrailleTranslate a string of digits to Braille cells, or three lines of Braille cells back to digits, using the fixed digit-to-cell table. | Easy3 | StringHash map+2 | No attempts yet | 1s | 128 MB | Judgeable |
| TautogramFor each sentence, decide whether every word begins with the same letter, ignoring case, until a line containing only *. | Easy3 | StringImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Find the CowCount ordered pairs of indices (x, y) with x < y where an "((" starts at x and a "))" starts at y in a parenthesis string. | Easy3 | StringPrefix sum+2 | No attempts yet | 1s | 128 MB | Judgeable |
| 17 TimesGiven a binary number N of up to 1000 digits, print N times 17 in binary. | Easy3 | StringMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Adding CommasInsert a comma every three digits from the right in a given integer and print the formatted number. | Easy3 | StringImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Cow CotillionGiven strings of '<' and '>', decide for each whether every character can be paired as a properly nested '><' bow, i.e. whether the brackets are balanced. | Easy3 | StackString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Encrypted SMSEach encrypted letter was shifted forward within its phone keypad key by its 1-based position; given the ciphertext, recover the original password. | Easy3 | StringSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| URLsParse each URL into protocol, host, optional port, and optional path, printing <default> for missing components. | Easy3 | StringImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Digital RootGiven positive integers up to 1000 digits, each line until a terminating 0, print the digital root of each number. | Easy3 | MathNumber theory+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Adam's GenesProcess cloning requests in order, tracking each clone's accumulated genes and reporting whether it is consistent and safe, disconnected from Adam, or doubly mutated. | Easy3 | Hash mapSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Unix ls Column FormattingSort filenames by ASCII value and lay them out in column-major order with fixed-width padding, as few rows as fit in 60 characters. | Easy3 | SortingImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| PalindromesFor each string, decide whether it reads the same backward and whether replacing each character by its mirror and reversing gives the same string. | Easy3 | StringImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Evaluating Simple C ExpressionsEvaluate a sequence of simple C expressions with +, -, and prefix or postfix ++/--, printing the expression value and the final values of used variables. | Easy3 | ImplementationSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Genetic CodePrint the first n characters of the infinite square-free sequence generated by the substitution N→NOP, O→NP, P→O. | Easy3 | StringRecursion | No attempts yet | 1s | 128 MB | Judgeable |
| SubsequenceFor each line of input, decide whether the first string is a subsequence of the second, printing Yes or No. | Easy3 | Two pointersString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Average is not Fast Enough!Parse each team's section times in h:mm:ss form, sum them, and print the average seconds per kilometer rounded to the nearest second, or a dash if any runner was disqualified. | Easy3 | ImplementationString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| HTMLRender an HTML fragment of plain text with <br> and <hr> tags, wrapping lines at 80 characters. | Easy3 | StringImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Artificial Intelligence?Given a word problem stating two of power, voltage, and current with optional metric prefixes, compute the missing quantity using P = U * I. | Easy3 | StringMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| On-Line BankingSimulate a stream of bank commands (create, deposit, withdraw, transfer) over many scenarios and print the result of each request. | Easy3 | SimulationImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Read the ChessboardGiven an ASCII-art chessboard, list each side's pieces in standard notation, grouped by type in a fixed order and sorted by position rules. | Easy3 | ImplementationString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Add Backward NumbersAdd two numbers whose digits are given in reverse order, printing the sum with its digits also reversed and no leading zeroes. | Easy3 | MathString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Aromatic NumbersGiven a string alternating Arabic digits and Roman numeral letters, sum each digit times its Roman value, subtracting a pair when the next Roman value is larger. | Easy3 | StringImplementation+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Global WarmingGiven a sequence of temperatures, find the length of the shortest period of the sequence of consecutive differences, allowing the final repetition to be truncated. | Easy3 | String matchingBrute force+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Huffman EncodingGiven prefix-free binary codes for up to 20 letters, decode a binary string of at most 250 digits back into the original letters. | Easy3 | TrieString+2 | No attempts yet | 2s | 512 MB | Judgeable |
| SignageGiven a sign width, lay out a fixed sentence into lines, justifying each line so spaces are spread as evenly as possible, and print dots for spaces. | Easy3 | StringSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Cell-Phone MessagingGiven words, compute the typing time on a phone keypad where each press takes 1 second and switching between letters on the same key adds a 2-second pause. | Easy3 | ImplementationString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Returning HomeReverse a short list of turn directions and street names, flipping each left or right turn, to produce the route from school back home. | Easy3 | ImplementationSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Fix-Free CheckFor each triple of words, decide whether no word is a prefix or suffix of another, printing Yes or No. | Easy3 | StringBrute force+2 | No attempts yet | 1s | 128 MB | Judgeable |
| PoetryFor each four-line verse, extract the last syllable of the final word on every line and print which rhyme scheme it matches. | Easy3 | StringImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| BFedInterpret a Brainfuck program read from stdin up to '#', supporting the seven pointer, arithmetic, loop, and output commands on a 30000-cell byte tape. | Easy3 | SimulationStack+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Keeping ScoreParse a 13-card hand grouped by suit, score high cards and short suits, and print each suit with points right-aligned in a fixed table. | Easy3 | StringImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Numbers That Read the Same Upside DownCount how many integers in the interval [m, n] stay the same when rotated 180 degrees, using the digit map 0, 1, 8, 6, 9. | Easy3 | MathImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| SurfingParse links out of HTML pages, print each link, then answer reachability queries between pages. | Easy3 | GraphDFS+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Card GameSimulate a 52-card game where players alternate turning cards; award points when a high card is followed by enough non-high cards, then print each score. | Easy3 | SimulationImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| CensorRead n lines of space-separated words and replace every word of exactly four letters with ****, printing a blank line between consecutive output lines. | Easy3 | StringImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| SentencesGiven lists of subjects, verbs, and objects, print every subject-verb-object sentence in alphabetical order, with a blank line between datasets. | Easy3 | Brute forceSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Dynamic Dictionary CodingCompress each text set by replacing repeated words with their 1-based dictionary positions, leaving first occurrences unchanged, and preserve all spacing. | Easy3 | StringHash map+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Guessing Game ICompare a 4-digit secret and a guess digit by digit, count exact-position matches as circles and remaining cross-position matches as squares, with duplicates matched once. | Easy3 | ImplementationHash map+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Word Problem (TEKSTER)Parse variable values embedded in a word problem, then evaluate the student's step-by-step arithmetic and print the last step's result. | Easy3 | ImplementationString+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| EncryptionGiven a string encrypted with the rule x -> x^3 mod 29 + 1, recover and print the original symbols. | Easy3 | ImplementationMath+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| Scrabble ScoringScore each Scrabble play by parsing its start square and direction, applying letter and word bonus multipliers from the fixed 15x15 board. | Easy3 | ImplementationSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| A DP ProblemParse each linear equation without parentheses, solve for x, and report the floored solution or whether it is impossible or an identity. | Easy3 | StringImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Automatic PoetryGiven a bracketed first line and a truncated second line ending in dots, rebuild the second line by splicing the bracket contents in the order s4s3s2s5. | Easy3 | StringImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| BracketsFor each line of code until the '#' line, decide whether its round, square, and curly brackets are matched and correctly nested. | Easy3 | StackString | No attempts yet | 1s | 128 MB | Judgeable |
| AnagramsGiven several word lists, print the first word in each list that has the most anagrams, along with that count. | Easy3 | Hash mapString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| ScrabbleGiven up to 1000 short dictionary words and a set of letter and blank tiles, count how many words the tiles can spell. | Easy3 | ArrayString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Simple Prefix CompressionSum stored lengths after prefix compression: each string stores a control byte plus the part not shared as a prefix with the previous string. | Easy3 | StringImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| Sequences without StammersPrint the smallest alphabet size for which a square-free (stammer-free) string of length n exists. | Easy3 | StringCombinatorics+1 | No attempts yet | 3s | 128 MB | Judgeable |
| JasioCount words that contain a palindrome substring of length at least 2, both literally and with i=j and p=b=d treated as equal. | Easy3 | StringImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Chaos and the StonkiEach entry is a name with hyphens inserted anywhere and letters possibly lowercased; count how many distinct real names (uppercase only) appear. | Easy3 | StringHash map+1 | No attempts yet | 1s | 128 MB | Judgeable |
| NecklacesSplit each circular necklace string into runs of equal size and shade and report the longest and shortest run, preferring larger then lighter beads on ties. | Easy3 | SimulationString | No attempts yet | 1s | 512 MB | Judgeable |
| StatisticsCount how many times each requested item appears in the article: spaces, digit runs, letter runs, period-ended sentences with a word, and palindromic words. | Easy3 | StringImplementation | No attempts yet | 1s | 512 MB | Judgeable |
| LotteryChange as few letters of the given A, B, or C string as possible so no two neighbors match. | Easy3 | GreedyString | No attempts yet | 1s | 128 MB | Judgeable |
| PalindromeFrom the given words, pick two at different positions so their concatenation is a palindrome and report the lexicographically smallest one. | Easy3 | Brute forceString+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Stuttering StringsFor each input case, the program prints every length-n string over * and ! whose runs stay within the given limits, in lexicographic order with * first. | Easy3 | BacktrackingRecursion+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Circular SequenceFind the lexicographically smallest rotation of each given circular DNA string. | Easy3 | StringBrute force | No attempts yet | 1s | 128 MB | Judgeable |
| Iris (Password)Count case-insensitive subsequence occurrences of a word in a text with the prescribed greedy scan and print the count with up to the first three end positions. | Easy3 | GreedySimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| The Brave Sir Robin's cAsE cOrReCtOrThe program uppercases each letter after terminal punctuation seen across spaces and parentheses, decimal points excluded, and lowercases the rest. | Easy3 | StringSimulation | No attempts yet | 1s | 128 MB | Judgeable |
| Constant IrritationTranslate each assembler storage line from suffixed numeric constants into the matching C-style directive and literals. | Easy3 | ImplementationString | No attempts yet | 1s | 128 MB | Judgeable |
| Approximate String MatchingFor each word pair, try every offset, keep the largest count of matching letters, and print twice that count over the total length as a reduced fraction. | Easy3 | String matchingBrute force+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Fun with fractionsAdd up to 999 mixed numbers, integers, or fractions per test case and print each sum in lowest terms as a mixed number. | Easy3 | MathImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| The Queen's EnglishSpell each integer below one billion in formal British English words with hyphens and ands. | Easy3 | ImplementationString | No attempts yet | 1s | 128 MB | Judgeable |
| Jumble MatchCount how many given words contain a substring that is a rearrangement of the pattern, where underscores match any letter. | Easy3 | Sliding windowString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Virus ReplicationGiven the DNA strands before and after one contiguous replacement, find the shortest inserted piece that explains the change. | Easy3 | StringTwo pointers | No attempts yet | 1s | 128 MB | Judgeable |
| E-Mail SnoopingCount how many listed keywords appear as whole words in the email and raise an alarm when the count reaches the threshold. | Easy3 | StringHash map | No attempts yet | 1s | 128 MB | Judgeable |
| False Sense of SecurityDecode each line by turning it into pause-free Morse code, reversing the per-character length digits, and re-splitting the code into text. | Easy3 | StringSimulation+1 | No attempts yet | 2s | 128 MB | Judgeable |
| The real messageDecide whether a received uppercase message could result from duplicating every third occurrence of each letter. | Easy3 | SimulationString | No attempts yet | 1s | 256 MB | Judgeable |
| ChromosomeDecide for each uppercase string whether it matches an optional A-to-F letter followed by runs of A, F, and C and an optional closing letter. | Easy3 | String matchingString | No attempts yet | 2s | 64 MB | Judgeable |
| String LDCount how many times the first character can be stripped from every word before a word empties or two words match. | Easy3 | StringSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |