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.
- 0 problems
- 0 verified tests
- 0 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 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 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 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 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(…)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 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(…)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(…)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(…)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 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(…)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 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 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 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 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(…)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(…)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 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 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 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(…)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(…)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(…)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(…)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(…)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 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(…)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(…)New problems appear here only after they pass review and every expected output is re-derived by running verified code.