Curated sets

Strings and text

Parsing, matching, and tries.

All problems
Total results1,816 problems
TopicsJudge
Good License PlatesFor each license plate, compute a base-26 value from the three letters and compare it to the four-digit number, printing whether their difference is within 100.Easy2StringImplementation+1No attempts yet1s128 MBJudgeable
Making AnagramsGiven two lowercase words, compute how many letters must be deleted in total so their remaining letters match as multisets (anagrams).Easy2Hash mapStringNo attempts yet2s128 MBJudgeable
Prime WordSum letter values (a-z=1-26, A-Z=27-52) for a word and print whether the sum is prime (with 1 counted as prime).Easy2StringMath+1No attempts yet2s128 MBJudgeable
Dobby's Case-Insensitive Word TestFor each test case, output the original-cased word that is smallest in dictionary order when comparisons ignore letter case.Easy2StringSorting+1No attempts yet1s128 MBJudgeable
Longest Digit RunFor three given eight-digit numbers, print the length of the longest run of identical consecutive digits in each.Easy2StringImplementationNo attempts yet1s128 MBJudgeable
Coin GameCount occurrences of each of 8 possible length-3 head/tail patterns among all consecutive triples in a 40-character coin toss string, for multiple test cases.Easy2StringImplementationNo attempts yet1s128 MBJudgeable
CryptoquoteDecode each ciphertext message by substituting letters using a given 26-letter mapping while preserving spaces.Easy2StringImplementationNo attempts yet1s128 MBJudgeable
Binary AdditionAdd two binary strings up to length 80 for multiple test cases and print the sum without leading zeros.Easy2StringSimulation+1No attempts yet1s128 MBJudgeable
Base ConversionConvert a number given in an arbitrary base (2 to 36, using letters for digits above 9) into its decimal value.Easy2MathImplementation+1No attempts yet1s128 MBJudgeable
Difference Between 5 and 6Given two integers, compute the minimum and maximum possible sums after freely swapping digits 5 and 6 in each number.Easy2StringGreedy+1No attempts yet1s128 MBJudgeable
Why Is KMP Called KMP?Convert a hyphen-joined full name like Knuth-Morris-Pratt into its initials such as KMP.Easy2StringImplementationNo attempts yet1s128 MBJudgeable
Changyeong's DiaryDecode a string by replacing every vowel-p-vowel triple with the single vowel, restoring the original sentence.Easy2StringImplementationNo attempts yet1s128 MBJudgeable
Answer Pattern GuessingGiven an answer string, count matches against three fixed repeating guess patterns and report the highest score and who achieved it.Easy2SimulationString+1No attempts yet1s128 MBJudgeable
OctalConvert a binary string (up to 100 digits) to octal by padding and grouping bits in threes using the given table.Easy2StringImplementationNo attempts yet1s128 MBJudgeable
Changyeong Village Cup ShuffleTrack the position of a ball among three cups after a sequence of swap operations described by characters A, B, C.Easy2SimulationStringNo attempts yet1s128 MBJudgeable
Number ReversalFor each number, reverse its digits, add to the original, and print YES if the sum is a palindrome, else NO.Easy2StringMath+1No attempts yet1s128 MBJudgeable
Making an AcronymBuild an acronym from the first letters of words in a phrase, skipping a fixed list of filler words unless one is the first word.Easy2StringImplementationNo attempts yet1s128 MBJudgeable
Vigenère Cipher EncryptionEncrypt repeated plaintext lines with a repeating key using a shifted Vigenère cipher until a line with 0 appears.Easy2StringSimulation+1No attempts yet1s128 MBJudgeable
Hamming DistanceFor each test case, count the positions where two equal-length binary strings differ and print the Hamming distance.Easy2StringImplementationNo attempts yet1s128 MBJudgeable
Celebrity JeopardyGiven an equation of the form variable = value, output that same equation unchanged, preserving exact spacing.Easy2StringImplementationNo attempts yet1s128 MBJudgeable
Anagram DistanceGiven many word pairs, count letters to delete from both so their letter frequency histograms match, using character counts.Easy2Hash mapString+1No attempts yet1s256 MBJudgeable
NumbersrebmunMap each letter of a company name to its phone keypad digit, then check whether the resulting digit string reads the same forwards and backwards.Easy2StringTwo pointers+1No attempts yet1s128 MBJudgeable
Hay PointsSum dictionary values of words appearing in each job description line block until a single period terminates it.Easy2Hash mapStringNo attempts yet1s128 MBJudgeable
BabelfishBuild a foreign-to-English word dictionary from the input, then translate each foreign word in the message, printing eh for unknown words.Easy2Hash mapString+1No attempts yet1s128 MBJudgeable
Keyboard Shifted One Key RightReplace every character of each input line with the key immediately to its left on a QWERTY keyboard, leaving spaces unchanged.Easy2Hash mapString+1No attempts yet1s128 MBJudgeable
Always Follow the Rules in ZombielandRead q quotes in order, then answer r lookups by printing the quote at that 1-based index, or "No such rule" if out of range.Easy2ArrayImplementation+1No attempts yet1s128 MBJudgeable
Refrigerator MagnetsRead lines until END and print each line that contains no repeated letter, ignoring spaces.Easy2ImplementationString+2No attempts yet1s128 MBJudgeable
VotingFor each recorded vote, check quorum and compare yes and no counts to print the outcome.Easy2ImplementationStringNo attempts yet1s128 MBJudgeable
Mirror ImageFor each word until the terminator '#', print the string reversed with each letter replaced by its mirror image, or INVALID if any letter lacks a mirror.Easy2StringHash map+1No attempts yet1s128 MBJudgeable
Rock, Paper, ScissorsGiven two equal-length strings of R, P, S moves, count the rounds each player wins.Easy2StringImplementation+1No attempts yet1s128 MBJudgeable
ParityRead bit strings whose last bit is missing plus a parity letter, and append the 0 or 1 that makes the parity match.Easy2StringBit manipulation+1No attempts yet1s128 MBJudgeable
The Seven Percent SolutionRead lines until a line with only '#', replacing the seven reserved characters in each with their given percent-encodings.Easy2StringImplementationNo attempts yet1s128 MBJudgeable
QuicksumCompute a weighted checksum for each input line: sum each character's 1-based position times its letter value, where spaces count as 0, until a line with only #.Easy2StringImplementation+2No attempts yet1s128 MBJudgeable
Haiku ReviewCount vowel runs per haiku line and report whether each line has 5, 7, 5 syllables or the first line that fails.Easy2StringImplementationNo attempts yet1s128 MBJudgeable
Cantor SetFor each N, print a line of 3^N characters following the Cantor set rule: each third-level block of size 3^k has its middle third blanked, dashes elsewhere.Easy2RecursionImplementation+2No attempts yet1s128 MBJudgeable
Tire DimensionsParse a tire size code and compute its overall circumference from the section width, aspect ratio, and rim diameter.Easy2StringImplementation+1No attempts yet1s128 MBJudgeable
Being Smarty!Given row R and block size N, decide whether the alternating style property P1 or P2 applies to that row.Easy2MathImplementation+1No attempts yet1s128 MBJudgeable
Ah!Compare two strings of the form a...ah and print go if the first has at least as many a characters as the second.Easy2StringImplementationNo attempts yet1s128 MBJudgeable
Death Knight HeroCount how many of the given ability strings avoid the forbidden substring "CD".Easy2StringImplementation+1No attempts yet1s128 MBJudgeable
Card CuttingRead each game line of card values up to '*', count odd values for Cheryl and even values for Tania, and print the winner or Draw.Easy2ImplementationString+1No attempts yet1s128 MBJudgeable
Travelling SalesmanCount the distinct town names in each week's list and report the total for that week.Easy2Hash mapString+1No attempts yet1s128 MBJudgeable
Jean and Joe's ClothesRead clothing sizes and count how many items go to Joe, Jean, Jane, James, or no one, per visit until N equals 0.Easy2ImplementationSimulation+2No attempts yet1s128 MBJudgeable
DVDsApply a series of clamped sale and restock transactions to each DVD title's stock and report the final count.Easy2ImplementationSimulation+2No attempts yet1s128 MBJudgeable
Alphabet DistanceFor each test case, read two equal-length uppercase words and print the alphabet distance between the paired letters at every position.Easy2StringImplementation+1No attempts yet1s128 MBJudgeable
String TransformationsApply each letter-to-two-letters rule to the first occurrence of its letter in every word, updating the word after each rule.Easy2StringImplementation+1No attempts yet1s128 MBJudgeable
Vigenère CipherEncrypt each given plaintext with the Vigenère cipher, shifting every letter by the aligned repeated keyword letter modulo 26.Easy2StringImplementation+1No attempts yet1s128 MBJudgeable
Secret LocationEach of six lines encodes one number by its character count; print the first three as Latitude and the last three as Longitude in the given format.Easy2StringImplementation+2No attempts yet1s128 MBJudgeable
Letter TrianglesFor each data set, print a triangle of N lines where line i repeats the ith letter in sequence, starting from a given letter and wrapping Z to A.Easy2ImplementationString+1No attempts yet1s128 MBJudgeable
DedupeFor each of several strings, collapse every run of consecutive identical letters into a single letter and print the result.Easy2StringImplementationNo attempts yet1s128 MBJudgeable
Football TeamRead names one per line and swap every i with e and every I with E in each name.Easy2StringImplementation+1No attempts yet1s128 MBJudgeable
Garbled MessageRead lines of garbled text until EOF and replace every occurrence of the substring "iiing" with "th", preserving all other characters and line breaks.Easy2StringImplementation+1No attempts yet1s128 MBJudgeable
YodaFor each sentence, move its first two words to the end and print the result.Easy2StringImplementationNo attempts yet1s128 MBJudgeable
Total CountRead fighter names until a line with 0, print each name with its kill count in first-appearance order, then the grand total.Easy2Hash mapImplementation+2No attempts yet1s128 MBJudgeable
Which WayFor each positive integer, convert it to binary and print left, straight, or right depending on whether it has more 0s, equal 0s and 1s, or more 1s.Easy2Bit manipulationImplementation+1No attempts yet1s128 MBJudgeable
Caesar CipherGiven an uppercase word encrypted by shifting each letter forward three positions, shift every letter back by three to recover the original.Easy2StringImplementation+2No attempts yet1s128 MBJudgeable
Comparison OperatorsRead C comparison expressions with integer operands, evaluate each, and print "Case N: true" or "Case N: false" until a line with operator E ends input.Easy2ImplementationString+1No attempts yet1s128 MBJudgeable
PangramRead sentences until a line holding a single asterisk, and print Y if a sentence contains all 26 lowercase letters, otherwise N.Easy2StringHash map+1No attempts yet1s128 MBJudgeable
Jingle ComposingSplit a slash-delimited composition into measures and count how many note durations sum exactly to 1.Easy2StringImplementation+1No attempts yet1s128 MBJudgeable
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.Easy2ImplementationString+1No attempts yet1s128 MBJudgeable
String Function EncodingApply the given suffix-plus-string operation C times to each input string and print the results.Easy2StringSimulationNo attempts yet1s128 MBJudgeable
Odd or EvenRead N large integers up to 10^60 and print odd or even for each, judging parity from the last digit.Easy2StringMath+2No attempts yet1s128 MBJudgeable
Barn EchoesGiven two lowercase strings, find the length of the longest string that is a prefix of one and a suffix of the other.Easy2StringBrute force+2No attempts yet1s128 MBJudgeable
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.Easy2StringImplementation+2No attempts yet1s128 MBJudgeable
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.Easy2StringHash map+2No attempts yet1s128 MBJudgeable
Hard to Believe, but True!Read the numbers in each equation backwards, add them, and check whether the sum equals the backwards-read result.Easy2StringMath+1No attempts yet1s128 MBJudgeable
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.Easy2StringImplementation+2No attempts yet1s128 MBJudgeable
Icon ScalingRead scaling factor k and print the fixed 3x3 icon with every character expanded into a k-by-k block.Easy2StringImplementationNo attempts yet2s512 MBJudgeable
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.Easy2ImplementationString+1No attempts yet2s512 MBJudgeable
English or French?Count the letters t and T against s and S across N lines and print English if t wins, otherwise French.Easy2StringImplementationNo attempts yet2s512 MBJudgeable
It's Cold Here!Read city names with integer temperatures, one per line, and print the name of the city with the lowest temperature.Easy2ImplementationArray+2No attempts yet1s128 MBJudgeable
I Speak TXTMSGRead lines until TTYL, map each known short form through a fixed table, and echo other lines unchanged.Easy2Hash mapString+1No attempts yet1s128 MBJudgeable
Anagram CheckerDecide whether two phrases are anagrams, ignoring spaces and letters only.Easy2Hash mapString+1No attempts yet1s128 MBJudgeable
Snow CallsConvert each alphanumeric phone number to digits, keep the first 10 digits, and print them in xxx-xxx-xxxx form.Easy2StringImplementation+1No attempts yet1s128 MBJudgeable
Smile with SimilesGiven up to five adjectives and five nouns, print every phrase of the form "<adjective> as <noun>" in nested input order.Easy2ImplementationBrute force+2No attempts yet1s128 MBJudgeable
Simple EncryptionRemove non-letters from a message and shift each letter within its column by the alphabet position of the keyword letter above it.Easy2StringSimulation+1No attempts yet1s128 MBJudgeable
TridentPrint an ASCII trident with t tine rows, a crossbar, and h handle rows, using spacing s between the tines.Easy2ImplementationString+2No attempts yet1s128 MBJudgeable
0123456789Read one digit from 0 to 9 and print it as a seven-segment display drawn with asterisks, three per segment, with no trailing whitespace.Easy2ImplementationSimulation+1No attempts yet1s128 MBJudgeable
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.Easy2StringImplementation+2No attempts yet1s128 MBJudgeable
Dressing UpRead an odd height H and print a bow tie of H rows where each side widens as rows approach the middle.Easy2ImplementationSimulation+1No attempts yet1s128 MBJudgeable
Shift LettersFor each test case, rotate the letters of a word right by n positions and print the result in a fixed sentence format.Easy2StringImplementation+1No attempts yet1s128 MBJudgeable
AnagramsGiven two lowercase words, decide whether one can be rearranged into the other, and print the result with the words.Easy2StringHash map+1No attempts yet1s128 MBJudgeable
StringCollapse every run of identical consecutive letters in a lowercase string into a single letter and print the result.Easy2StringImplementationNo attempts yet1s128 MBJudgeable
NonogramGiven a grid of black and white squares, print the lengths of the consecutive black blocks in each row and then each column.Easy2ImplementationArray+2No attempts yet1s1024 MBJudgeable
Hidden Roman NumeralsFind which of the twelve Roman numerals from 1 to 12 appear as substrings of a given string over {I,V,X}.Easy2StringImplementation+1No attempts yet1s1024 MBJudgeable
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.Easy2StringImplementation+1No attempts yet1s128 MBJudgeable
EntropyRead one line of text, count how often each character appears, and print the Shannon entropy rounded to three decimals.Easy2Hash mapMath+2No attempts yet1s128 MBJudgeable
ExpressionGiven N, build a fully parenthesized NAND (Sheffer stroke) expression for the carry-out bit by iterating a fixed string concatenation rule.Easy2StringImplementation+2No attempts yet1s128 MBJudgeable
Programming Contest PasswordsFor each test case, read a word list and participant index sequences, then print each password formed by concatenating the indexed words.Easy2ImplementationArray+1No attempts yet1s128 MBJudgeable
Stacked BowlsGiven a string of parentheses, compute the total stack height where the first bowl adds 10 and each following bowl adds 5 if it matches the previous direction or 10 if it differs.Easy2StringSimulation+1No attempts yet1s128 MBJudgeable
Jumbled WordsFor each line of lowercase words, keep the first and last letter of every word and reverse the letters in between.Easy2StringImplementationNo attempts yet1s128 MBJudgeable
MP3 SongsRead several lists of tune names and print each list sorted alphabetically while ignoring case and keeping input order for ties.Easy2SortingString+1No attempts yet1s128 MBJudgeable
How Many Distinct LettersFor each line until the terminator '#', count how many distinct alphabet letters appear, ignoring case and non-letters.Easy2StringImplementation+1No attempts yet1s128 MBJudgeable
DivisibilityGiven a base-62 string, decide whether the number it represents is divisible by 61.Easy2MathNumber theory+1No attempts yet1s128 MBJudgeable
JokeCount how many times the substring 'joke' appears in the input text, with line breaks treated as part of the text.Easy2StringImplementationNo attempts yet2s128 MBJudgeable
Huffman TreeGiven Z characters and arity N, decode the stored digit string into the per-character encoding.Easy2TreeString+1No attempts yet3s128 MBJudgeable
A Cat on a KeyboardGiven a text, replace each character with the keyboard row number (1 to 5) where its key sits.Easy2StringImplementationNo attempts yet1s128 MBJudgeable
Ant NamesGiven up to 100 lowercase names, print the maximum number of distinct letters found in any single name.Easy2StringImplementation+1No attempts yet1s128 MBJudgeable
Rhyming VersesCount pairs of lines with the same number of vowels and identical last k letters ignoring spaces.Easy2StringImplementationNo attempts yet1s512 MBJudgeable
Hidden NumberSum every maximal run of digits in a word of letters and digits, ignoring leading zeros.Easy2StringImplementationNo attempts yet1s256 MBJudgeable
Caesar CipherDecode a Caesar-shifted uppercase message by matching its most frequent letter to the given original letter.Easy2StringArray+1No attempts yet1s512 MBJudgeable