Practice.
Solve it. Then understand it.
Real problems in a real IDE that runs on your device. Every problem passed review, every expected output came from running verified code, and each one opens the full Iksha loop — learn, predict, debug, explain, modify, transfer, recall.
- 117 problems
- 1,620 verified tests
- 10 learning modes
- runs on your device
- 01Learn
- 02See
- 03Predict
- 04Code
- 05Run
- 06Debug
- 07Explain
- 08Modify
- 09Transfer
- 10Recall
Pick a pattern to master
An online shop stores each cart amount as a signed number of cents. Positive entries represent product charges, while negative entries can represent refunds or discounts. The checkout service needs one function that combines every stored entry into the final order adjustment, including an empty cart.
Given an integer array of signed cart amounts in cents, return their total.
total_cart_amounts(…)A document-processing service assigns consecutive integer IDs to tokens in a diagnostic log. Given the smallest and largest allowed IDs, find two different IDs whose least common multiple is also an allowed ID. The service needs a direct construction rather than a search through all token-ID pairs.
Given an inclusive interval from `lower_id` to `upper_id`, return two distinct integers from that interval whose least common multiple is within the same interval.
find_log_token_pair(…)A document analysis tool assigns each token an integer impact score. For one review request, the tool receives the scores and the positions of the first and last token in a highlighted span. Compute the span's combined impact score.
Given a non-empty list of integer token scores and two valid positions, return the sum of all scores from start through end, including both endpoints.
sum_token_span(…)In a level editor, each move in a combo earns a short tag for the replay board. Given the ordered move labels and the tag to attach, build the displayed replay sequence without changing the original move list.
Write a function that creates a new sequence from an ordered list of move labels and a supplied tag.
tag_moves(…)Let two finite sequences be written in order. At each shared position, join the two strings into one string. The resulting sequence contains only positions present in both input sequences.
Implement a function that receives two lists of strings.
join_aligned_words(…)A warehouse must decide which of four shipments deserves attention first. Each shipment has an integer priority score: larger scores mean more urgent handling, while negative scores indicate low urgency. Find the greatest score among the four shipments.
Write a function that receives the priority scores for exactly four shipments and returns the greatest score.
highest_shipment_priority(…)A distribution hub records the cargo weight of each shipment loaded onto a truck, in loading order. The dispatcher wants a new list showing the combined weight of every shipment with the one loaded immediately after it. These are overlapping pairs: each interior shipment contributes to the pair before it and the pair after it.
Given an integer array shipments representing shipment weights in loading order, return an array containing the sum of each pair of consecutive weights.
consecutive_cargo_totals(…)A warehouse records shipment identifiers as parcels move through a loading line. For auditing, each shipment must be paired with the shipment immediately after it in the recorded order. Create the ordered list of all such neighboring handoffs.
Write a function that receives the shipment identifiers in their recorded order and returns every pair of consecutive identifiers.
list_shipment_handoffs(…)A file auditor reviews a batch of exported record lines and wants to know how many lines exactly match a flagged record label. Each line is treated as one complete string, including any spaces or other characters it contains.
Implement a function that counts the records in a file batch that are exactly equal to the requested target string.
count_matching_records(…)A document-processing service assigns an integer sentiment score to each recorded entry in an audit log. Scores below zero indicate an unfavorable entry. Create a small analysis function that reports how many recorded scores are unfavorable, without changing the log order or storing another collection.
Given an integer array of audit-log scores, return the number of elements whose value is strictly less than zero.
count_negative_scores(…)A monitoring service receives a batch of integer telemetry readings from a device. An alert floor identifies readings that are high enough to qualify for review. Repeated readings represent repeated measurements and must each be considered. Determine how many readings are at least the alert floor.
Implement a function that counts the readings whose value is greater than or equal to the given alert floor.
count_alert_readings(…)A regional logistics center records the destination code for each shipment loaded onto a truck. Given the ordered list of destination codes and one warehouse code, determine how many shipments are headed to that warehouse.
Implement a function that receives an integer array of shipment destination codes and a target warehouse code.
count_shipments_for_warehouse(…)A logistics system stores warehouse codes in the order they were registered. A dispatcher asks for the code at a particular position, where counting starts at zero. Negative positions count backward from the final code, following ordinary Python-style indexing.
Given an ordered list of distinct warehouse codes and a requested position, return the code at that position.
find_warehouse_key(…)A regional warehouse records the weights of packages loaded onto one delivery route. The dispatch team needs to know the lightest package in the shipment list so it can choose suitable handling equipment. Inspect the recorded weights and report the smallest one.
Implement a function that receives the package weights for one delivery route and returns the minimum weight.
find_lightest_shipment(…)During a game run, a tracker records the score earned after each move. A special review mode checks the first recorded score, then skips a fixed number of positions before checking the next one. Build the score streak that this review mode sees.
Implement a function that receives a list of move scores and a positive stride.
extract_score_streak(…)A warehouse records one integer handling value for each shipment on a dispatch manifest. The operations team wants a new manifest containing only values divisible by two. The retained values must stay in their original order, and repeated values must remain repeated.
Write a function that receives the shipment handling values from a warehouse manifest and returns a new array containing exactly the values divisible by two.
filter_even_shipments(…)In the arcade game Neon Rally, a player’s move scores are recorded in order. The combo board links each move with the move immediately after it. For every such neighboring pair, create one combo score by adding the two scores. Linked pairs overlap: a move may contribute to the pair before it and the pair after it.
Implement a function that receives the ordered scores from a game run.
combine_adjacent_scores(…)Two players complete the same game mode and record their score after each move. Their runs may contain different numbers of moves. Compare the records by move position and measure how often both players had exactly the same score at that position.
Implement a function that receives two integer score histories.
count_matching_score_moments(…)A game stores a scoring table as two synchronized arrays. Each position represents one entry: level_ids[i] identifies a level, while scores[i] stores that level's points. The table keeps its entries in play order, and level IDs are unique. A replay tool needs only the level IDs, in the same order they appear in the table.
Given the ordered arrays level_ids and scores, return a new array containing every level ID exactly once and in its original entry order.
extract_level_ids(…)In the arcade game Neon Ladder, two players record score changes across successive levels. The first list contains your changes and the second contains your rival's changes. The level logs may end at different times. Calculate the score gap for every level recorded by both players, keeping the original order.
Write a function that compares two ordered score-change logs.
score_gap_sequence(…)A document review tool compares three versions of a note: an editor draft, a reviewer copy, and the published text. The versions may stop at different points. The tool needs to measure how many shared token positions contain exactly the same word in all three versions.
Write a function that counts aligned positions where the three supplied token lists contain identical words.
count_shared_token_positions(…)Consider a finite sequence of lowercase tokens and a numerical cutoff. Some tokens are longer than the cutoff, while others are not. Select exactly the qualifying tokens without changing their order or collapsing repeated values.
Implement a function that receives a sequence of tokens and an integer threshold.
select_long_tokens(…)A document auditor records two ordered measurements for a text: the number of tokens in successive sections and a divisor assigned to each section. Create a compact report by combining corresponding measurements. The report must preserve document order and include only positions present in both lists.
Implement a function that examines the two input lists position by position.
build_token_remainder_report(…)An archive system assigns an integer score to each token found in a document audit log. The scores may be positive, negative, or zero, and repeated scores remain separate entries. Return the combined score for the complete log, including the neutral result when no tokens were recorded.
Write a function that receives the integer scores from one document audit log and returns their total.
sum_audit_scores(…)A logistics company keeps a shipment registry mapping internal shipment codes to package weights. The registry system supplies its stored numeric values as an array, while the codes are omitted because they do not affect the calculation. Find the combined weight of all registered shipments.
Implement a function that returns the total of every value in the given shipment registry.
sum_registry_values(…)In the arcade game Neon Rift, a player receives a base score and a combo bonus at each move. The two score logs may stop at different times. Combine the logs position by position to create the player's merged score log.
Write a function that combines two integer lists, base_scores and combo_bonuses.
merge_move_scores(…)In the arcade game Neon Vault, each player records a sequence of moves as a lowercase word. The game designer wants to activate a bonus only when every recorded move sequence uses exactly the same number of characters as the chosen move-length setting.
Write a function that decides whether every move sequence in a collection has exactly the required length.
all_moves_have_length(…)A regional warehouse records one integer dispatch signal for each shipment scheduled on a route. A nonzero signal means the shipment has a usable dispatch record, while zero means the record is missing. Before releasing the route, the logistics system must decide whether every recorded signal is usable.
Write a function that returns whether every dispatch signal in the given sequence is truthy.
all_dispatch_signals_valid(…)A community platform wants to estimate how many outreach actions are needed to bring a user into a private group. Each action can advance the user's progress by exactly one of two fixed trust boosts. The user is considered ready once total progress reaches or passes the required threshold. Find the fewest actions needed.
Implement a function that returns the minimum number of outreach actions needed to reach or pass a target progress value.
minimum_outreach_actions(…)An arcade cabinet stores the scores earned during recent runs. The board may be empty, may repeat the same score, and may contain negative or zero scores from special game modes. A player asks whether a particular score appears anywhere on the board.
Write a function that determines whether the target score occurs in the given score array.
score_is_recorded(…)In the arcade game Neon Vault, every move has a momentum marker. The marker can be positive, zero, or negative depending on the player's current streak. The scoring engine awards a rectangular momentum bonus based on the marker and the next consecutive marker value.
Implement a function that calculates the momentum bonus for a given integer marker.
calculate_momentum_bonus(…)A file-ingestion tool receives one record as a string before parsing it. The record may contain letters, digits, punctuation, spaces, or other whitespace. Determine how many characters the tool received so it can track record sizes consistently.
Write a function that returns the number of characters in the supplied file record.
count_record_characters(…)In the arcade game Neon Vault, a player's move log is stored as a short text string. Some characters are lowercase letters, while spaces may separate move names. The scoring system awards one bonus point for every lowercase letter recorded in the log.
Write a function that counts how many characters in the move log are lowercase letters from a through z.
count_lowercase_moves(…)In the arcade game Neon Sprint, a replay is stored as a sequence of lowercase letters and spaces describing the moves a player made. The scoring engine keeps markers from moves at alternating positions to create a compact replay tag. You must retain the characters at even zero-based positions, leaving the original order unchanged.
Write a function that receives a replay string.
keep_even_move_markers(…)A game displays a level-up combo label as a string. Blank spaces mark unfinished slots, and the score screen provides a character to fill them. Transform the label so every blank slot shows that character while every existing lowercase letter stays unchanged.
Write a function that updates a level-up combo label.
fill_combo_slots(…)A warehouse prints a compact shipment label for each delivery. The dispatch system needs a shortened label containing the characters found at positions 0, 2, 4, and so on, using zero-based positions. Character order must remain unchanged, and spaces are valid label characters.
Write a function that receives one shipment label and returns the subsequence formed by keeping every character whose zero-based position is even.
keep_even_label_positions(…)A warehouse system stores the lowercase letters printed along a shipment’s handling sequence. A supervisor asks where a particular label marker was seen most recently. Your function must report the zero-based position of the final occurrence, or indicate that the marker never appeared.
Implement a function that searches the shipment label sequence from left to right for the requested one-character marker.
find_last_label_position(…)A word is treated as a sequence of lowercase letters. Among its letters, the vowel class is {a, e, i, o, u}. Determine the greatest number of consecutive positions occupied by vowels.
Implement a function that returns the length of the longest contiguous substring made entirely of lowercase vowels.
longest_vowel_streak(…)Let two finite strings be given: a source word and a nonempty leading token. Decide whether the token is exactly the initial segment of the source word. The comparison concerns only the beginning of the source; an identical sequence appearing later does not count.
Write a function that classifies whether source begins with prefix.
begins_with_prefix(…)A finite string is viewed as a sequence of symbols. Each symbol belongs to exactly one of three classes: alphabetic characters, decimal digits, or all remaining characters. Determine how many symbols belong to each class.
Write a function that examines every character in symbols exactly once and counts the characters in three disjoint classes.
count_character_classes(…)A warehouse loads shipments onto a delivery truck in a planned sequence. The loading supervisor wants to know whether each shipment is no lighter than the one immediately before it, so the weights never decrease along the route. Equal weights are acceptable, and an empty or one-shipment load is considered ordered.
Implement a function that checks whether the shipment weights are in nondecreasing order from the first loaded shipment to the last.
is_shipment_ordered(…)A document index stores one signed annotation score for each token. Negative scores are invalid markers left by an earlier parsing pass, while zero and positive scores are usable. Clean the list directly so the index can reuse the same storage without changing the order of valid token annotations.
Implement a function that receives a mutable list of integer token annotations.
clean_token_annotations(…)A monitoring service stores each event label as a token in the order it appeared. Bursts can repeat the same label many times in a row, making a log excerpt noisy. Create a cleaned token sequence that keeps one label for each consecutive burst while retaining separate appearances when another label occurs between them.
Implement a function that receives an ordered list of log tokens and returns a new list with each maximal run of adjacent equal tokens reduced to one representative.
compress_log_runs(…)A logistics hub receives two dispatch lists from separate warehouses. Each list is already ordered by package priority number, from smallest to largest. The hub needs one combined dispatch list that keeps the same ordering and includes every package entry, even when several packages share a priority number.
Implement a function that combines two nondecreasing integer arrays into one nondecreasing array.
merge_dispatch_lists(…)An arcade challenge stores each player's result as a pair of text values: points earned and level reached. Before the results are placed on the high-score display, convert every pair into integers. Some players may have identical cards, and their original order must remain unchanged.
Write a function that receives a list of score cards.
convert_score_cards(…)A logistics planner records the warehouse identifiers visited by a shipment in order. A delivery request also specifies a short required handoff sequence. Determine whether that required sequence appears as consecutive entries somewhere in the recorded visit list.
Given a source list of warehouse identifiers and a target list describing a required handoff sequence, return whether the target occurs as one contiguous subsequence of the source.
contains_handoff_sequence(…)A document index stores token-priority numbers in reading order. The index was created by cutting a nondecreasing priority list at one position and moving its beginning to the end. To restore the canonical starting point, locate the first place where a priority is greater than the next one.
Implement a function that returns the zero-based position where the given token-priority sequence should begin so that its cyclic rotation is nondecreasing.
find_token_wrap_point(…)A text-indexing service reviews tokens extracted from a document and needs the lexicographically greatest token for a summary label. The tokens are already supplied as a list, so scan them without reordering the document data.
Implement a function that returns the lexicographically greatest token in the supplied list.
greatest_document_token(…)A text archive stores each document as a separate list of compact token labels. A cleanup stage needs to read every document from its final token back to its first token, while keeping documents separate. Build the transformation that reverses each document independently.
Given a collection of documents, where each document is represented by a sequence of token labels, reverse the token order inside every document.
reverse_document_tokens(…)A document-quality tool receives a stream of normalized words from a text file. Repeated neighboring words can indicate emphasis or accidental duplication, so the tool records each uninterrupted stretch as one group while preserving the document’s order.
Write a function that partitions a list of document tokens into maximal contiguous groups.
group_document_runs(…)In the arcade game Neon Vault, a player’s score is recorded after each level. The game designer wants to detect whether the run progressed steadily: a later score may match an earlier score, but it must never be lower. This helps identify score histories that follow the expected progression.
Write a function that checks whether the scores in a Neon Vault run are nondecreasing from first to last.
is_steady_score_run(…)In a gaming challenge, each player has score bonuses recorded by level and move. A second record gives the matching multiplier for each position. Build the combined score record by multiplying values that occupy the same level and move position.
Implement a function that combines two nested integer sequences.
combine_level_scores(…)A proofreading tool compares a clean token list with a revised list. The revised document contains every token from the clean list in the same order, plus one additional token. The tool needs the index where the aligned sequences first separate, using zero-based positions.
Given a reference token sequence and a revised token sequence, return the earliest zero-based index at which their aligned tokens differ.
find_extra_token_position(…)A fulfillment company records the shipment labels scanned at two warehouses. Each manifest is an ordered list of shipment records, and each record contains a fixed sequence of lowercase labels. Determine whether the two manifests describe exactly the same records in the same order, including repeated records and repeated labels.
Write a function that checks whether two warehouse manifests are structurally identical.
manifests_match(…)A warehouse records signed crate-count adjustments at successive loading checkpoints along a delivery route. For planning handoffs, the dispatcher needs the combined adjustment for each pair of neighboring checkpoints, preserving route order.
Write a function that receives the ordered checkpoint adjustments for one delivery route.
neighboring_dock_totals(…)A warehouse records the package counts loaded onto vehicles in departure order. Dispatch changes the schedule by moving the final portion of this list to the front, wrapping around when the requested displacement exceeds the list length. Build the adjusted departure sequence without changing any recorded count.
Given a list of integer shipment loads and a requested rightward displacement, return the list after cyclically moving elements to the right.
reorder_shipment_loads(…)During a game level, a player records score changes in one mutable list. Negative values are penalties, while zero and positive values are gains or neutral events. Reorganize the list in place so every penalty appears before every nonnegative change.
Write a function that rearranges the given score-change list in place.
partition_score_changes(…)In an arcade challenge, a player's score history is recorded in order. The opening score is special: every time that same score appears, it must be moved to the end of the history. All different scores must stay ahead of it and keep their original order.
Given a list of scores, use its first value as the selected score.
shift_opening_score(…)A player’s level scores are recorded in order along a score ladder. After a special move, the ladder advances cyclically: the requested number of leading scores moves to the end, while every score keeps its original cyclic order. Very large move counts may represent repeated full turns.
Write a function that cyclically shifts a sequence of level scores to the left by the requested number of moves.
shift_score_ladder(…)A distribution center receives three manifests for shipments handled during the same processing run. Each list records one integer shipment code in processing order, but the manifests may have different lengths. Find the codes whose entries agree at the same position in all three manifests.
Write a function that compares three integer shipment-code lists position by position.
find_matching_shipments(…)A monitoring team keeps a catalog of approved labels used by a service. Each incoming audit log produces a list of observed labels, possibly with repetitions. Check whether the log uses only labels found in the catalog.
Given a collection of approved tokens and a collection of observed log tokens, determine whether every observed token appears somewhere in the approved collection.
has_token_coverage(…)A regional warehouse prepares a dispatch list of shipment IDs. Some IDs belong to deliveries temporarily held at another facility and must be excluded. Create the final dispatch list by removing every source ID that appears in the hold list, while keeping all remaining IDs in their original order.
Given a list of shipment IDs scheduled for dispatch and a list of shipment IDs currently on hold, return a new list containing exactly the scheduled IDs that do not occur in the hold list.
filter_eligible_shipments(…)In the arcade game Neon Rally, a player's combo produces one score for each move. The scoreboard analyst wants to know whether every recorded combo score belongs to the same score class, treating repeated scores as one class. This helps identify perfectly consistent scoring runs.
Given the recorded combo scores in order, determine whether all scores are identical.
has_one_score_class(…)A proofreading tool scans short token sequences extracted from documents. Identical sequences should share one record, even when they appear in different documents. You will count how often each distinct ordered sequence occurs, preserving the order in which distinct sequences first appear.
Given a collection of documents represented as lists of tokens, count the occurrences of every distinct document sequence.
count_sequence_occurrences(…)In the arcade game Neon Vault, a level awards bonus scores from 0 up to a level's score limit. The leaderboard groups scores by their remainder when divided by a combo modulus. Find the highest possible bonus score in the requested group.
Write a function that finds the greatest integer score from 0 through score_limit, inclusive, whose remainder when divided by modulus equals target_remainder.
last_combo_score(…)In the game Skyforge Sprint, a player records a score at each checkpoint of a special challenge. The first checkpoint has a known score, and every later checkpoint changes the score by the same fixed amount. The challenge may contain no checkpoints. Calculate the combined score across all checkpoints.
Implement a function that calculates the total score recorded across a challenge's checkpoints.
total_level_scores(…)A reporting system assigns meaning to positive odd-numbered revenue markers. Given the first and last marker numbers in a requested interval, calculate the total of every positive odd marker included by that interval. The report must answer instantly even when the bounds span a very large range.
Implement a function that returns the sum of all positive odd integers from lower_bound through upper_bound, including both endpoints when they qualify.
sum_odd_markers(…)A document indexing service processes tokens in recurring batches. Its audit reports examine groups of every size from 1 through a configured limit, so a complete audit cycle must contain a number of tokens divisible by each of those group sizes. Determine the shortest positive cycle that satisfies all report schedules.
Given the largest required group size, return the smallest positive number of tokens that can complete every audit grouping from size 1 through that limit.
find_universal_token_batch_size(…)A warehouse records a space-separated line of lowercase labels for packages loaded onto a delivery route. Dispatchers need to check whether a particular label appears in that record before assigning handling instructions.
Write a function that checks whether the query token occurs in the shipment text.
contains_shipment_label(…)A document-processing service writes one compact record for each work cycle. Each record contains a lowercase period label and the ordinal day within that period. The service uses a repeating set of four phase categories, with a threshold that advances the category near the end of each period.
Implement a function that returns the category assigned to a processing log record.
classify_log_phase(…)Mira is cleaning short event logs before displaying them. Each log is stored as an ordered list of tokens. To create a mirrored rhythm, she wants every neighboring pair exchanged: the first and second tokens trade places, then the third and fourth, and so on. If the log has an odd number of tokens, its final token has no partner and stays at the end.
Write a function that transforms the supplied token list by reversing each consecutive non-overlapping pair from left to right.
flip_log_tokens(…)A document-processing pipeline tracks token counts for the first two versions of an automatically expanded draft. Later versions follow a fixed recurrence, so the archive team wants to predict the count at a requested version without storing every earlier count.
The first two draft versions have token counts initial_terms[0] and initial_terms[1], corresponding to positions 0 and 1.
predict_token_count(…)A document archive stores a short label for each document and the tokens extracted from it. The archive keeps labels in a fixed order, with each token list paired to the label at the same position. Clean the archive by alphabetizing every document's tokens without mixing documents or removing repeated tokens.
Write a function that receives document labels and their token lists in matching order.
sort_document_tokens(…)A freight hub is preparing a special loading list. From the recorded weights of incoming shipments, it must keep the lightest k shipments and the heaviest k shipments. The list is organized by weight, duplicate weights remain separate, and a shipment position that belongs to both groups is included only once.
Given an integer array shipments and an integer k, return the shipment weights occupying the first k and last k positions after sorting shipments in nondecreasing order.
select_extreme_shipments(…)A warehouse dispatch team tracks shipments as two-number records: the first number is the scheduled delivery time, and the second identifies the shipment. They need a dispatch list containing at most a requested number of shipments, starting with the earliest deliveries.
Write a function that receives shipment records and a requested limit.
choose_earliest_shipments(…)A warehouse receives two shipment labels for parcels that may have been printed in different character orders. The labels are made only of lowercase letters. The dispatch team needs to know whether both labels contain exactly the same letters, including repeated letters, even if their order differs.
Write a function that checks whether two shipment labels contain the same multiset of lowercase letters.
labels_have_same_contents(…)A warehouse prints one lowercase label character for each shipment loaded onto a delivery route. The dispatcher expects the labels to alternate between two different characters, such as a-b-a-b-a. Determine whether the full label sequence follows this rule. An empty sequence and a one-character sequence are considered valid because they do not violate the pattern.
Write a function that checks whether a shipment-label string follows a repeating two-position pattern.
validate_delivery_labels(…)An ecommerce catalog stores product labels that may contain characters needing masking before display. Given a label, a set of characters to mask, and one substitute character, create the display-safe label while preserving all other text exactly, including spaces and repeated characters.
Write a function that transforms a product label one character at a time.
sanitize_product_label(…)A warehouse scanner records shipment labels in loading order. A label is symmetric when it reads identically from left to right and right to left. Find the position of the first symmetric label so the dock team can inspect it. If no label qualifies, return -1.
Write a function that examines shipment labels from the beginning of the list.
find_first_symmetric_label(…)In the game Starforge, the board records short event messages as players make moves. A bonus rule activates when one event contains two qualifying word tokens. The qualifying tokens must both start with the same badge prefix, and the first event in board order wins. Report the two tokens that activate the rule.
Implement a function that scans the event messages from left to right.
first_winning_token_pair(…)In a puzzle game, a level displays a binary code and has a target code. A move exchanges the symbols at any two positions in the displayed code. Help the game determine the fewest moves needed to reach the target code, or recognize that it cannot be reached.
Given the current binary code and the target binary code, determine the minimum number of moves required to transform the current code into the target.
minimum_code_swaps(…)In a puzzle game, a player has a current level code and a required level code. One move may exchange the symbols at any two positions in the current code. Determine the fewest moves needed to reach the required code, or report that it cannot be reached.
Write a function that compares the current level code with the required level code.
minimum_code_swaps(…)After a gaming session, a level log records lowercase words separated by spaces. Some words describe achievements, while others are too short to be useful. Build a helper for the score system that keeps every log word whose length reaches the chosen minimum, including repeated words and keeping their original order.
Given a log string and a minimum word length, return every complete word in the log whose length is at least the threshold.
qualifying_level_words(…)A warehouse prints handling labels for outgoing shipments. To make selected labels easier to inspect, the printer may change up to a given number of lowercase vowels into the marker letter x. Spaces and consonants must remain unchanged, and vowels are considered from left to right.
Given a shipment label and a replacement quota, process the label from left to right.
mark_shipment_label(…)A player enters a lowercase move string during a gaming challenge. The level's combo rule selects either even-positioned or odd-positioned moves, using zero-based positions. Build the move sequence that survives this rule so the score engine can evaluate that combo.
Write a function that receives a move string and a parity choice.
collect_parity_moves(…)In a collection of pure strings, a label is valid only if it follows one precise arrangement. The label has three ordered lowercase components, with one space between neighboring components. Each component has its own length interval, and no characters may appear before, after, or between the prescribed parts.
Write a function that decides whether label is valid.
is_valid_word_label(…)Two rival players have completed the same number of runs in a score-based game. Each player's scores are already sorted from lowest to highest. The arena wants one typical score for the combined results, using the median of all scores while avoiding unnecessary storage for a merged sequence.
Given two equally sized sorted score sequences, determine the median of all scores when the sequences are considered together as one multiset.
arena_score_median(…)A logistics company records integer adjustments for each dispatch group leaving its warehouses. A group’s total is the sum of all its adjustments. Some adjustments may be negative, such as delays or damage deductions, while others may be positive. The operations team wants to know the largest group total.
Write a function that examines every dispatch group and returns the greatest group total.
best_dispatch_group_total(…)A warehouse records the weights of packages loaded onto one delivery vehicle. The loading record is considered orderly if package weights never decrease from one package to the next, or if they never increase. Equal neighboring weights are allowed.
Write a function that decides whether the package-weight record is monotonic in at least one direction.
is_orderly_loading(…)A document indexer reads a list of lowercase tokens from the beginning of a note. The token "archive" marks the point where active content ends. Count the consecutive tokens before that marker so the indexer knows how much text remains active.
Implement a function that returns the number of consecutive tokens at the start of tokens that are not exactly "archive".
count_active_tokens(…)An ecommerce cart records its net line amounts in sequence. Positive values are product charges, while negative values may represent discounts or credits. A cart position is balanced when the total amount before it equals the total amount after it. Find the earliest such position for reviewing the cart layout.
Given an integer array of cart line amounts, return the zero-based index of the first position whose left-side sum equals its right-side sum.
first_balanced_cart_position(…)Two rival players earn score rewards from separate level runs. Each player's scores are already listed from smallest to largest. The game wants to identify the score occupying a chosen rank after treating both score lists as one ordered collection. Equal scores still occupy separate positions, so the result depends on counting every score.
Implement `find_level_rank`.
find_level_rank(…)A social app stores a user's group memberships in one integer badge. Each set binary position represents membership in a particular group. To refresh a badge, toggle the memberships at the lowest and highest occupied positions, leaving all positions between them unchanged.
Given a nonnegative integer representing one user's group-membership badge, toggle exactly two positions: the lowest set-bit position and the highest set-bit position.
refresh_group_badge(…)A document archive stores the tokens from each note in the order they were captured. For an index-building step, the archive needs those tokens arranged alphabetically. Repeated words must remain repeated because their counts are meaningful. Create the ordered token stream using a priority queue rather than assuming the captured order is useful.
Write a function that receives the token list from one document and returns a new list containing the same tokens in nondecreasing lexicographic order.
order_document_tokens(…)A reporting team analyzes a pool of ranked nominees and needs to summarize how many distinct panels of a chosen size could be formed. The report displays this count modulo a configured positive base so large values remain manageable. Given the pool size, panel size, and modulus, calculate the requested modular count.
For a pool of n nominees, a panel of r nominees can be formed in C(n, r) distinct ways.
panel_selection_residue(…)An analytics team reviews tags attached to a report in their recorded order. They need the first tag that appears for a second time, because that is the earliest duplicated label in the report. If every tag is unique, the report passes this check.
Given a non-empty list of lowercase report tags, scan the tags from left to right.
first_repeated_tag(…)A carrier records the sequence of shipment codes loaded onto a truck and the sequence of warehouse codes receiving those shipments. The actual names are not important; the repetition pattern is. Determine whether each distinct shipment code consistently corresponds to one distinct warehouse code throughout the two aligned records.
Given two equal-length arrays, shipment_codes and warehouse_codes, compare their positional patterns.
matches_assignment_pattern(…)A document archive stores each document as an ordered list of numeric token codes. The archive wants to compare two documents while ignoring codes that occur in only one document. Repeated codes remain repeated, and their original order must be preserved.
Given two ordered integer arrays, keep every occurrence whose value appears at least once in both arrays.
have_matching_shared_projection(…)In a gaming arena, a match records the score earned after each move. The referee needs to know whether every recorded score is different. Decide whether the score sequence contains no repeated value, including when the sequence is empty or has only one score.
Write a function that checks whether all scores in the supplied sequence are distinct.
has_unique_scores(…)A document-ingestion service stores a compact audit number for each batch. The number is always a perfect square: it records the total token count after pairing tokens into equal rows and columns. Recover the number of tokens along one side of that arrangement.
Implement a function that receives the audit number for a document batch.
decode_token_side(…)A warehouse assigns a seal value to a shipment batch. Starting with 1, the seal value is multiplied by every whole number from 1 through the batch size. The warehouse only records the final two decimal digits, so the full product is never needed.
Write a function that returns the final two decimal digits of the warehouse seal value for a batch containing shipment_count shipments.
warehouse_seal_suffix(…)In the arcade game Neon Rally, the scoreboard stores player scores in nondecreasing order. A repeated score can appear several times because players may tie. The board system needs the position of the last entry having a requested score so it can highlight the final matching record.
Write a function that searches a nondecreasing array of scoreboard scores for a target score.
find_last_score_index(…)A warehouse keeps shipment priority scores in nondecreasing order. When a new shipment arrives, determine where it should be inserted so that it comes after every shipment with a score no greater than its own target score. The existing score list must remain unchanged.
Given a nondecreasing array of shipment priority scores and a target score, return the first index whose score is greater than the target.
find_shipment_insertion_index(…)In a training challenge, each level of a combo grants a smaller bonus than the previous one. Level 0 is worth 1 point, level 1 is worth 1/2 point, level 2 is worth 1/4 point, and so on. The game wants the total bonus from level 0 through a supplied highest level.
Implement a function that returns the total combo bonus for every level from 0 through highest_level.
combo_level_score(…)A game stores score displays as text before showing them on a level board. Accept only nonnegative decimal score text: a nonempty run of digits, optionally followed by a decimal point and one or two digits. Reject signs, spaces, missing integer digits, missing fractional digits, extra separators, and excessive precision.
Write a function that decides whether score_text follows the game’s score-display format exactly.
is_valid_score_display(…)A warehouse prints shipment labels by repeating a short warehouse code. Given the complete label and a proposed code, decide whether the label contains one or more exact consecutive copies of that code. The check must compare characters literally, including spaces.
A shipment label is valid for a proposed warehouse code when the code is non-empty, the label contains at least one copy of it, and every character in the label matches the character at the same position within the repeating code.
is_repeating_shipment_label(…)A monitoring desk receives short alert messages from many text-based system logs. Each message has a numeric severity score supplied by the logging service. The desk wants to keep only the most severe alerts while processing the feed once, rather than fully sorting every message.
Implement a function that selects up to k alert messages with the greatest severity scores.
select_strongest_alerts(…)A document-monitoring service records each log token as an integer noise score. Analysts want the least noisy tokens for a compact report, but the archive can be large and the requested report may be small. Build a selector that keeps only the best candidates while reading the scores.
Write a function that selects the smallest k values from scores.
select_quietest_tokens(…)A log analyzer compares token severity scores from two ordered archive batches. Each possible pairing produces a combined score. Return the first requested number of combined scores, from smallest to largest, while treating repeated scores from different pairings as separate results.
Given two lists of token scores already arranged from smallest to largest and a requested limit, produce the smallest available pairwise sums.
smallest_combined_scores(…)A document indexer summarizes short words for a compact report. Given the tokens from one document and a requested count, identify the shortest token lengths. Repeated lengths must remain repeated because each token is a separate document item.
Write a function that receives a list of document tokens and a requested count.
smallest_token_lengths(…)In the arcade game Neon Dash, a combo meter has a target number of points to fill. Each legal move adds one of the permitted positive point amounts, and moves may be repeated. Determine the largest number of moves that fills the meter exactly. If no sequence reaches the target, report failure.
Write a function that finds the maximum number of moves whose point gains sum exactly to target_points.
max_combo_moves(…)A warehouse schedules shipments in a fixed dispatch order. Each shipment has a load rating, which may be positive, zero, or negative after adjustments. A valid dispatch plan selects shipments in order, with ratings strictly rising up to one peak and then strictly falling. Find the greatest possible total rating.
Given an integer array of shipment load ratings, choose a subsequence whose values strictly increase up to a peak and then strictly decrease after that peak.
maximum_peak_dispatch_sum(…)The monitoring team stores each event stream as one text line. A marker phrase identifies a notable incident only when its characters appear next to one another in the log. Create a checker that searches the full log for the marker without treating separated characters as a match.
Given a source log string and a marker string, determine whether the marker occurs as one contiguous segment of the log.
contains_log_marker(…)A game records a player's moves as one lowercase string. A rival wants to know where a particular combo first appears in that record. Return the requested combo together with its first start and exclusive end positions. If the combo never appears, report the combo with -1 for both positions.
Implement a function that searches the move-code string for the first literal occurrence of the requested combo.
find_first_combo(…)Consider two finite strings over lowercase letters and spaces. Treat every character exactly as written. Determine where the first copy of one string begins inside the other, using an interval whose right endpoint comes immediately after the matched characters.
Write a function that searches for pattern in source and returns the interval of its first contiguous occurrence.
find_first_literal_interval(…)In the game Neon Climb, completed score milestones are stored in increasing order. Milestone 0 is the first possible milestone, and later milestones normally increase one at a time. One milestone may be absent. Determine the smallest nonnegative milestone number that does not appear in the stored list.
Given the increasing list of completed score milestones, return the smallest nonnegative integer that is absent.
find_missing_milestone(…)An archive service assigns each report a deterministic integer ledger value. A report's value depends on two earlier report positions selected from the value of the immediately preceding report. Given one requested position, calculate its ledger value without repeatedly recalculating earlier positions.
Define a sequence L using one-based positions.
archive_ledger_value(…)New problems appear here only after they pass review and every expected output is re-derived by running verified code.