Problems

Pick a problem and write your solution in the built-in editor. The judge runs it against real test cases while you watch, and the wider archive is open to read whenever you like.

Total results457 problems
TitleLevelTopicsSolvedTime limitMemory limitJudge
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
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
EmojiGiven a short message, determine for each line whether it contains the Slack cat emoji expressed as an ASCII shortcode.Easy1StringImplementation+1No attempts yet1s512 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
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
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
Coverity CrosswordDecide whether every listed word appears horizontally, vertically, or diagonally in an 8 by 8 letter grid.Easy2String matchingMatrix+1No attempts yet2s256 MBJudgeable
TimeCount how many clock times from 00:00:00 through N:59:59 contain the digit K at least once.Easy2Brute forceImplementation+2No attempts yet1s256 MBJudgeable
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.Easy3MathNumber theory+2No attempts yet1s256 MBJudgeable
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.Easy3GraphDFS+2No attempts yet1s128 MBJudgeable
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!.Easy3MathNumber theory+2No attempts yet1s128 MBJudgeable
RingsCount how many of N rings, each a 10-letter circular string, contain a given search string when read around the circle.Easy3StringString matching+2No attempts yet1s128 MBJudgeable
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.Easy3Hash mapSimulation+2No attempts yet1s128 MBJudgeable
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.Easy3String matchingBrute force+2No attempts yet2s512 MBJudgeable
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.Easy3MathImplementation+2No attempts yet1s128 MBJudgeable
SurfingParse links out of HTML pages, print each link, then answer reachability queries between pages.Easy3GraphDFS+1No attempts yet1s128 MBJudgeable
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.Easy3String matchingBrute force+1No attempts yet1s128 MBJudgeable
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.Easy3String matchingStringNo attempts yet2s64 MBJudgeable
E-CasinoFind the smallest shift k where the observed bits match the public array up to a repeating mask.Easy3String matchingBrute forceNo attempts yet2s512 MBJudgeable
When I miss Korea, I log in to the serverDecide for each of up to 100 file names whether it starts with the pattern prefix and ends with the pattern suffix around the single asterisk.Easy3String matchingStringNo attempts yet1s128 MBJudgeable
Master of copy and pasteHanshin builds a target string by typing one character at a time or pasting a fixed clipboard string, and the task asks for the minimum total time.Easy3GreedyString matchingNo attempts yet2s256 MBJudgeable
KickFind the shallowest and deepest depths at which the reality notes appear as an evenly spaced subsequence of the dream notes.Easy3String matchingBrute forceNo attempts yet1s256 MBJudgeable
One PieceCount how many times a short uppercase pattern N appears as a substring of a longer string H, counting overlapping occurrences.Easy3StringString matching+2No attempts yet1s128 MBJudgeable
IDN Homograph AttackGiven a string, decide whether some character can be swapped for a different character that normalizes to the same form.Easy3StringHash map+2No attempts yet1s256 MBJudgeable
Issuing PlatesFor each of M plates, decide whether any of N bad words appears as a substring after mapping leetspeak digits to letters.Easy3StringString matching+2No attempts yet1s512 MBJudgeable
Cyclic ShiftsGiven a text T and a string S, decide whether T contains any cyclic shift of S as a contiguous substring.Easy3StringString matching+2No attempts yet2s512 MBJudgeable
Document SearchGiven a document and a word, find the maximum number of non-overlapping occurrences of the word within the document.Medium4String matchingGreedy+1No attempts yet2s128 MBJudgeable
String SearchImplement KMP string matching to count and list all 1-indexed starting positions where pattern P occurs in text T of length up to 1,000,000.Medium4String matchingStringNo attempts yet2s256 MBJudgeable
Writing Consecutive Numbers 3Given N, find the earliest 1-based index where the digit-string of N occurs inside the concatenation of integers 1 through N.Medium4String matchingString+1No attempts yet2s128 MBJudgeable
Drawing PolygonsGiven a reference closed-path digit sequence tracing a polygon, find which candidate sequences represent the same polygon allowing rotation of starting point and direction reversal but not geometric rotation or reflection.Medium4String matchingString+1No attempts yet1s128 MBJudgeable
Remaining Letters in a Word SearchGiven a letter grid and a word list, find every 8-direction occurrence of each word, cross out those letters, and print the remaining letters in row-major order.Medium4MatrixString matching+2No attempts yet1s128 MBJudgeable
Radio TransmissionGiven a received string that is part of a repeated broadcast, find the length of the shortest repeating unit using KMP failure function.Medium4String matchingStringNo attempts yet1s128 MBJudgeable
Search by templateParse a pattern with literal letters, wildcards, and allow/forbid letter groups, then find all positions where it matches inside a large text.Medium4String matchingString+1No attempts yet2s128 MBJudgeable
PeriodFor every prefix of a string, find the largest exponent K such that the prefix equals some string A repeated K times, using KMP failure function.Medium4String matchingString+1No attempts yet1s128 MBJudgeable
HumidexGiven any two of temperature, dew point, and humidex per line, compute and print the third rounded to one decimal.Medium4MathImplementation+2No attempts yet1s128 MBJudgeable
TreadmillScan a sample stream for chirp bit patterns and decode each chirp's speed and inclination, printing its start time.Medium4ImplementationString matching+1No attempts yet1s128 MBJudgeable
ColorvilleSimulate players advancing on a colored board by drawing cards, and report who wins or that the deck ran out.Medium4SimulationImplementation+2No attempts yet1s128 MBJudgeable
Automatic EditingApply a fixed list of find-and-replace rules in order, repeatedly replacing the first occurrence of each find string until it no longer appears, and print the final text.Medium4StringSimulation+2No attempts yet1s128 MBJudgeable
A Tale from the Dark Side of the MoonReimplement a lost text filter that applies four ordered string rules per line, including conditional ei to ie and dd to p replacements, stopping at a line reading EOF.Medium4StringImplementation+2No attempts yet1s128 MBJudgeable
MapsFor each scenario, count how many positions in the map contain an exact, non-rotated copy of the rig pattern, with both X and dot cells matching. The image is trimmed, so every position in its bounding box matters.Medium4Brute forceImplementation+2No attempts yet1s128 MBJudgeable
Stump SpeechGiven scored key phrases and a speech, sum each phrase's score times its number of occurrences in the speech.Medium4StringString matching+1No attempts yet1s128 MBJudgeable
Prefix CodesDecode several binary messages with a prefix code given as a heap-indexed tree string, where a bit 0 or 1 walks to a child until a leaf symbol is reached.Medium4TreeImplementation+2No attempts yet1s128 MBJudgeable
Word PuzzleGiven a letter grid and a list of words, find each word's starting cell and one of eight reading directions, choosing the earliest match by row, column, then direction.Medium4ArrayBrute force+2No attempts yet1s128 MBJudgeable
R.Ø.L.P. Code WheelFor each encoded message, try all 42 wheel shifts and print every decoding that contains the substring RØLP.Medium4StringBrute force+2No attempts yet1s128 MBJudgeable
Parsing Real NumbersGiven T lines, decide whether each line is a valid real number with optional sign, decimal point, and exponent, allowing surrounding blanks.Medium4StringImplementation+2No attempts yet1s128 MBJudgeable
Year 2000Read n lines of text and expand the two-digit year in every date that matches one of three fixed formats, leaving all other characters unchanged.Medium4StringImplementation+2No attempts yet1s128 MBJudgeable
WalkParse walking segments given as duration and pace per kilometre, then report total distance in metres and average speed in km/h.Medium4ImplementationMath+2No attempts yet1s1024 MBJudgeable
OulipoCount overlapping occurrences of a pattern W in a text T over uppercase letters for each test case.Medium4String matchingStringNo attempts yet1s128 MBJudgeable
Special JudgeDecide whether the given string appears as a contiguous block in both A and B.Medium4String matchingStringNo attempts yet1s128 MBJudgeable
CasinoFind every longest palindromic substring of length at least 2 in each string and print them rightmost first.Medium4StringString matchingNo attempts yet1s128 MBJudgeable
C.S.I.: P15Count ground-connected 8-connected flower components and isolated /\/\ bird patterns in each ASCII picture.Medium4DFSString matchingNo attempts yet1s256 MBJudgeable
Dinner Menu RouletteCount rotations that turn the current wheel letters into the target menu string and print the share as a reduced fraction.Medium4String matchingMathNo attempts yet5s256 MBJudgeable
Smallest number missing from a digit sequenceGiven up to 1000 digits, find the smallest non-negative integer that never occurs as a consecutive block without a leading zero.Medium4String matchingBrute forceNo attempts yet1s256 MBJudgeable
Cyclic RotationsCount the left rotations of binary string B that exactly equal binary string A.Medium4String matchingNo attempts yet2s512 MBJudgeable
Music Collection (Small1)For each song, find the shortest substring that appears in that song and in no other song, breaking ties by a custom lexicographic order.Medium4String matchingBrute forceNo attempts yet5s512 MBJudgeable
Alien Language (Large)Given a word list and patterns with letter-group tokens, count for each pattern how many words match it.Medium4String matchingBrute forceNo attempts yet5s512 MBJudgeable
Infinite stringGiven two strings of length at most 50, decide whether each repeated infinitely produces the same infinite string.Medium4StringString matchingNo attempts yet2s512 MBJudgeable
ABBGiven a string of colors, find how many characters must be appended at the end so the resulting string becomes a palindrome.Medium4StringString matching+2No attempts yet2s512 MBJudgeable
AdvertisementGiven the L characters currently visible on a scrolling sign showing an infinitely repeated text, find the minimum possible length of the original advertisement text.Medium5String matchingStringNo attempts yet2s128 MBJudgeable
Text FormalizationExpand every contraction and the first occurrence of each acronym in a text, following case rules and leftmost-earliest matching priority.Medium5StringString matching+2No attempts yet1s128 MBJudgeable
Submarine IdentificationDecide whether a binary string can be split into pieces of '01' or '1' followed by at least two 0s and at least one 1, using pattern matching or DP.Medium5Dynamic programmingString matching+1No attempts yet1s128 MBJudgeable
BuzzwordsFor each line, strip spaces and report the highest occurrence count among substrings of length 1, 2, 3, and so on, stopping at the first length where no substring repeats.Medium5StringHash map+2No attempts yet1s128 MBJudgeable
Scrolling SignGiven k-wide words, find the minimum total letters scrolled in so that each word appears in order, allowing overlap between consecutive words.Medium5Dynamic programmingString+2No attempts yet1s128 MBJudgeable
String ExponentiationGiven a string, find the largest exponent n such that the string is a repetition of some base string a raised to n.Medium5StringString matching+1No attempts yet1s256 MBJudgeable
Blue JeansGiven up to 10 DNA strings of length 60, find the longest substring that appears in all of them, breaking ties alphabetically, or report none of length 3 or more.Medium5StringBrute force+2No attempts yet1s128 MBJudgeable
IOIOICount the occurrences of the alternating string P_N (N+1 I's and N O's) as a substring of S, counting overlaps.Medium5StringSliding window+2No attempts yet1s256 MBJudgeable
Erdös NumbersPapers list authors under titles, and each query asks the shortest co-authorship distance from Erdos; unreachable authors get infinity.Medium5GraphBFS+2No attempts yet1s128 MBJudgeable
Solving Linear EquationsParse each linear equation written in a recursive grammar with parentheses and multiplication, then report no, infinite, or the unique solution rounded to six decimals.Medium5MathRecursion+2No attempts yet1s128 MBJudgeable
Alternative Scale of NotationGiven a base B and a non-negative decimal integer x, find the unique string of digits from 1 to B whose value under the shifted base-B map equals x.Medium5MathImplementation+2No attempts yet1s128 MBJudgeable
Binary WitchGiven a binary string, predict the next L digits by matching suffixes of length 13 down to 1 against earlier occurrences, using the rightmost match.Medium5StringString matching+2No attempts yet1s128 MBJudgeable
RepetitionsGiven up to five lowercase words of length at most 2000, find the length of the longest substring that appears as a contiguous fragment in every word.Medium5StringBinary search+2No attempts yet3s128 MBJudgeable
KonkotenacjaCount the ways to split the word into nonempty pieces joined by the literal separator kot, modulo 1000000007.Medium5Dynamic programmingPrefix sum+1No attempts yet2s128 MBJudgeable
BeehivesThe program decides whether two move records describe the same hexagonal layout under rotation and reversed reading, with mirror images treated as different.Medium5GeometryString matching+1No attempts yet1s128 MBJudgeable
Cracking the CodeGiven a plaintext and ciphertext candidates under a substitution cipher, keep every consistent match and decrypt X, printing '?' for ambiguous letters.Medium5String matchingBrute force+1No attempts yet2s128 MBJudgeable
ChorusFor each lyric, find its longest repeated substring and list which songs contain each query as a substring of it.Medium5String matchingBinary search+1No attempts yet1s128 MBJudgeable
String ExplosionRepeatedly delete every occurrence of the explosion string until none remains, printing FRULA when nothing is left.Medium5StackString matchingNo attempts yet2s128 MBJudgeable
Clock PhotosDecide whether two sets of hand angles on a dial coincide after rotating one photo.Medium5SortingString matchingNo attempts yet1s256 MBJudgeable
Word SearchFind each listed word in the letter grid in any of eight directions and output leftover letters, or report missing or ambiguous placements.Medium5String matchingMatrix+1No attempts yet1s256 MBJudgeable
CensoringRepeatedly delete the first occurrence of T from S, including matches formed by earlier deletions, and print what remains.Medium5String matchingStackNo attempts yet1s256 MBJudgeable
CensoringRepeatedly delete the first occurrence of pattern T from string S until none remains and print the result.Medium5StackString matchingNo attempts yet1s256 MBJudgeable
MoocryptionFind the substitution cipher with no fixed letters that yields the most MOO strings in all eight grid directions.Medium5Brute forceMatrix+1No attempts yet1s256 MBJudgeable
Counting Cafeteria MenusCount how many distinct dish sets appear when the current set of N out of M dishes shifts forward by one each meal.Medium5String matchingArray+1No attempts yet2s256 MBJudgeable
Palindrome??Answer up to a million queries asking whether a subarray of the given number sequence reads the same forward and backward.Medium5String matchingPrefix sumNo attempts yet1s256 MBJudgeable
Car GameFind the first dictionary word that contains each three-letter plate as a subsequence, or report that none exists.Medium5String matchingArrayNo attempts yet2s256 MBJudgeable
Find the Hidden WordGiven a list of known words and several messages, find which listed words occur as substrings in each message and report NO, the unique word, or AMBIGUOUS.Medium5String matchingTrieNo attempts yet1s256 MBJudgeable
Number of distinct substringsCount how many different contiguous substrings appear in a lowercase string of length up to 1000.Medium5String matchingHash map+1No attempts yet1s512 MBJudgeable
Typewriter Monkey (Small)Find the expected leftover bananas, which is the maximum achievable count of the target word minus its expected count in a random length S string.Medium5ProbabilityBrute force+1No attempts yet5s512 MBJudgeable
Typewriter MonkeyFrom keyboard letter frequencies, subtract the expected overlapping occurrences of a target word in a random length-S string from the maximum possible count.Medium5ProbabilityString matchingNo attempts yet5s512 MBJudgeable
Music Collection SearchFor each song name, find the shortest case-insensitive substring that appears in that name alone, breaking ties by a custom lexicographic order.Medium5String matchingBrute force+1No attempts yet5s512 MBJudgeable
Irregular Expressions (Large)Decide if any substring of each string splits into equal start and end words of two or more syllables around a middle word.Medium5Brute forceString+1No attempts yet5s512 MBJudgeable
Secret PasswordGiven two length-N sequences, decide whether one is a cyclic rotation of the other.Medium5String matchingArray+2No attempts yet1s64 MBJudgeable
Champernowne ConstantFor each query, print the K digits of the Champernowne constant starting at decimal position N, where integers are concatenated in order.Medium5MathString matching+1No attempts yet8s512 MBJudgeable
DNA stringGiven a DNA string S, find the shortest string over A, C, G, T that never occurs as a contiguous substring of S, breaking ties lexicographically.Medium5StringString matching+1No attempts yet2s512 MBJudgeable
Rock Paper Scissors MachineGiven two RPS strings, choose where in the opponent's longer string to start matching your shorter string and report the most wins.Medium5StringString matching+2No attempts yet1s512 MBJudgeable
PasswordsCount ordered pairs of distinct passwords where one string is a substring of the other, treating the passwords as a multiset of short strings.Medium5String matchingHash map+1No attempts yet1s64 MBJudgeable
nnnnnGiven L equal to n times the digit length of n, recover n for L up to a 10^6-digit number.Medium5MathBinary search+2No attempts yet2s512 MBJudgeable
Candy ChainGiven a candy string and a list of paid parts (each reversible), find the maximum total value obtainable by repeatedly removing sold parts and rejoining the remainder.Medium5Dynamic programmingIntervals+2No attempts yet7s512 MBJudgeable
I Have Few Friends (Large)Find whether keyword K appears in S as an exact substring, digits and all, and print 1 or 0.Medium5String matchingString+1No attempts yet1s128 MBJudgeable
Making a PalindromeFind the largest odd-length palindrome centered at index i, then answer each query by dropping the rest of the N cards.Medium5String matchingDynamic programming+1No attempts yet1s512 MBJudgeable