Curated sets

Strings and text

Parsing, matching, and tries.

All problems
Total results1,816 problems
TopicsJudge
KaraokeCount the starting positions where the next K characters of the song string are all vowels.Easy2Sliding windowStringNo attempts yet2s128 MBJudgeable
Palindrome ColoringSplit each A/B string into the fewest palindromic subsequences and output that count.Easy2StringTwo pointersNo attempts yet1s128 MBJudgeable
Molar MassThe program parses each formula of C, H, O, and N with optional atom counts and prints its molar mass using the given weights.Easy2StringImplementationNo attempts yet1s128 MBJudgeable
Careless AdditionAdd two integers digit by digit from the right with no carries and print the column sums in order.Easy2ImplementationStringNo attempts yet1s128 MBJudgeable
DecryptionCount the letters in each sentence ignoring spaces and print the most frequent one, or ? on a tie.Easy2ArrayStringNo attempts yet1s128 MBJudgeable
War GameGiven each opponent row of archers, lancers, and riders with cyclic strengths, output the shortest row that beats every soldier in meeting order.Easy2StringImplementationNo attempts yet1s128 MBJudgeable
Addition in Different BasesAdd two numbers of up to 1000 digits in bases 1 to 35, including unary base 1, and print each equation with its sum in the same base.Easy2ImplementationString+1No attempts yet1s128 MBJudgeable
Air speed of a fully laden swallowYou group messy swallow flight records by subspecies and compute two average speeds for each group.Easy2ImplementationString+1No attempts yet1s128 MBJudgeable
Pig LatinConvert each word to Pig Latin by moving leading consonants to the end and appending ay.Easy2StringSimulationNo attempts yet1s128 MBJudgeable
W**h y**r mouth out with s**pReplace the middle two letters of every four-letter run whose first and last letters match the given list, scanning each line left to right with no overlap.Easy2StringSimulationNo attempts yet1s128 MBJudgeable
Word LadderDecide for each test case whether every consecutive word pair has equal length and differs in exactly one letter.Easy2StringImplementationNo attempts yet1s128 MBJudgeable
Morse CodeDecode each test case of five space-separated Morse codes into five uppercase letters or digits.Easy2Hash mapStringNo attempts yet1s128 MBJudgeable
Arbiter LoginGiven the original and entered passwords, report login success or hint at a caps lock or num lock mistake.Easy2StringImplementationNo attempts yet1s128 MBJudgeable
Arrangement of ContestCount the titles that form the longest unbroken run from A onward, using each title's first letter and stopping at the first missing letter.Easy2GreedyString+1No attempts yet2s256 MBJudgeable
Word SearchingCount case-sensitive overlapping occurrences of a given word, each fully inside one line of the following text.Easy2String matchingStringNo attempts yet1s128 MBJudgeable
Jane's First WordsCheck each input word against the pattern da+dd?(i|y) and print whether Jane called for daddy or is cooing.Easy2String matchingStringNo attempts yet1s128 MBJudgeable
Easy EncryptionEach letter becomes its two-digit code and each digit gains a # prefix while other characters stay unchanged.Easy2StringImplementationNo attempts yet1s128 MBJudgeable
Length and Frequency of SentencesCount the words in each of N sentences and report how often each length occurs in ascending order.Easy2StringHash map+1No attempts yet1s128 MBJudgeable
Form GuideParse home and away scorelines into win, draw, and loss marks, print the overall, home, and away form strings, and report the longest run of each mark.Easy2ImplementationStringNo attempts yet1s128 MBJudgeable
CipherDecrypt a Caesar-shifted message by trying all 26 shifts and picking the one where both CHIPMUNKS and LIVE appear.Easy2Brute forceStringNo attempts yet2s512 MBJudgeable
Mingyun's PasswordFind the word whose reverse also appears in the list and print its length and middle letter.Easy2StringBrute forceNo attempts yet1s128 MBJudgeable
Word PuzzleDecide for each pair of strings whether the gathered letters can be rearranged to form the original word.Easy2Hash mapStringNo attempts yet3s256 MBJudgeable
Cedric's cypherDecrypt each Caesar-ciphered line using the trailing encrypted A to recover the shift and drop that marker.Easy2StringImplementationNo attempts yet1s128 MBJudgeable
The Hardest Problem EverDecode each START/END block by shifting every uppercase letter five places back and leaving other characters unchanged.Easy2StringImplementationNo attempts yet1s128 MBJudgeable
Finding NemoPrint Found for each input line before EOI when the letters n, e, m, o appear in order ignoring case, else Missing.Easy2StringNo attempts yet1s256 MBJudgeable
Palindrome LinesDecide for each of n short lines whether it reads the same forward and backward, ignoring letter case.Easy2Two pointersStringNo attempts yet1s256 MBJudgeable
Word SwapSum the per-position letter differences between each pair of equal-length words and report the coins earned, paid, or free.Easy2ImplementationStringNo attempts yet1s256 MBJudgeable
Odysseus and the SirensThe program scores every melody under each candidate key by summing note penalties and prints the numbered key with the smallest total.Easy2ImplementationString+1No attempts yet1s256 MBJudgeable
Amino AcidParse each formula into element counts and print the molecular weight, or Invalid formula for other elements.Easy2StringImplementationNo attempts yet1s64 MBJudgeable
HeadshotAfter a click on a circular cylinder, compare firing at once against spinning first and print which choice is safer.Easy2ProbabilityStringNo attempts yet1s64 MBJudgeable
Radix 32 ConversionConvert each base-32 string of up to 8 digits to its decimal value and to binary by expanding every digit to 5 bits.Easy2MathStringNo attempts yet1s64 MBJudgeable
Pangram CheckerCount how many times each English letter appears in every sentence and print its pangram grade.Easy2StringHash mapNo attempts yet3s256 MBJudgeable
The return of the KingSplit the digit string into grades of 1 to 10 in the single valid way and print the average rounded to two decimals.Easy2StringGreedyNo attempts yet1s256 MBJudgeable
Working HoursAdd signed hour and minute terms in a flexible format and print each total as H:MM.Easy2ImplementationString+1No attempts yet2s256 MBJudgeable
RövarspråketTranslate one lowercase word by expanding each consonant into three letters under the given vowel and consonant rules.Easy2ImplementationStringNo attempts yet1s256 MBJudgeable
Comma Separated SumAdd all the natural numbers listed in the comma-separated string S.Easy2StringMathNo attempts yet1s256 MBJudgeable
Veni, vidi, viciDrop the last letter of each odd-length ciphertext, then decode every letter pair into one plain letter with the given key.Easy2StringMathNo attempts yet1s256 MBJudgeable
Spring 2005: Arriving at USCFilter the building list to names that hold the abbreviation letters as a case-insensitive subsequence and print the matches in input order.Easy2Two pointersString matchingNo attempts yet1s256 MBJudgeable
Pattern Word BankingAdd the PIN digits picked by lowercase pattern letters and print non sequitur if the letter values do not match the PIN length.Easy2SimulationStringNo attempts yet2s256 MBJudgeable
Kkung's Girlfriend PlanEach test case gives named condition times and AND-OR combos, and the answer is the smallest combo time where one combo takes its slowest condition.Easy2ImplementationHash map+1No attempts yet1s256 MBJudgeable
Letter CookiesGiven the letters in a box, decide for each query word whether its letters can all be taken from the box.Easy2Hash mapStringNo attempts yet1s256 MBJudgeable
Is It a Number?Check whether each line holds only digits with optional surrounding spaces and print the number without leading zeros or invalid input.Easy2StringImplementationNo attempts yet1s256 MBJudgeable
Decode the MessageThe program decodes each word into one character from its letter values modulo 27.Easy2StringMath+1No attempts yet1s256 MBJudgeable
PasswordCheck whether the two letters typed into the blanked positions of a stored answer match the letters at those positions, ignoring spaces.Easy2StringImplementationNo attempts yet1s256 MBJudgeable
CypherDecrypt each message line by shifting its lowercase letters back by the Caesar shift computed from its date.Easy2StringMathNo attempts yet1s256 MBJudgeable
Coverity CrosswordDecide whether every listed word appears horizontally, vertically, or diagonally in an 8 by 8 letter grid.Easy2String matchingMatrix+1No attempts yet2s256 MBJudgeable
Eakspay igpay atinlay?Translate each phrase into Pig Latin by moving each leading consonant cluster to the end with ay, or adding yay after vowel-initial words.Easy2StringImplementationNo attempts yet1s256 MBJudgeable
Hash Code HackerThe program prints k distinct letter strings that share one Java hash code by mapping binary digits to Aa and BB blocks.Easy2StringImplementationNo attempts yet2s256 MBJudgeable
Spin the number wheelCount the wheel positions where the M digits read clockwise form a number between X and Y.Easy2Brute forceStringNo attempts yet1s256 MBJudgeable
Hidden PasswordDecide if scanning the message and skipping letters outside the remaining password set reproduces the password in order.Easy2SimulationStringNo attempts yet1s256 MBJudgeable
Marko's T9 inputCount how many dictionary words map letter by letter to the given T9 digit string.Easy2StringHash mapNo attempts yet2s64 MBJudgeable
Identifying Map TilesConvert a map tile quadkey into its zoom level and x and y coordinates.Easy2Bit manipulationStringNo attempts yet1s256 MBJudgeable
YODACompare two numbers digit by digit from the right and drop the smaller digit at each position, printing YODA for a number left with no digits.Easy2StringSimulationNo attempts yet1s64 MBJudgeable
Lazy Spelling Bee (Large)Count distinct words formed by picking each letter from its neighbors in the target word, modulo 1e9+7.Easy2CombinatoricsString+1No attempts yet5s512 MBJudgeable
Moist (Small1)For each deck of names, count how many cards the robot moves to sort the deck into lexicographic order.Easy2ArrayStringNo attempts yet5s512 MBJudgeable
Hangul Initial ConsonantsPrint the initial consonant of each Hangul syllable in the given string in order.Easy2MathString+1No attempts yet1s512 MBJudgeable
#include <Google I/O.h>Decode each block of eight I and O letters as one ASCII byte and print the message for every test case.Easy2ImplementationString+1No attempts yet5s512 MBJudgeable
Read Phone Number (Small)Split each digit string into the given group lengths and read each run of equal digits with count words such as double and triple.Easy2SimulationString+1No attempts yet5s512 MBJudgeable
Fair and Square (Small)Count numbers in each interval [A, B] that are palindromes and squares of palindromes.Easy2Brute forceMath+1No attempts yet5s512 MBJudgeable
Reverse Word OrderGiven N lines of space-separated words, print each line's words in reverse order prefixed with the case number.Easy2StringImplementationNo attempts yet5s512 MBJudgeable
Reverse Words (Large)Read each line of words and print the words in reverse order, prefixed by the case number.Easy2StringImplementationNo attempts yet5s512 MBJudgeable
T9 Spelling (Small)Map each letter of a short message to its keypad digit and repeat count, inserting a space between consecutive letters that share the same key.Easy2StringImplementation+2No attempts yet5s512 MBJudgeable
Immigrate to the CTP principalityConvert each item between uppercase letters and their alphabet positions (A=1 to Z=26), in the direction given by the mode character.Easy2ImplementationString+2No attempts yet1s128 MBJudgeable
Bitwise Operations on Binary NumbersGiven two equal-length binary strings, output their bitwise AND, OR, XOR, and the complemented forms of each, keeping length and leading zeros.Easy2StringBit manipulation+1No attempts yet2s512 MBJudgeable
CamerasRead n eight-character plates and print each one that matches a fixed pattern of digits and a capital letter, in input order.Easy2StringImplementation+1No attempts yet2s512 MBJudgeable
Adding god to nicknamesGiven N nicknames split into syllables by spaces, replace the first syllable with god and print the result.Easy2StringImplementationNo attempts yet1s512 MBJudgeable
PalindromeGiven a lowercase word of at most 20 characters, decide whether it reads the same forwards and backwards.Easy2StringTwo pointers+1No attempts yet2s512 MBJudgeable
A New AlphabetReplace each English letter with its fixed symbol string from a 26-entry table, leaving all other characters unchanged.Easy2StringHash map+1No attempts yet2s512 MBJudgeable
Quick EstimatesRead N integers up to 10^100 and print the number of digits in each, counting 0 as one digit.Easy2StringMath+1No attempts yet2s512 MBJudgeable
Math ContestGiven a huge decimal integer x, print YES if x is divisible by 9 and NO otherwise.Easy2Number theoryMath+1No attempts yet1s512 MBJudgeable
Four Arithmetic OperationsEach line gives an expression a op b = c with single-digit spacing, and you print correct or wrong answer depending on whether the arithmetic matches the claimed result.Easy2MathImplementation+2No attempts yet1s128 MBJudgeable
Boys and GirlsArrange n children in a circle with B/G so that exactly x stand next to a boy and exactly y next to a girl, output the lexicographically smallest.Easy2ImplementationBrute force+1No attempts yet2s256 MBJudgeable
The Funniest Digital LaughterGiven a string, ignore the consonants and decide whether the remaining vowels read the same forwards and backwards.Easy2StringTwo pointersNo attempts yet1s512 MBJudgeable
HolesCount the holes in each of N lines of uppercase text, where B counts as two, A D O P Q R count as one, and the rest count as zero.Easy2StringImplementation+2No attempts yet2s512 MBJudgeable
VirusGiven a key and one line of ciphertext, undo a Caesar variant whose shift grows by one per letter and resets after 25.Easy2StringSimulation+1No attempts yet2s512 MBJudgeable
Alpha PuzzleAssign numbers 1 to 26 to letters by scanning the grid and numbering each letter at its first appearance.Easy2SimulationString+1No attempts yet2s512 MBJudgeable
Luhn AlgorithmGiven a sixteen-digit card number as a string, check whether it passes the Luhn checksum and print DA or NE.Easy2StringImplementation+2No attempts yet1s512 MBJudgeable
Bridge Honor PointsGiven N strings of 13 card characters, add up honor points (A=4, K=3, Q=2, J=1) across all hands and print the total.Easy2ImplementationString+1No attempts yet1s32 MBJudgeable
Country Leader (Small)For each test case, find the name with the most distinct letters, breaking ties by ASCII alphabetical order, and print it.Easy2StringImplementation+2No attempts yet5s512 MBJudgeable
Country LeaderFor each test case, pick the name with the most distinct letters, breaking ties by lexicographic order where a space sorts before any letter.Easy2StringSorting+2No attempts yet5s512 MBJudgeable
Refreshment AreaCount the number of D-long horizontal or vertical runs of empty cells in an N by M grid.Easy2ArrayImplementation+2No attempts yet2s512 MBJudgeable
Birthday GraphRead dates in dd mm yyyy form and print a star per birthday for each of the twelve months, in a numbered case format.Easy2ArrayString+1No attempts yet5s512 MBJudgeable
Grid PatternFor each case, print a text grid with pipe, minus, and plus lines and asterisk-filled cells of size w by h.Easy2ImplementationSimulation+1No attempts yet10s512 MBJudgeable
X X gluedFor each registration number, print every run of two or more identical digits in the four-digit group, in left-to-right order.Easy2StringImplementation+1No attempts yet2s512 MBJudgeable
Hongjun surrounded by fansGiven Hongjun's id, print a 3 by 3 grid of emoticons with :id: in the center and :fan: in the other eight cells.Easy2ImplementationStringNo attempts yet1s64 MBJudgeable
EmpathyMultiply two binary numbers up to 30 bits long and print the product in binary without leading zeros.Easy2MathString+2No attempts yet2s256 MBJudgeable
Credit Card ValidationFor each 16-digit card number, apply the Luhn checksum (double every second digit from the right, sum digits) and print T if the total is divisible by 10, else F.Easy2ImplementationString+1No attempts yet1s128 MBJudgeable
No DuplicatesRead a line of space-separated uppercase words and print yes if no word repeats, or no if any word appears more than once.Easy2StringHash map+1No attempts yet2s512 MBJudgeable
Boolean SatisfiabilityCount the assignments of a disjunction of single literals that make the formula true, where each variable takes true or false.Easy2CombinatoricsMath+2No attempts yet3s512 MBJudgeable
Atomic MassParse a short chemical formula, look up each element's atomic mass, multiply by any following count, and print the total with two decimals.Easy2StringHash map+2No attempts yet1s512 MBJudgeable
Kiwis vs KangaroosGiven a phrase, score each side by how often its letters appear in KANGAROO or KIWIBIRD, then report the higher score or a tie.Easy2ImplementationString+2No attempts yet2s512 MBJudgeable
Beautiful MusicFor each note sequence, check whether every consecutive pair is 2, 4, or 6 steps apart on the repeating 7-note scale, and print one of two messages.Easy2ImplementationString+1No attempts yet2s512 MBJudgeable
Letter CountCount how often each English letter appears in one line, ignoring case and non-letters, then print 26 rows of stars.Easy2StringImplementationNo attempts yet2s512 MBJudgeable
PiratesGiven a lowercase word, find the letter with the highest frequency and print that letter with its count.Easy2StringHash map+1No attempts yet2s512 MBJudgeable
Password checkFor each of N passwords, report valid if it has a lowercase letter, uppercase letter, digit, symbol, and length at least 12, else invalid.Easy2StringImplementationNo attempts yet2s512 MBJudgeable
Hissing MicrophoneGiven a lowercase string, check whether it contains two consecutive s characters and print hiss or no hiss.Easy2StringImplementationNo attempts yet1s512 MBJudgeable
Life ScoreFor each name, sum the letter values (A=1 to Z=26, spaces worth 0) and print the total, or PERFECT LIFE when the total is exactly 100.Easy2StringImplementationNo attempts yet2s512 MBJudgeable
Big number A+BRead two integers with up to 10000 digits and print their sum without leading zeros.Easy2StringMath+2No attempts yet1s256 MBJudgeable
Check the CheckRead dish names and price-quantity pairs until the line TOTAL, then print PAY if the waiter's total is at most the sum of price times quantity, else PROTEST.Easy2ImplementationString+1No attempts yet2s512 MBJudgeable
Lorem ipsumSplit a fixed Latin placeholder paragraph into words and print the words at indices L through R separated by spaces.Easy2StringImplementation+1No attempts yet0.1s512 MBJudgeable