Curated sets

Strings and text

Parsing, matching, and tries.

All problems
Total results1,816 problems
TopicsJudge
Palindrome NumbersFor each integer up to 99999 in a terminated input list, print whether its decimal digits form a palindrome.Easy1StringImplementationNo attempts yet1s128 MBJudgeable
Counting VowelsFor each input line until a terminating '#', count how many letters are vowels regardless of case.Easy1StringImplementationNo attempts yet1s128 MBJudgeable
QuackPrint a fixed ASCII-art duck exactly, matching every character and line with no input.Easy1ImplementationStringNo attempts yet1s128 MBJudgeable
CrowingPrint a fixed ASCII art rooster with no input, matching the exact spacing and characters.Easy1ImplementationStringNo attempts yet1s128 MBJudgeable
Dobby's English StudyFor each line, count how many times a given letter (case-insensitive) appears in a sentence until a line with only '#' ends input.Easy1StringImplementationNo attempts yet1s128 MBJudgeable
HowlPrint a fixed wolf ASCII art picture exactly, with no input and no extra spaces.Easy1ImplementationStringNo attempts yet1s128 MBJudgeable
String RepetitionGiven repeat count R and string S, output the string formed by repeating each character of S exactly R times in order.Easy1StringImplementationNo attempts yet1s128 MBJudgeable
Typo Man Go ChangyoungGiven a string and a 1-based position, output the string with that one character removed, for multiple test cases.Easy1StringImplementationNo attempts yet1s128 MBJudgeable
Word LengthRead a word of at most 100 letters and print its length.Easy1StringImplementationNo attempts yet1s128 MBJudgeable
Toggle Alphabet CaseRead a word up to length 100 and print it with every letter's case swapped.Easy1StringImplementationNo attempts yet1s128 MBJudgeable
Beautiful NumberFor each given integer, count how many distinct decimal digits it contains.Easy1StringImplementationNo attempts yet1s128 MBJudgeable
Study Abroad BanDelete every character in a given uppercase word that appears in the letters of 'CAMBRIDGE' and print the rest.Easy1StringImplementationNo attempts yet1s128 MBJudgeable
FBIGiven five agent codes, print the 1-based positions of those containing the substring FBI, or a fixed message if none do.Easy1StringImplementationNo attempts yet0.25s128 MBJudgeable
Sum of Missing CharactersFor each string, sum the ASCII values of uppercase letters that never appear in it.Easy1StringHash map+1No attempts yet1s128 MBJudgeable
The Good and the BadCount the letters g and b in each hero name, ignoring case, and print whether the name is GOOD, A BADDY, or NEUTRAL.Easy1StringImplementation+1No attempts yet1s128 MBJudgeable
Capitalize the First LetterRead N sentences and print each one with its first letter changed to uppercase, leaving every other character as is.Easy1StringImplementationNo attempts yet1s128 MBJudgeable
Line NumbersRead N lines of text and print each one prefixed with its 1-based line number in the format "number. content".Easy1ImplementationStringNo attempts yet1s128 MBJudgeable
Mirror, Oh! MirrorRead lines of ASCII text until a line of three asterisks, and print each line with its characters reversed.Easy1StringImplementationNo attempts yet1s128 MBJudgeable
Counting LinesRead all input lines, including empty ones, and print how many there are.Easy1ImplementationStringNo attempts yet1s128 MBJudgeable
PhD ProgramRead N problems, output a+b for each addition line and 'skipped' for the line P=NP.Easy1ImplementationStringNo attempts yet1s128 MBJudgeable
WelcomePrint the three-line ASCII art that spells the word Welcome, matching every space and symbol exactly.Easy1ImplementationStringNo attempts yet1s128 MBJudgeable
Call CenterPrint a fixed piece of ASCII art of C3PO sitting at a call center, matching the example exactly.Easy1ImplementationStringNo attempts yet1s128 MBJudgeable
Entry Log ManagementRead N names and print each one converted to lowercase, one per line.Easy1StringImplementationNo attempts yet1s256 MBJudgeable
JOI and IOICount how many length-3 windows of a string equal JOI and how many equal IOI, including overlaps.Easy1StringBrute force+1No attempts yet1s128 MBJudgeable
Do-it, Do-it-NotFor each test case, compare the two middle digits of an even-length binary string and print Do-it if they match, otherwise Do-it-Not.Easy1StringImplementation+1No attempts yet1s128 MBJudgeable
Reverse TextRead each test case line and print its characters in reverse order.Easy1StringImplementationNo attempts yet1s128 MBJudgeable
The Universal OracleGiven one line of text, replace each question's leading 'What' with 'Forty-two' and its final '?' with '.', ignoring non-questions.Easy1StringImplementationNo attempts yet1s128 MBJudgeable
DyslexiaCompare two equal-length letter strings position by position and count the positions where the characters differ, treating case as significant.Easy1StringImplementationNo attempts yet1s128 MBJudgeable
DyslexiaCompare two equal-length strings character by character and count positions where the letters match exactly, including case.Easy1StringImplementationNo attempts yet1s128 MBJudgeable
Reverse a Three-Letter WordRead a three-letter word and print its characters in reverse order.Easy1StringImplementationNo attempts yet1s128 MBJudgeable
Letter CounterCount how many times each letter appears across the given lines and print nonzero counts from a to z then A to Z.Easy1ArrayStringNo attempts yet1s512 MBJudgeable
Caesar CipherGiven the encrypted message and its original first letter, recover the shift and decode the full message.Easy1StringImplementationNo attempts yet1s128 MBJudgeable
OX QuizScore each O by the length of its unbroken run of O characters and print the total for each test case.Easy1ImplementationStringNo attempts yet1s128 MBJudgeable
Letter BankDecide whether the second word uses exactly the letters of the first word, each at least once.Easy1Hash mapStringNo attempts yet1s128 MBJudgeable
First and Last LetterPrint the first and last letter of each given uppercase string, doubling the letter for length 1.Easy1StringNo attempts yet1s128 MBJudgeable
Reverse Each WordFor each of T sentences, print the words in the same order with the letters inside every word reversed.Easy1StringImplementationNo attempts yet1s128 MBJudgeable
Erasing a File for GoodDecide if the second bit string is the first with every bit flipped N times, so it must equal the first for even N and its complement for odd N.Easy1SimulationStringNo attempts yet1s128 MBJudgeable
JengaCheck each three-block row for two adjacent missing blocks and report whether each tower stands.Easy1ImplementationStringNo attempts yet1s128 MBJudgeable
Grading ExamsCount how many answers differ between the answer key and the student's responses for each test case.Easy1StringNo attempts yet1s128 MBJudgeable
Fraud BustersMatch each 9-character database code against the scanned code, treating every star as a wildcard, and print the matches in input order.Easy1String matchingImplementationNo attempts yet1s128 MBJudgeable
Encoding Binary NumbersEncode each binary string as run lengths followed by digits and print the result per line.Easy1StringImplementationNo attempts yet1s128 MBJudgeable
Gray codeConvert an n-bit binary string to its standard Gray code by copying the first bit and adding each adjacent pair of bits without carry.Easy1Bit manipulationStringNo attempts yet1s128 MBJudgeable
Hide those lettersThe program replaces every occurrence of two given letters in both cases with underscores.Easy1StringImplementationNo attempts yet1s128 MBJudgeable
AcronymsGiven an acronym and candidate phrases, print the phrases whose word initials match the acronym letters in order.Easy1StringImplementationNo attempts yet1s256 MBJudgeable
Count VowelsCount the vowels a, e, i, o, and u in each given lowercase word and print the result in the required sentence.Easy1StringNo attempts yet1s256 MBJudgeable
Reverse RotReverse each message, then shift every character forward by N places in the 28-symbol alphabet.Easy1StringSimulationNo attempts yet1s256 MBJudgeable
Quite a problemPrint yes for each input line that contains problem in any capitalization, even inside longer words, and no otherwise.Easy1String matchingStringNo attempts yet2s256 MBJudgeable
Happy or SadCount the happy (:-)) and sad (:-( ) emoticons in the message and print happy, sad, unsure, or none.Easy1StringNo attempts yet1s256 MBJudgeable
Vertical ReadingRead five given words column by column from top to bottom, skipping missing letters in shorter words, and print the letters in that order.Easy1SimulationArray+1No attempts yet1s256 MBJudgeable
Find the AlphabetGiven a lowercase word of length at most 100, output the 0-based first index of each letter a to z, or -1 when absent.Easy1ArrayStringNo attempts yet1s256 MBJudgeable
String analysisCount the lowercase letters, uppercase letters, digits, and spaces in each input line until end of input.Easy1StringImplementationNo attempts yet1s256 MBJudgeable
Comma Integer CountCount the maximal runs of digits in a comma-separated digit string.Easy1StringNo attempts yet1s256 MBJudgeable
Comma Sum MultilineJoin the input lines into one comma-separated string, split it at commas, and print the sum of the numbers.Easy1ImplementationStringNo attempts yet1s256 MBJudgeable
??!Print the given id with ??! appended to it.Easy1StringNo attempts yet1s256 MBJudgeable
BASE16 EncodingRead a string of up to 50 letters and digits and print each character as two uppercase hex digits in order.Easy1ImplementationStringNo attempts yet1s256 MBJudgeable
BASE16 DecodingDecode a BASE16 string by converting each pair of hex digits back into its ASCII character.Easy1StringImplementationNo attempts yet1s256 MBJudgeable
Vowel CountCount how many letters of the given lowercase word are vowels (a, e, i, o, u).Easy1StringImplementationNo attempts yet1s256 MBJudgeable
Palindrome CheckCheck whether the given lowercase word reads the same forward and backward and print 1 or 0.Easy1StringTwo pointersNo attempts yet1s256 MBJudgeable
Use Every LetterDecide for each of up to 50 sentences whether it contains every letter a to z, and list the missing letters otherwise.Easy1StringArrayNo attempts yet2s256 MBJudgeable
Simon SaysPrint the trailing part of every command that starts with 'Simon says' and skip all other commands.Easy1StringImplementationNo attempts yet2s256 MBJudgeable
Communication ChannelsCompare each transmitted binary string with its received copy and print OK when they match and ERROR otherwise.Easy1StringImplementationNo attempts yet1s256 MBJudgeable
Angry Grammar SticklerThe program counts banned words and phrases in each sentence and prints ten times that count.Easy1StringImplementationNo attempts yet1s256 MBJudgeable
Thai Lottery Prize CheckGiven the winning numbers and prize amounts for six Thai lottery categories, compute the total prize for each ticket by adding every matched category.Easy1StringImplementationNo attempts yet2s256 MBJudgeable
Cryptographer's ConundrumCount the positions where the given string differs from PER repeated to the same length.Easy1StringImplementationNo attempts yet1s256 MBJudgeable
Count Me InCount the vowels and consonants in each of up to 100 given English sentences.Easy1StringImplementationNo attempts yet1s256 MBJudgeable
!terces poTReverse every input line except the final END line and print each decoded sentence in order.Easy1StringNo attempts yet1s256 MBJudgeable
The Image Stretched Twice as WideCheck whether doubling every character of the first picture sideways produces the second picture.Easy1ImplementationStringNo attempts yet1s512 MBJudgeable
Concatenate two linesRead two input lines and print their concatenation with nothing inserted between them.Easy1StringNo attempts yet1s256 MBJudgeable
Lining Up by NameCheck whether the given player names stand in increasing or decreasing dictionary order and print INCREASING, DECREASING, or NEITHER.Easy1StringArrayNo attempts yet1s256 MBJudgeable
Affine CipherApply E(X) = (aX + b) mod 26 to each uppercase letter of the plaintext and print the ciphertext.Easy1ImplementationString+1No attempts yet5s256 MBJudgeable
ROT13Encrypt the given string with ROT13, shifting each English letter by 13 places and leaving other characters unchanged.Easy1StringImplementationNo attempts yet1s256 MBJudgeable
Sum of digitsAdd N digits given as a single unspaced line and print their sum.Easy1ImplementationStringNo attempts yet1s256 MBJudgeable
Print ten characters per linePrint the given word in chunks of ten characters, one chunk per line.Easy1StringImplementationNo attempts yet1s256 MBJudgeable
EssayPrint B distinct words formed by mapping the decimal digits of 0 to B-1 to letters a to j.Easy1ImplementationStringNo attempts yet1s64 MBJudgeable
NNRepeat the decimal form of N exactly N times and print at most its first M characters.Easy1ImplementationStringNo attempts yet1s32 MBJudgeable
Rulers of Centauri PrimeGiven T country names, report for each whether a king, a queen, or nobody rules it from its last letter.Easy1StringImplementationNo attempts yet5s512 MBJudgeable
Rulers of Centauri PrimeGiven T country names, print for each whether its last letter marks a king, a queen, or nobody.Easy1StringImplementationNo attempts yet5s512 MBJudgeable
KBO Korean Series Champion NumberGiven the Korean name of a KBO team that won the Korean Series, print the number assigned to that team.Easy1ImplementationString+1No attempts yet2s512 MBJudgeable
George BooleRead one boolean operation in the form true AND false and print its result.Easy1ImplementationString+2No attempts yet2s512 MBJudgeable
Java2016Given a target constant c, print 20 fixed macro definitions and then build one expression by appending a macro for each set bit of c.Easy1ImplementationSimulation+2No attempts yet2s512 MBJudgeable
HistogramRead n bar sizes and print one line of exactly k equals signs for each bar size k.Easy1ImplementationStringNo attempts yet2s512 MBJudgeable
Tournament SelectionCount wins among six game results and print the group number 1, 2, or 3, or -1 if there are no wins.Easy1ImplementationStringNo attempts yet2s512 MBJudgeable
HelicopterPrint the given ASCII art helicopter exactly as shown, with no trailing spaces on any line.Easy1ImplementationStringNo attempts yet1s512 MBJudgeable
A toast that wins over the roomGiven one of eight fixed Hangul abbreviations joined by periods, print the full Korean toast phrase it stands for.Easy1ImplementationString+1No attempts yet2s512 MBJudgeable
CAPSRead a lowercase string and print every character converted to uppercase.Easy1StringImplementationNo attempts yet2s512 MBJudgeable
What Is Your Name Score?Given an uppercase name, sum the alphabetical position of each letter and print the total.Easy1StringImplementationNo attempts yet1s128 MBJudgeable
Command PromptGiven N equal-length file names, output a pattern where each position is the common character if all names agree there, or a question mark otherwise.Easy2StringImplementationNo attempts yet2s128 MBJudgeable
Word CountCount the number of space-separated words in a string that may have leading or trailing spaces.Easy2StringImplementationNo attempts yet2s128 MBJudgeable
Most Frequent LetterCount letter frequencies in a string, case-insensitively, and print the most common letter in uppercase or a question mark on ties.Easy2Hash mapString+1No attempts yet2s128 MBJudgeable
Basketball GameGiven N surnames, count first letters and print all letters (in order) that start at least five surnames, or PREDAJA if none does.Easy2Hash mapImplementation+1No attempts yet1s128 MBJudgeable
Word SortingDeduplicate a list of words and sort them first by length, then lexicographically.Easy2SortingStringNo attempts yet2s256 MBJudgeable
Octal to BinaryConvert a huge octal number (up to 333,334 digits) into its binary representation without leading zeros.Easy2StringImplementation+1No attempts yet1s256 MBJudgeable
Splitting a WordSplit a lowercase word into three nonempty parts, reverse each part, and find the lexicographically smallest concatenation among all splits.Easy2StringBrute force+1No attempts yet2s128 MBJudgeable
House Number SignCompute the total width of a house-number sign given fixed per-digit widths and 1 cm margins between digits and at both ends, for each input number until 0 appears.Easy2ImplementationString+1No attempts yet1s128 MBJudgeable
Choosing a Team NameCount letters L,O,V,E across a fixed name plus each candidate string, compute a formula mod 100, and print the candidate with the highest value, breaking ties by lexicographic order.Easy2StringImplementation+1No attempts yet2s128 MBJudgeable
Group Word CheckerCount how many of up to 100 lowercase words have every repeated character forming a single contiguous block.Easy2StringImplementationNo attempts yet2s128 MBJudgeable
Yujin NumberGiven an integer up to about 2.1 billion, determine whether some split of its digits into a left and right part yields equal digit products.Easy2StringBrute force+1No attempts yet2s128 MBJudgeable
Most Frequent LettersCount lowercase letter frequencies across up to 50 lines of text and print all letters tied for the highest frequency in alphabetical order.Easy2Hash mapString+1No attempts yet2s128 MBJudgeable
Sort Digits DescendingRearrange the digits of a given natural number so they appear in descending order and print the result.Easy2SortingString+1No attempts yet2s128 MBJudgeable
Octopus NumbersConvert base-8 strings using nine special symbols (including one for digit -1) into their decimal integer values until a terminator line appears.Easy2StringMath+1No attempts yet1s128 MBJudgeable