Curated sets
Strings and text
Parsing, matching, and tries.
Total results1,816 problems
| Topics | Judge | |||||
|---|---|---|---|---|---|---|
| Hash collision stringsPrint two length-N strings that differ but have equal Java String hashCode values, using the classic Aa/BB collision with a shared prefix. | Easy2 | StringHash map+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Binary GamePrint the binary representations of 0 through n, concatenated with no separators. | Easy2 | StringImplementation | No attempts yet | 1s | 256 MB | Judgeable |
| RickRead one line and print NO if it exactly matches one of six given phrases, otherwise print YES. | Easy2 | StringImplementation | No attempts yet | 1s | 256 MB | Judgeable |
| Derivative of a polynomial functionParse a linear polynomial written like 3x+5 or -x+2 and print the constant that is its derivative. | Easy2 | StringImplementation+1 | No attempts yet | 1s | 512 MB | Judgeable |
| Master of the Shell GameGiven a string, perform T swaps of characters at the given 0-indexed positions in order and print the final string. | Easy2 | StringSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| What Is Your HandleSort N distinct handles by ASCII dictionary order and print the I-th one. | Easy2 | SortingString+1 | No attempts yet | 1s | 512 MB | Judgeable |
| Caesar CipherShift every letter of a string by k positions in the alphabet, wrapping around, and leave spaces, periods, and commas unchanged. | Easy2 | StringImplementation+1 | No attempts yet | 1s | 64 MB | Judgeable |
| What Does UCPC Stand For?Given one string, decide whether deleting some characters can leave exactly the subsequence UCPC, case sensitive. | Easy2 | StringGreedy+1 | No attempts yet | 1s | 512 MB | Judgeable |
| Minimum String DifferenceSlide the shorter string A across every possible alignment position over B and output the minimum number of mismatched characters. | Easy3 | StringSliding window+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Strange MultiplicationGiven two large numbers as digit strings, compute the sum of all pairwise products of their digits, which equals the product of their digit sums. | Easy3 | MathString+1 | No attempts yet | 2s | 256 MB | Judgeable |
| Student NumbersGiven N equal-length numeric strings, find the smallest suffix length k so that all suffixes of length k remain distinct. | Easy3 | StringBrute force+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Binary AdditionAdd two binary strings up to 80 digits long and print the sum in binary without leading zeros. | Easy3 | StringMath+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Make a PalindromeGiven a lowercase string of length at most 50, find the minimum length of a palindrome obtained by appending characters only to its end. | Easy3 | StringBrute force+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Shortcut Key AssignmentAssign each menu option an unused shortcut letter by checking word-initial letters first, then any letter in the string, following the options in order. | Easy3 | SimulationString+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Binary to Octal ConversionConvert a binary number with up to 1,000,000 digits into its octal representation. | Easy3 | Bit manipulationMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| MessagesGiven sheets of names passed around a circle with P/N marks, find who wrote each hurtful (N) message and about whom. | Easy3 | SimulationArray+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Serial NumbersSort serial numbers by length, then digit-sum, then a custom lexicographic rule where digits precede letters. | Easy3 | SortingString+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Lost ParenthesesGiven an arithmetic expression with only plus and minus signs, place parentheses to minimize the evaluated result. | Easy3 | GreedyString+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Cyclic WordsCount how many words are distinct once each is allowed to be read starting from any position around a circle. | Easy3 | StringBrute force+1 | No attempts yet | 2s | 128 MB | Judgeable |
| I Am Pokemon Master DasomBuild a bidirectional mapping between Pokemon numbers and names, then answer up to 100,000 lookup queries either way. | Easy3 | Hash mapImplementation+1 | No attempts yet | 2s | 256 MB | Judgeable |
| Common PermutationFor each pair of input strings, count letter frequencies and output the multiset intersection sorted alphabetically as the longest common rearranged subsequence. | Easy3 | Hash mapString+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Lucky TicketFind the longest even-length substring of a digit string whose first half digit sum equals its second half digit sum. | Easy3 | Prefix sumBrute force+2 | No attempts yet | 2s | 128 MB | Judgeable |
| DNA DecodingRepeatedly merge the last two bases of a DNA string using a fixed lookup table until one base remains, then output it. | Easy3 | SimulationString+1 | No attempts yet | 5s | 16 MB | Judgeable |
| CrosswordGiven a filled crossword grid, extract every maximal horizontal or vertical run of letters of length at least two and output the lexicographically smallest such word. | Easy3 | StringImplementation+1 | No attempts yet | 2s | 128 MB | Judgeable |
| CipherEncrypt a lowercase text by shifting each letter backward in the alphabet by the position value of a repeating key letter, leaving spaces unchanged but still consuming a key character. | Easy3 | StringSimulation+1 | No attempts yet | 2s | 256 MB | Judgeable |
| Number Word SortSort integers from M to N by comparing their digits spelled out as English words rather than by numeric value, then print 10 per line. | Easy3 | SortingString+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Password GenerationGenerate all length-L increasing letter combinations from a given set of C letters that contain at least one vowel and two consonants, printed in lexicographic order. | Easy3 | BacktrackingBrute force+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Common NamesGiven two lists of unique lowercase names, find and print the count and sorted list of names common to both. | Easy3 | Hash mapSorting+1 | No attempts yet | 2s | 256 MB | Judgeable |
| Multiple of ThreeGiven a huge number as a digit string, repeatedly sum its digits until one digit remains, then report how many steps it took and whether the number is divisible by 3. | Easy3 | StringMath+1 | No attempts yet | 2s | 128 MB | Judgeable |
| CipherGiven an encrypted string built by zigzag row reading of a column-filled table, reconstruct the original string for a given number of columns. | Easy3 | SimulationMatrix+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Broken OdometerConvert an odometer reading that skips the digit 4 back into the real distance traveled, using a base-9-like digit mapping. | Easy3 | MathImplementation+1 | No attempts yet | 0.5s | 128 MB | Judgeable |
| Carbon CompoundsParse three molecules of C,H,O atoms and find coefficients 1 to 10 for each side that balance atom counts, lexicographically smallest. | Easy3 | Brute forceString+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Postfix Expression Evaluation 2Evaluate a postfix expression using given operand values and print the result rounded to two decimal places. | Easy3 | StackString+1 | No attempts yet | 2s | 128 MB | Judgeable |
| DNAGiven N DNA strings of length M, construct the string minimizing total Hamming distance to all, breaking ties lexicographically, and output that distance. | Easy3 | StringGreedy+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Surprising StringFor each string, check for every gap size whether all pairs of letters at that fixed distance are distinct, and report if the string is 'surprising'. | Easy3 | StringBrute force+1 | No attempts yet | 2s | 128 MB | Judgeable |
| OvertakingGiven entry and exit orders of N cars, count how many cars are not part of the longest common subsequence, meaning they overtook someone. | Easy3 | Dynamic programmingArray+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Text MessageSimulate typing a message on a numeric keypad, summing key press costs and extra wait times when consecutive characters share a key (except spaces). | Easy3 | SimulationString+1 | No attempts yet | 2s | 128 MB | Judgeable |
| DNA Decoding 2Given a DNA string up to 20 million bases, repeatedly collapse the rightmost two characters using a lookup table until one base remains. | Easy3 | StringSimulation+1 | No attempts yet | 1s | 2 MB | Judgeable |
| Distinguishing FilesGiven N files as sequences padded with zeros, find the minimum prefix length K that makes all files pairwise distinct. | Easy3 | StringBrute force+1 | No attempts yet | 2s | 128 MB | Judgeable |
| SaschaGiven a pronounced word and a dictionary of same-length words, find the dictionary word with the minimum Hamming distance, breaking ties by input order. | Easy3 | StringBrute force+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Secret LetterDecode a binary string into 6-bit chunks matching a fixed 8-letter code table by Hamming distance at most 1, printing the first unidentifiable chunk's position if any. | Easy3 | StringBrute force+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Similar WordsCount how many words differ from the first word's letter multiset by at most one insertion, deletion, or substitution. | Easy3 | Hash mapString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Roman NumeralsConvert two Roman numerals to integers, sum them, and output the sum as both an Arabic and a Roman numeral. | Easy3 | StringMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Spreadsheet Cell NamesConvert given row and column numbers into spreadsheet-style cell names like A1 or BC23, stopping at R0C0. | Easy3 | MathString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Window BlindsParse a grid of ASCII-drawn window blinds and count how many of the M×N windows show each of five possible blind heights. | Easy3 | SimulationImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Make a CrosswordBuild a grid where word A is placed horizontally and word B vertically, crossing at the first shared letter following a defined scan rule, filling the rest with dots. | Easy3 | StringImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Math HomeworkExtract every maximal run of digits from up to 100 strings, strip leading zeros, and print all extracted numbers sorted nondecreasing. | Easy3 | StringSorting+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Machine CodeGiven a sequence of instructions with parameters, compute the minimum NOPs needed so each instruction starts at an address divisible by 4. | Easy3 | GreedySimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Rock-Paper-Scissors ScoreGiven a player's rock-paper-scissors choices against several friends over multiple rounds, compute the actual score and the best possible score with foreknowledge each round. | Easy3 | SimulationGreedy+1 | No attempts yet | 1s | 128 MB | Judgeable |
| NoiseGiven two powers of ten with up to 100 digits and an operator, compute their sum or product using big-number arithmetic. | Easy3 | MathString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Croatian AlphabetParse a string left to right, greedily matching multi-character Croatian letter codes (like c=, dz=, lj), and count total letters. | Easy3 | StringGreedy+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Three PartsSplit a short lowercase string into three contiguous non-empty parts, reverse each part, and find the split that yields the lexicographically smallest concatenation. | Easy3 | Brute forceString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Secret EmailGiven an encrypted string, find matrix dimensions R<=C with R*C=N and largest R, then reverse a row-major-write column-major-read transposition to recover the original message. | Easy3 | MatrixString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Lexicographically Smallest Crossword WordExtract all horizontal and vertical maximal letter sequences of length at least 2 from a grid and output the lexicographically smallest one. | Easy3 | StringImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| IPv6Given a shortened IPv6 address with omitted leading zeros and possibly one '::' run, expand it into eight full 4-digit hex groups. | Easy3 | StringImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| Rhyme PatternGiven verses of four lines, extract each line's last syllable from its final word and classify the rhyme pattern as perfect, even, cross, shell, or free. | Easy3 | StringImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| Most Visited DomainsParse a list of URLs to extract each domain suffix and print the maximum visit count along with all domains that reach it, sorted alphabetically. | Easy3 | StringHash map+1 | No attempts yet | 1s | 128 MB | Judgeable |
| DECODEBuild a substitution cipher table from a key word placed at a given offset, then decode a given ciphertext using it. | Easy3 | StringSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Reaux! Sham! Beaux!Parse rock-paper-scissors rounds given in multiple languages per player, tally wins, and print each game's score and winner. | Easy3 | StringHash map+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Bug KingRepeatedly remove all occurrences of the substring "BUG" from each input line, using a stack-like scan since removals can form new matches, until none remain. | Easy3 | StackString | No attempts yet | 1s | 128 MB | Judgeable |
| Character RecognitionRead multi-line text blocks separated by blank lines, count '#' as unrecognized characters, and print the recognition percentage formatted with rounding rules. | Easy3 | StringImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| Adding Reversed NumbersReverse two given numbers, add them, then output the sum reversed with leading zeros dropped. | Easy3 | StringImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Turing Arithmetic ExpressionsGiven up to nine large integers and an arithmetic expression using them, evaluate the expression under mod-10 addition and multiplication with normal precedence and print the result digit. | Easy3 | MathString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Whitespace King: Aligning ColumnsReformat text lines so that words in each column line up to a width equal to the longest word in that column, with single spaces separating columns. | Easy3 | StringImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Alien Communication MasterclassGiven true bases and false bases, output a fixed-form product-of-factors equation that holds only for the true bases in that numeral system. | Easy3 | MathImplementation+1 | No attempts yet | 3s | 256 MB | Judgeable |
| Java vs C++Detect whether a name follows Java camelCase or C++ snake_case rules and convert it to the other style, or print an error if invalid. | Easy3 | StringImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| Unreliable MessengersGiven a sequence of reversible string transformations and the final message, undo each transformation in reverse order to recover the original message. | Easy3 | StringSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Remainder CalculationFor each test case, find the remainder when a base-B number D with up to ten million digits is divided by B-1. | Easy3 | MathNumber theory+2 | No attempts yet | 1s | 256 MB | Judgeable |
| My Brother's DiaryFind the Caesar shift whose most frequent ciphertext letter maps to E, print the smallest valid shift and the decrypted text, or NOT POSSIBLE if several shifts work. | Easy3 | StringImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| CIVIC DILL MIXRead groups of valid Roman numerals, add each group, and print the sum and case number back in standard Roman form. | Easy3 | StringMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| WordsRead lines until a line with a single #, and output each line with the characters of every word reversed, keeping spaces fixed. | Easy3 | StringImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| Memorable Phone NumbersNormalize each listed phone number to seven digits and report those appearing more than once, sorted, with their counts. | Easy3 | StringHash map+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Alien Base ConversionConvert a number written in base x into the same value written in base y, where both bases are between 2 and 36 and the value fits in four billion. | Easy3 | MathImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| To and FroDecode a message written row by row in alternating left-to-right and right-to-left order back into column-major plaintext. | Easy3 | StringSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Word RatiosFor each line of three equal-length lowercase words, apply the per-letter alphabet shift from the first word to the second onto the third, and output all four words. | Easy3 | StringImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Major ScalesFor each sequence of notes, list the keys whose major scale contains every note, ordered C through B. | Easy3 | ImplementationString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| EcologyCount how many times each tree species line appears, then print each species in lexicographic order with its share of the total, rounded to four decimals. | Easy3 | Hash mapString+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Zipf's LawFor each test case, count the words in a book body and print the words that appear exactly n times, in lowercase alphabetical order. | Easy3 | Hash mapString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| SoundexConvert each uppercase word into its Soundex digit code, collapsing adjacent letters that share a digit. | Easy3 | StringImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| ElectionCount the votes each candidate receives in one riding, ignore unknown names, and report the winner's party or independent, or tie if there is no strict winner. | Easy3 | Hash mapImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Request for ProposalGiven a set of requirements, score each proposal by how many requirements it meets, then pick the best one by compliance and price. | Easy3 | Hash mapString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| ROT13Decode lines of text by reversing the ROT13 cipher: each vowel shifts three places back in a fixed vowel order, each consonant ten back in a consonant order. | Easy3 | ImplementationString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Tales from DeCryptRead three LCG parameters, then walk the ciphertext byte by byte, advancing the generator only on printable ASCII, and apply the inverse rotation to each such byte. | Easy3 | SimulationMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Robot Roll CallGiven a roster of names and a multi-line data stream split on spaces and tabs, report for each roster name whether it appears as an exact token. | Easy3 | Hash mapString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Verdis QuoConvert valid Roman numerals to decimal integers using addition and subtraction rules. | Easy3 | StringSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Defining MomentFor each word, strip at most one valid prefix and one valid suffix, then substitute the matching English meaning, expanding the suffix after the prefix. | Easy3 | StringImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| It's My DerivativeFor each polynomial, print its derivative and the step-by-step evaluation of that derivative at a given x, matching the input's terse notation. | Easy3 | StringImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Choose Your Own AdventureEach page is a node with two outgoing choices or a terminal ending; print the unique path from page 1 to the single HAPPY ending. | Easy3 | GraphDFS+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Is the Name of This ProblemRead sentences until END and for each decide whether it has the form quote, phrase A, quote, space, A, printing Quine(A) or not a quine. | Easy3 | StringImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| SteganographyDecode hidden bits from odd/even runs of spaces in a text and decode five-bit groups into characters. | Easy3 | StringBit manipulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| NetiquetteDecide whether a one-line email breaks any of four netiquette rules about adjacent case, digits, isolated characters, or punctuation. | Easy3 | StringImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| Tanning SalonSimulate a tanning salon with a fixed number of beds, tracking arrivals and departures, and count how many customers leave without a bed. | Easy3 | SimulationImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| W's CipherDecrypt messages by extracting each of three character groups and rotating its subsequence right by the matching key. | Easy3 | StringImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Pronounceable PasswordsFor each lowercase password, check three rules: at least one vowel, no three vowels or consonants in a row, and no double letter except ee and oo. | Easy3 | StringImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Word AmalgamationFor each scrambled word, print all dictionary words that are anagrams of it in alphabetical order, or NOT A VALID WORD. | Easy3 | Hash mapSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Skew BinaryRead each skew binary string and print its decimal value, stopping at the terminating 0 line. | Easy3 | MathString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Polynomial ShowdownGiven nine polynomial coefficients from degree 8 down to the constant, print each polynomial with signs, exponents, and coefficients formatted to drop all unnecessary characters. | Easy3 | ImplementationSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Basically SpeakingConvert a number from one base to another (bases 2 to 16) and print the result right-justified in a 7-character field, or ERROR if it exceeds 7 digits. | Easy3 | MathImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| TranspositionTranspose a list of note names by a given number of semitones, then print each note using the 12 canonical sharp names. | Easy3 | StringHash map+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Take Your VitaminsFor each line of amount, unit, requirement, and name, print the rounded daily-value percentage; collect items under 1% into a trailing list. | Easy3 | ImplementationMath+2 | No attempts yet | 1s | 128 MB | Judgeable |