id
stringlengths
22
22
messages
listlengths
2
2
meta
dict
codedebug-train-000000
[ { "role": "user", "content": "Here is my solution. Something is wrong but I can't see it. Can you find the bug?\n\nTask: Implement `WordIndex()` with three methods: `insert(word)` adds a word (duplicates count again), `count(word)` returns how many times exactly `word` was inserted, and `starts_with(prefix)...
{ "kind": "code.debug.off_by_one.prefix_counter", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 11, "entry": "WordIndex", "checked_by": "buggy code fails on {\"init\": [], \"ops\": [[\"insert\", \"b\"], [\"starts_with\", \"b\"], ...; fix == verified r...
codedebug-train-000001
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `min_cost_path(3, [[0, 1, 1], [1, 2, 1], [0, 2, 5]], 0, 2, 0)` palauttaa `-5` eikä `2`. Etsi ja korjaa virhe.\n\nTehtävä: Kaupunkeja on `n` (`0..n-1`) ja yhdensuuntaisia lentoja `[u, v, price]` positiivisin hinnoin. Palauta halv...
{ "kind": "code.debug.arith_flip.cheapest_path", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 19, "entry": "min_cost_path", "checked_by": "buggy code fails on [3, [[0, 1, 1], [1, 2, 1], [0, 2, 5]], 0, 2, 0]...; fix == verified reference (oracle-checked...
codedebug-train-000002
[ { "role": "user", "content": "Please review this solution: there is a bug somewhere. Find it, show an input that fails, and fix it.\n\nTask: A directed graph has `n` nodes (0..n-1) and edges `[u, v, w]` from `u` to `v` with weight `w >= 1`. Return a list with the length of the shortest path from `src` to ev...
{ "kind": "code.debug.cmp_flip.dijkstra", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 12, "entry": "shortest_distances", "checked_by": "buggy code fails on [4, [], 2]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "22d...
codedebug-train-000003
[ { "role": "user", "content": "Please review this solution: there is a bug somewhere. Find it, show an input that fails, and fix it.\n\nTask: Return how many non-empty contiguous subarrays of `nums` there are whose sum is divisible by `k` (`k >= 1`). Values can be negative and the list can have hundreds of t...
{ "kind": "code.debug.init_change.subarray_count", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 3, "entry": "count_divisible", "checked_by": "buggy code fails on [[3], 3]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "...
codedebug-train-000004
[ { "role": "user", "content": "Please review this solution: there is a bug somewhere. Find it, show an input that fails, and fix it.\n\nTask: The grid is a list of equal-length strings of '1' (land) and '0' (water). Two land cells belong to the same island when they are next to each other horizontally or ver...
{ "kind": "code.debug.init_change.count_islands", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 7, "entry": "islands", "checked_by": "buggy code fails on [[\"0\"]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "cdd40a2a...
codedebug-train-000005
[ { "role": "user", "content": "Please review this solution: there is a bug somewhere. Find it, show an input that fails, and fix it.\n\nTask: Return the length of the longest substring of `s` that reads the same backwards. `s` can be several thousand characters long, so checking every substring separately is...
{ "kind": "code.debug.cmp_flip.palindromes", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 5, "entry": "longest_palindrome_len", "checked_by": "buggy code fails on [\"a\"]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_id": "...
codedebug-train-000006
[ { "role": "user", "content": "Here is my solution. Something is wrong but I can't see it. Can you find the bug?\n\nTask: Implement `LRUCache(capacity)` with `get(key)` (the value, or -1 if absent) and `put(key, value)`. Both count as a use of the key. When a put would exceed the capacity, evict the least re...
{ "kind": "code.debug.cmp_flip.lru_cache", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 43, "entry": "LRUCache", "checked_by": "buggy code fails on {\"init\": [1], \"ops\": [[\"put\", 1, 1], [\"put\", 2, 2], [\"get\", ...; fix == verified reference (...
codedebug-train-000007
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `count_big_inversions([4, 6, 0])` palauttaa `0` eikä `2`. Etsi ja korjaa virhe.\n\nTehtävä: Palauta niiden indeksiparien `i < j` määrä, joille `a[i] > 2 * a[j]`. Arvot voivat olla negatiivisia, ja listassa voi olla 150 000 alkio...
{ "kind": "code.debug.drop_stmt.inversions", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 13, "entry": "count_big_inversions", "checked_by": "buggy code fails on [[4, 6, 0]]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id": ...
codedebug-train-000008
[ { "role": "user", "content": "This is supposed to solve the task below, but running `obj = TimeMap(); obj.set('a', 'x', 10); obj.get('a', 9); obj.get('a', 10); obj.get('a', 11)` raises `IndexError: list index out of range`. Find and fix the bug.\n\nTask: Implement `TimeMap()` with `set(key, value, timestamp...
{ "kind": "code.debug.arith_flip.time_map", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 16, "entry": "TimeMap", "checked_by": "buggy code fails on {\"init\": [], \"ops\": [[\"set\", \"a\", \"x\", 10], [\"get\", \"a\", 9],...; fix == verified reference...
codedebug-train-000009
[ { "role": "user", "content": "This is supposed to solve the task below, but `best_path([[-1, -2], [-3, -4]])` returns `-8` instead of `-7`. Find and fix the bug.\n\nTask: The grid holds integers (possibly negative). Starting at the top-left cell and moving only right or down to the bottom-right cell, return...
{ "kind": "code.debug.minmax_swap.grid_paths", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 13, "entry": "best_path", "checked_by": "buggy code fails on [[[-1, -2], [-3, -4]]]...; fix == verified reference (oracle-checked on 17 inputs)", "problem_id"...
codedebug-train-000010
[ { "role": "user", "content": "My solution gives the wrong answer: `fewest_stabs([[1, 2], [2, 3]])` should be `1`, I get `2`. What's wrong?\n\nTask: You are given intervals `[start, end]` with `start < end`. Return the smallest number of points such that every interval contains at least one of them (endpoint...
{ "kind": "code.debug.cmp_flip.interval_greedy", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 4, "entry": "fewest_stabs", "checked_by": "buggy code fails on [[[1, 2], [2, 3]]]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_id"...
codedebug-train-000011
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `trade_with_fee([4, 8], 1)` palauttaa `5` eikä `3`. Etsi ja korjaa virhe.\n\nTehtävä: `prices[i]` on osakkeen hinta päivänä `i`. Saat tehdä kauppoja niin monta kuin haluat, mutta voit omistaa enintään yhden osakkeen kerrallaan, ...
{ "kind": "code.debug.arith_flip.stock_profit", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 4, "entry": "trade_with_fee", "checked_by": "buggy code fails on [[4, 8], 1]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "7c2...
codedebug-train-000012
[ { "role": "user", "content": "Tässä ratkaisuni. Jokin on vialla, mutta en näe mikä. Löydätkö virheen?\n\nTehtävä: Toteuta `RangeSum(nums)`, jossa `update(index, value)` asettaa `nums[index] = value` ja `query(left, right)` palauttaa summan `nums[left..right]` (molemmat päät mukaan lukien, `left <= right`). ...
{ "kind": "code.debug.arith_flip.range_sum", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 26, "entry": "RangeSum", "checked_by": "buggy code fails on {\"init\": [[1, 2, 3]], \"ops\": [[\"update\", 1, 2], [\"query\", 0,...; fix == verified reference (...
codedebug-train-000013
[ { "role": "user", "content": "This is supposed to solve the task below, but `evaluate('0 + 17')` returns `-17` instead of `17`. Find and fix the bug.\n\nTask: The string contains non-negative integers, `+`, `-`, `*`, `/`, parentheses, spaces, and unary minus (as in `-3` or `-(2 + 1)`). Evaluate it with the ...
{ "kind": "code.debug.arith_flip.expr_eval", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 15, "entry": "evaluate", "checked_by": "buggy code fails on [\"0 + 17\"]...; fix == verified reference (oracle-checked on 22 inputs)", "problem_id": "ba1b3f285f...
codedebug-train-000014
[ { "role": "user", "content": "Please review this solution: there is a bug somewhere. Find it, show an input that fails, and fix it.\n\nTask: Given a list `nums` and a window size `k` (1 <= k <= len(nums)), return the smallest value in every window of `k` consecutive elements, from left to right. The list ca...
{ "kind": "code.debug.index_swap.window_extreme", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 11, "entry": "sliding_min", "checked_by": "buggy code fails on [[-6, 2, 9], 2]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id"...
codedebug-train-000015
[ { "role": "user", "content": "Please review this solution: there is a bug somewhere. Find it, show an input that fails, and fix it.\n\nTask: A directed graph has `n` nodes (0..n-1) and edges `[u, v, w]` from `u` to `v` with weight `w >= 1`. Return a list with the length of the shortest path from `src` to ev...
{ "kind": "code.debug.cmp_flip.dijkstra", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 16, "entry": "all_distances", "checked_by": "buggy code fails on [5, [[0, 0, 2], [2, 1, 9]], 2]...; fix == verified reference (oracle-checked on 19 inputs)", "pr...
codedebug-train-000016
[ { "role": "user", "content": "This is supposed to solve the task below, but `evaluate('14 - 13')` returns `27` instead of `1`. Find and fix the bug.\n\nTask: The string contains non-negative integers, `+`, `-`, `*`, `/`, parentheses, spaces, and unary minus (as in `-3` or `-(2 + 1)`). Evaluate it with the u...
{ "kind": "code.debug.arith_flip.expr_eval", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 50, "entry": "evaluate", "checked_by": "buggy code fails on [\"14 - 13\"]...; fix == verified reference (oracle-checked on 22 inputs)", "problem_id": "2918dd17e...
codedebug-train-000017
[ { "role": "user", "content": "This is supposed to solve the task below, but `best_path([[4], [9], [0]])` returns `0` instead of `13`. Find and fix the bug.\n\nTask: The grid holds integers (possibly negative). Starting at the top-left cell and moving only right or down to the bottom-right cell, return the l...
{ "kind": "code.debug.cmp_flip.grid_paths", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 8, "entry": "best_path", "checked_by": "buggy code fails on [[[4], [9], [0]]]...; fix == verified reference (oracle-checked on 17 inputs)", "problem_id": "88866d...
codedebug-train-000018
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `shortest_path_cost(3, [[0, 1, 5], [1, 2, 5], [0, 2, 20]], 0, 2)` palauttaa `20` eikä `10`. Etsi ja korjaa virhe.\n\nTehtävä: Suunnatussa verkossa on `n` solmua (0..n-1) ja kaaret `[u, v, w]` solmusta `u` solmuun `v` painolla `w...
{ "kind": "code.debug.arith_flip.dijkstra", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 19, "entry": "shortest_path_cost", "checked_by": "buggy code fails on [3, [[0, 1, 5], [1, 2, 5], [0, 2, 20]], 0, 2]...; fix == verified reference (oracle-checked o...
codedebug-train-000019
[ { "role": "user", "content": "My solution gives the wrong answer: `min_ship_capacity([7, 3, 3, 1, 2], 4)` should be `7`, I get `6`. What's wrong?\n\nTask: Packages with weights `weights` must be shipped in the given order within `days` days (1 <= days <= len(weights)). Each day the ship takes a run of conse...
{ "kind": "code.debug.minmax_swap.search_answer", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 10, "entry": "min_ship_capacity", "checked_by": "buggy code fails on [[7, 3, 3, 1, 2], 4]...; fix == verified reference (oracle-checked on 19 inputs)", "pr...
codedebug-train-000020
[ { "role": "user", "content": "This is supposed to solve the task below, but `busiest_moment([[0, 1]])` returns `None` instead of `0`. Find and fix the bug.\n\nTask: Each meeting is `[start, end)` (it is running at time t when start <= t < end). Return the earliest integer time at which the number of running...
{ "kind": "code.debug.cmp_flip.meeting_rooms", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 7, "entry": "busiest_moment", "checked_by": "buggy code fails on [[[0, 1]]]...; fix == verified reference (oracle-checked on 17 inputs)", "problem_id": "4e140...
codedebug-train-000021
[ { "role": "user", "content": "My solution gives the wrong answer: `largest_group(5, [[0, 2]])` should be `2`, I get `1`. What's wrong?\n\nTask: There are `n` nodes numbered 0..n-1 and a list of undirected edges `[u, v]`. Return the number of nodes in the largest connected group (0 if `n == 0`). `n` and the ...
{ "kind": "code.debug.minmax_swap.union_find", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 18, "entry": "largest_group", "checked_by": "buggy code fails on [5, [[0, 2]]]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_id": "2b...
codedebug-train-000022
[ { "role": "user", "content": "Please review this solution: there is a bug somewhere. Find it, show an input that fails, and fix it.\n\nTask: A robot starts at (0, 0) facing north. Commands: `-2` turns left 90°, `-1` turns right 90°, and `k` (1-9) moves forward k unit steps. If the next square is an obstacle...
{ "kind": "code.debug.init_change.robot_walk", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 4, "entry": "robot_max_distance", "checked_by": "buggy code fails on [[4], [[0, 2]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_...
codedebug-train-000023
[ { "role": "user", "content": "Here is my solution. Something is wrong but I can't see it. Can you find the bug?\n\nTask: Given a list `nums` and a window size `k` (1 <= k <= len(nums)), return the largest value in every window of `k` consecutive elements, from left to right. The list can have hundreds of th...
{ "kind": "code.debug.index_swap.window_extreme", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 12, "entry": "window_maxima", "checked_by": "buggy code fails on [[5], 1]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "c2...
codedebug-train-000024
[ { "role": "user", "content": "My solution gives the wrong answer: `rle_encode('aa')` should be `'a2'`, I get `'a1a1'`. What's wrong?\n\nTask: `s` contains only lowercase letters. Replace each run of equal letters with the letter and the run length (every run is written as the letter followed by its length, ...
{ "kind": "code.debug.cmp_flip.rle", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 6, "entry": "rle_encode", "checked_by": "buggy code fails on [\"aa\"]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "082a4c4820df", "pro...
codedebug-train-000025
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `obj = PrefixCounter(); obj.starts_with(''); obj.count(''); obj.insert(''); obj.count(''); obj.starts_with('')` palauttaa `-1` eikä `1`. Etsi ja korjaa virhe.\n\nTehtävä: Toteuta `PrefixCounter()`, jossa on kolme metodia: `inser...
{ "kind": "code.debug.arith_flip.prefix_counter", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 7, "entry": "PrefixCounter", "checked_by": "buggy code fails on {\"init\": [], \"ops\": [[\"starts_with\", \"\"], [\"count\", \"\"], [\"i...; fix == verified...
codedebug-train-000026
[ { "role": "user", "content": "Ratkaisuni antaa väärän vastauksen: `largest_group(3, [[1, 1]])` pitäisi olla `1`, saan `2`. Mikä on vialla?\n\nTehtävä: Solmuja on `n`, numeroitu 0..n-1, ja suuntaamattomat kaaret annetaan listana `[u, v]`. Palauta suurimman yhtenäisen ryhmän solmujen määrä (0, jos `n == 0`). ...
{ "kind": "code.debug.cmp_flip.union_find", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 13, "entry": "largest_group", "checked_by": "buggy code fails on [3, [[1, 1]]]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_id": "2b655...
codedebug-train-000027
[ { "role": "user", "content": "My solution gives the wrong answer: `evaluate('7 / -2')` should be `-3`, I get `3`. What's wrong?\n\nTask: The string contains non-negative integers, `+`, `-`, `*`, `/`, parentheses, spaces, and unary minus (as in `-3` or `-(2 + 1)`). Evaluate it with the usual precedence (`*` ...
{ "kind": "code.debug.neg_drop.expr_eval", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 28, "entry": "evaluate", "checked_by": "buggy code fails on [\"7 / -2\"]...; fix == verified reference (oracle-checked on 22 inputs)", "problem_id": "2918dd17ef27...
codedebug-train-000028
[ { "role": "user", "content": "My solution gives the wrong answer: `longest_distinct_substring('a')` should be `1`, I get `0`. What's wrong?\n\nTask: Return the length of the longest substring of `s` in which no character appears twice. `s` can be hundreds of thousands of characters long.\n\n```python\ndef l...
{ "kind": "code.debug.drop_stmt.longest_window", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 8, "entry": "longest_distinct_substring", "checked_by": "buggy code fails on [\"a\"]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_...
codedebug-train-000029
[ { "role": "user", "content": "My solution gives the wrong answer: `obj = PrefixCounter(); obj.starts_with(''); obj.count(''); obj.insert(''); obj.count('')` should be `1`, I get `-1`. What's wrong?\n\nTask: Implement `PrefixCounter()` with three methods: `insert(word)` adds a word (duplicates count again), ...
{ "kind": "code.debug.arith_flip.prefix_counter", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 11, "entry": "PrefixCounter", "checked_by": "buggy code fails on {\"init\": [], \"ops\": [[\"starts_with\", \"\"], [\"count\", \"\"], [\"i...; fix == verifie...
codedebug-train-000030
[ { "role": "user", "content": "I get an exception for `smallest_capacity([6, 7], 1)`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 19, in <module>\n smallest_capacity([6, 7], 1)\n ~~~~~~~~~~~~~~~~~^^^^^^^^^^^\n File \"solution.py\", line 12, in smallest_capacity\n if fit...
{ "kind": "code.debug.drop_stmt.search_answer", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 12, "entry": "smallest_capacity", "checked_by": "buggy code fails on [[6, 7], 1]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_...
codedebug-train-000031
[ { "role": "user", "content": "Tässä ratkaisuni. Jokin on vialla, mutta en näe mikä. Löydätkö virheen?\n\nTehtävä: `prices[i]` on osakkeen hinta päivänä `i`. Saat tehdä kauppoja niin monta kuin haluat, omistaen enintään yhden osakkeen kerrallaan, mutta myynnin jälkeen et voi ostaa seuraavana päivänä (yhden p...
{ "kind": "code.debug.minmax_swap.stock_profit", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 4, "entry": "trade_with_cooldown", "checked_by": "buggy code fails on [[1, 2, 4]]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_i...
codedebug-train-000032
[ { "role": "user", "content": "Please review this solution: there is a bug somewhere. Find it, show an input that fails, and fix it.\n\nTask: Each meeting is `[start, end)`: it occupies a room from `start` up to, but not including, `end`. Return the minimum number of rooms needed so that no two meetings shar...
{ "kind": "code.debug.drop_stmt.meeting_rooms", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 10, "entry": "rooms_needed", "checked_by": "buggy code fails on [[[0, 5]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "11d...
codedebug-train-000033
[ { "role": "user", "content": "My solution gives the wrong answer: `count_primes(-10, 10)` should be `4`, I get `6`. What's wrong?\n\nTask: Return how many prime numbers `p` satisfy `lo <= p <= hi`. `lo` can be negative and `lo > hi` means an empty range. `hi` can be up to 8,000,000.\n\n```python\ndef count_...
{ "kind": "code.debug.init_change.primes_range", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 5, "entry": "count_primes", "checked_by": "buggy code fails on [-10, 10]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "fcfb2e...
codedebug-train-000034
[ { "role": "user", "content": "This is supposed to solve the task below, but `coin_combinations([2], 3)` raises `TypeError: unsupported operand type(s) for -: 'list' and 'list'` instead of returning `0`. Find and fix the bug.\n\nTask: Given distinct positive coin values (unlimited supply of each) and an amou...
{ "kind": "code.debug.arith_flip.coin_change", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 3, "entry": "coin_combinations", "checked_by": "buggy code fails on [[2], 3]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "c64d...
codedebug-train-000035
[ { "role": "user", "content": "Tässä ratkaisuni. Jokin on vialla, mutta en näe mikä. Löydätkö virheen?\n\nTehtävä: Tehtäviä on `n` (`0..n-1`) ja pareja `[a, b]`, jotka tarkoittavat, että tehtävä `a` on tehtävä ennen tehtävää `b`. Palauta leksikografisesti pienin järjestys, jossa jokainen tehtävä tehdään kerr...
{ "kind": "code.debug.drop_stmt.topo_order", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 8, "entry": "task_order", "checked_by": "buggy code fails on [3, [[2, 0]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "723aad...
codedebug-train-000036
[ { "role": "user", "content": "Tarkista tämä ratkaisu: siinä on virhe jossain. Etsi se, näytä syöte, joka epäonnistuu, ja korjaa se.\n\nTehtävä: Palauta, montako sellaista listan `nums` epätyhjää yhtenäistä osataulukkoa on, joiden summa on jaollinen luvulla `k` (`k >= 1`). Arvot voivat olla negatiivisia, ja ...
{ "kind": "code.debug.index_swap.subarray_count", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 3, "entry": "count_divisible", "checked_by": "buggy code fails on [[3], 3]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "d...
codedebug-train-000037
[ { "role": "user", "content": "Ratkaisuni kaatuu: `knapsack([5], [10], 5)` pitäisi palauttaa `10`, mutta se nostaa poikkeuksen `IndexError: list index out of range`. Mikä on vialla?\n\nTehtävä: Esine i painaa `weights[i]` ja on arvoltaan `values[i]` (kaikki positiivisia kokonaislukuja). Palauta suurin kokona...
{ "kind": "code.debug.arith_flip.knapsack", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 6, "entry": "knapsack", "checked_by": "buggy code fails on [[5], [10], 5]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "ad345a84d1...
codedebug-train-000038
[ { "role": "user", "content": "Tarkista tämä ratkaisu: siinä on virhe jossain. Etsi se, näytä syöte, joka epäonnistuu, ja korjaa se.\n\nTehtävä: Tehtäviä on `n` (`0..n-1`) ja pareja `[a, b]`, jotka tarkoittavat, että tehtävä `a` on tehtävä ennen tehtävää `b`. Palauta leksikografisesti pienin järjestys, jossa...
{ "kind": "code.debug.cmp_flip.topo_order", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 18, "entry": "schedule", "checked_by": "buggy code fails on [5, [[1, 3]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "723aad79...
codedebug-train-000039
[ { "role": "user", "content": "Here is my solution. Something is wrong but I can't see it. Can you find the bug?\n\nTask: A robot starts at (0, 0) facing north. Commands: `-2` turns left 90°, `-1` turns right 90°, and `k` (1-9) moves forward k unit steps. If the next square is an obstacle, the robot stays wh...
{ "kind": "code.debug.init_change.robot_walk", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 5, "entry": "robot_max_distance", "checked_by": "buggy code fails on [[], []]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "e...
codedebug-train-000040
[ { "role": "user", "content": "Ratkaisuni antaa väärän vastauksen: `obj = RateLimiter(2, 1); obj.allow(5); obj.allow(5); obj.allow(5)` pitäisi olla `False`, saan `True`. Mikä on vialla?\n\nTehtävä: Toteuta `RateLimiter(limit, window)`, jossa on `allow(t)`. Kutsu hetkellä `t` sallitaan, jos ikkunassa `(t - wi...
{ "kind": "code.debug.arith_flip.rate_limiter", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 10, "entry": "RateLimiter", "checked_by": "buggy code fails on {\"init\": [2, 1], \"ops\": [[\"allow\", 5], [\"allow\", 5], [\"allow...; fix == verified refere...
codedebug-train-000041
[ { "role": "user", "content": "Tarkista tämä ratkaisu: siinä on virhe jossain. Etsi se, näytä syöte, joka epäonnistuu, ja korjaa se.\n\nTehtävä: Saat välit `[start, end]`, joissa `start < end`. Palauta pienin määrä välejä, jotka on poistettava, jotta loput eivät mene päällekkäin. Välit, jotka vain koskettava...
{ "kind": "code.debug.arith_flip.interval_greedy", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 7, "entry": "min_removals", "checked_by": "buggy code fails on [[[3, 9]]]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_id": "8...
codedebug-train-000042
[ { "role": "user", "content": "Tässä ratkaisuni. Jokin on vialla, mutta en näe mikä. Löydätkö virheen?\n\nTehtävä: Merkkijonossa on ei-negatiivisia kokonaislukuja, `+`, `-`, `*`, `/`, sulkeita, välilyöntejä ja unaarinen miinus (kuten `-3` tai `-(2 + 1)`). Laske se tavallisella laskujärjestyksellä (`*` ja `/`...
{ "kind": "code.debug.cmp_flip.expr_eval", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 50, "entry": "evaluate", "checked_by": "buggy code fails on [\"(3 - 16)\"]...; fix == verified reference (oracle-checked on 22 inputs)", "problem_id": "2918dd17...
codedebug-train-000043
[ { "role": "user", "content": "Running `calc('7')` crashes with this traceback. What's going on and how do I fix it?\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 53, in <module>\n calc('7')\n ~~~~^^^^^\n File \"solution.py\", line 25, in calc\n while j < len(expr) or exp...
{ "kind": "code.debug.bool_flip.expr_eval", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 25, "entry": "calc", "checked_by": "buggy code fails on [\"7\"]...; fix == verified reference (oracle-checked on 22 inputs)", "problem_id": "ba1b3f285f18", ...
codedebug-train-000044
[ { "role": "user", "content": "Running `count_paths(['##.#.'])` crashes with this traceback. What's going on and how do I fix it?\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 15, in <module>\n count_paths(['##.#.'])\n ~~~~~~~~~~~^^^^^^^^^^^\n File \"solution.py\", line 11, ...
{ "kind": "code.debug.arith_flip.grid_paths", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 11, "entry": "count_paths", "checked_by": "buggy code fails on [[\"##.#.\"]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "...
codedebug-train-000045
[ { "role": "user", "content": "I get an exception for `lis_length([9])`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 15, in <module>\n lis_length([9])\n ~~~~~~~~~~^^^^^\n File \"solution.py\", line 11, in lis_length\n tails[i] = x\n ~~~~~^^^\nIndexError: list assignm...
{ "kind": "code.debug.cmp_flip.lis", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 8, "entry": "lis_length", "checked_by": "buggy code fails on [[9]]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "a9b07ae35241", "p...
codedebug-train-000046
[ { "role": "user", "content": "My solution gives the wrong answer: `longest_palindromic_substring('b')` should be `1`, I get `0`. What's wrong?\n\nTask: Return the length of the longest substring of `s` that reads the same backwards. `s` can be several thousand characters long, so checking every substring se...
{ "kind": "code.debug.cmp_flip.palindromes", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 5, "entry": "longest_palindromic_substring", "checked_by": "buggy code fails on [\"b\"]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_i...
codedebug-train-000047
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `knapsack([2], [25], 5)` nostaa poikkeuksen `IndexError: list index out of range` eikä palauta `25`. Etsi ja korjaa virhe.\n\nTehtävä: Esine i painaa `weights[i]` ja on arvoltaan `values[i]` (kaikki positiivisia kokonaislukuja)....
{ "kind": "code.debug.arith_flip.knapsack", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 6, "entry": "knapsack", "checked_by": "buggy code fails on [[2], [25], 5]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "ad345a84d1...
codedebug-train-000048
[ { "role": "user", "content": "Tarkista tämä ratkaisu: siinä on virhe jossain. Etsi se, näytä syöte, joka epäonnistuu, ja korjaa se.\n\nTehtävä: Palauta, montako sellaista listan `nums` epätyhjää yhtenäistä osataulukkoa on, joiden summa on tasan `k`. Arvot voivat olla negatiivisia, ja listassa voi olla satoj...
{ "kind": "code.debug.drop_stmt.subarray_count", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 11, "entry": "subarrays_with_sum", "checked_by": "buggy code fails on [[5, -1], -1]...; fix == verified reference (oracle-checked on 21 inputs)", "problem...
codedebug-train-000049
[ { "role": "user", "content": "Running `primes_between(2, 2)` crashes with this traceback. What's going on and how do I fix it?\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 14, in <module>\n primes_between(2, 2)\n ~~~~~~~~~~~~~~^^^^^^\n File \"solution.py\", line 5, in prim...
{ "kind": "code.debug.arith_flip.primes_range", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 4, "entry": "primes_between", "checked_by": "buggy code fails on [2, 2]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "fcf...
codedebug-train-000050
[ { "role": "user", "content": "This is supposed to solve the task below, but `obj = WordIndex(); obj.insert('abc'); obj.starts_with('abcd'); obj.count('abcd'); obj.starts_with('abc')` returns `0` instead of `1`. Find and fix the bug.\n\nTask: Implement `WordIndex()` with three methods: `insert(word)` adds a ...
{ "kind": "code.debug.off_by_one.prefix_counter", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 11, "entry": "WordIndex", "checked_by": "buggy code fails on {\"init\": [], \"ops\": [[\"insert\", \"abc\"], [\"starts_with\", \"abc...; fix == verified refe...
codedebug-train-000051
[ { "role": "user", "content": "This is supposed to solve the task below, but `slowest_speed([9], 5)` returns `3` instead of `2`. Find and fix the bug.\n\nTask: There are piles of items `piles`. At speed `k` you take up to `k` items from one pile per hour (a pile with fewer items still takes the whole hour). ...
{ "kind": "code.debug.arith_flip.search_answer", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 3, "entry": "slowest_speed", "checked_by": "buggy code fails on [[9], 5]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "aa30e8...
codedebug-train-000052
[ { "role": "user", "content": "This is supposed to solve the task below, but `max_non_overlapping([[1, 2], [2, 3]])` returns `1` instead of `2`. Find and fix the bug.\n\nTask: You are given intervals `[start, end]` with `start < end`. Return the largest number of intervals you can keep so that no two of them...
{ "kind": "code.debug.cmp_flip.interval_greedy", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 4, "entry": "max_non_overlapping", "checked_by": "buggy code fails on [[[1, 2], [2, 3]]]...; fix == verified reference (oracle-checked on 20 inputs)", "prob...
codedebug-train-000053
[ { "role": "user", "content": "Here is my solution. Something is wrong but I can't see it. Can you find the bug?\n\nTask: There are `n` tasks `0..n-1` and pairs `[a, b]` meaning task `a` must be done before task `b`. Return the lexicographically smallest order that does every task once and respects all pairs...
{ "kind": "code.debug.drop_stmt.topo_order", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 9, "entry": "schedule", "checked_by": "buggy code fails on [6, [[5, 2]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "723aad79...
codedebug-train-000054
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `obj = VersionedStore(); obj.get('k0', 3); obj.set('k2', 'v91', 4); obj.get('k2', 6)` nostaa poikkeuksen `IndexError: list index out of range`. Etsi ja korjaa virhe.\n\nTehtävä: Toteuta `VersionedStore()`, jossa on `set(key, val...
{ "kind": "code.debug.arith_flip.time_map", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 16, "entry": "VersionedStore", "checked_by": "buggy code fails on {\"init\": [], \"ops\": [[\"get\", \"k0\", 3], [\"set\", \"k2\", \"v91\", ...; fix == verified re...
codedebug-train-000055
[ { "role": "user", "content": "This is supposed to solve the task below, but `min_ship_capacity([3, 9, 2, 8], 4)` returns `3` instead of `9`. Find and fix the bug.\n\nTask: Packages with weights `weights` must be shipped in the given order within `days` days (1 <= days <= len(weights)). Each day the ship tak...
{ "kind": "code.debug.minmax_swap.search_answer", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 10, "entry": "min_ship_capacity", "checked_by": "buggy code fails on [[3, 9, 2, 8], 4]...; fix == verified reference (oracle-checked on 19 inputs)", "probl...
codedebug-train-000056
[ { "role": "user", "content": "My solution gives the wrong answer: `longest_with_k_kinds('abc', 0)` should be `0`, I get `3`. What's wrong?\n\nTask: Return the length of the longest substring of `s` that contains at most `k` distinct characters (`k >= 0`). `s` can be hundreds of thousands of characters long....
{ "kind": "code.debug.drop_stmt.longest_window", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 8, "entry": "longest_with_k_kinds", "checked_by": "buggy code fails on [\"abc\", 0]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_i...
codedebug-train-000057
[ { "role": "user", "content": "My solution gives the wrong answer: `obj = RangeSum([7, -8, -5, 2]); obj.query(0, 1)` should be `-1`, I get `15`. What's wrong?\n\nTask: Implement `RangeSum(nums)` with `update(index, value)`, which sets `nums[index] = value`, and `query(left, right)`, which returns the sum of ...
{ "kind": "code.debug.arith_flip.range_sum", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 10, "entry": "RangeSum", "checked_by": "buggy code fails on {\"init\": [[7, -8, -5, 2]], \"ops\": [[\"query\", 0, 1], [\"update...; fix == verified reference (ora...
codedebug-train-000058
[ { "role": "user", "content": "This is supposed to solve the task below, but `transform_cost('abc', 'abab')` returns `3` instead of `4`. Find and fix the bug.\n\nTask: Turn string `a` into string `b`. Inserting a character costs 3, deleting one costs 1, and replacing one character with a different one costs ...
{ "kind": "code.debug.cmp_flip.edit_distance", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 7, "entry": "transform_cost", "checked_by": "buggy code fails on [\"abc\", \"abab\"]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id...
codedebug-train-000059
[ { "role": "user", "content": "I get an exception for `common_substring_len('cb', 'c')`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 14, in <module>\n common_substring_len('cb', 'c')\n ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^\n File \"solution.py\", line 7, in common_substring_len\...
{ "kind": "code.debug.drop_stmt.common_sequence", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 5, "entry": "common_substring_len", "checked_by": "buggy code fails on [\"cb\", \"c\"]...; fix == verified reference (oracle-checked on 20 inputs)", "...
codedebug-train-000060
[ { "role": "user", "content": "Please review this solution: there is a bug somewhere. Find it, show an input that fails, and fix it.\n\nTask: The grid is a list of equal-length strings of '1' (land) and '0' (water). Two land cells belong to the same island when they are next to each other horizontally or ver...
{ "kind": "code.debug.bool_flip.count_islands", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 10, "entry": "islands", "checked_by": "buggy code fails on [[\"000\"]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "cdd40a2...
codedebug-train-000061
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `longest_palindrome_len('b')` palauttaa `3` eikä `1`. Etsi ja korjaa virhe.\n\nTehtävä: Palauta merkkijonon `s` pisimmän sellaisen osajonon pituus, joka on sama takaperin luettuna. `s` voi olla tuhansia merkkejä pitkä, joten jok...
{ "kind": "code.debug.arith_flip.palindromes", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 8, "entry": "longest_palindrome_len", "checked_by": "buggy code fails on [\"b\"]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_id": "...
codedebug-train-000062
[ { "role": "user", "content": "This is supposed to solve the task below, but `min_points_to_cover([[1, 2], [2, 3]])` returns `2` instead of `1`. Find and fix the bug.\n\nTask: You are given intervals `[start, end]` with `start < end`. Return the smallest number of points such that every interval contains at ...
{ "kind": "code.debug.cmp_flip.interval_greedy", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 4, "entry": "min_points_to_cover", "checked_by": "buggy code fails on [[[1, 2], [2, 3]]]...; fix == verified reference (oracle-checked on 20 inputs)", "prob...
codedebug-train-000063
[ { "role": "user", "content": "I get an exception for `cheapest_price(5, [[3, 0, 7]], 4, 2, 0)`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 13, in <module>\n cheapest_price(5, [[3, 0, 7]], 4, 2, 0)\n ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"solution.py\", line 7, ...
{ "kind": "code.debug.drop_stmt.cheapest_path", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 6, "entry": "cheapest_price", "checked_by": "buggy code fails on [5, [[3, 0, 7]], 4, 2, 0]...; fix == verified reference (oracle-checked on 19 inputs)", ...
codedebug-train-000064
[ { "role": "user", "content": "My solution gives the wrong answer: `max_profit_with_fee([5, 1, 2], 1)` should be `0`, I get `2`. What's wrong?\n\nTask: `prices[i]` is the price of a share on day `i`. You may complete as many trades as you like, but you can hold at most one share at a time and every sale cost...
{ "kind": "code.debug.arith_flip.stock_profit", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 4, "entry": "max_profit_with_fee", "checked_by": "buggy code fails on [[5, 1, 2], 1]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_i...
codedebug-train-000065
[ { "role": "user", "content": "My solution gives the wrong answer: `min_meeting_rooms([[7, 19], [18, 20], [9, 10]])` should be `2`, I get `3`. What's wrong?\n\nTask: Each meeting is `[start, end)`: it occupies a room from `start` up to, but not including, `end`. Return the minimum number of rooms needed so t...
{ "kind": "code.debug.index_swap.meeting_rooms", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 7, "entry": "min_meeting_rooms", "checked_by": "buggy code fails on [[[7, 19], [18, 20], [9, 10]]]...; fix == verified reference (oracle-checked on 18 inputs)...
codedebug-train-000066
[ { "role": "user", "content": "My solution gives the wrong answer: `shortest_distances(2, [[0, 1, 3]], 0)` should be `[0, 3]`, I get `[0, -3]`. What's wrong?\n\nTask: A directed graph has `n` nodes (0..n-1) and edges `[u, v, w]` from `u` to `v` with weight `w >= 1`. Return a list with the length of the short...
{ "kind": "code.debug.arith_flip.dijkstra", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 17, "entry": "shortest_distances", "checked_by": "buggy code fails on [2, [[0, 1, 3]], 0]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_...
codedebug-train-000067
[ { "role": "user", "content": "My solution gives the wrong answer: `schedule(2, [[1, 0]])` should be `[1, 0]`, I get `[0, 1]`. What's wrong?\n\nTask: There are `n` tasks `0..n-1` and pairs `[a, b]` meaning task `a` must be done before task `b`. Return the lexicographically smallest order that does every task...
{ "kind": "code.debug.drop_stmt.topo_order", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 9, "entry": "schedule", "checked_by": "buggy code fails on [2, [[1, 0]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "723aad79cf...
codedebug-train-000068
[ { "role": "user", "content": "Please review this solution: there is a bug somewhere. Find it, show an input that fails, and fix it.\n\nTask: The string contains non-negative integers, `+`, `-`, `*`, `/`, parentheses, spaces, and unary minus (as in `-3` or `-(2 + 1)`). Evaluate it with the usual precedence (...
{ "kind": "code.debug.neg_drop.expr_eval", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 43, "entry": "eval_expression", "checked_by": "buggy code fails on [\"7 / -2\"]...; fix == verified reference (oracle-checked on 22 inputs)", "problem_id": "291...
codedebug-train-000069
[ { "role": "user", "content": "My solution gives the wrong answer: `task_order(2, [])` should be `[0, 1]`, I get `[]`. What's wrong?\n\nTask: There are `n` tasks `0..n-1` and pairs `[a, b]` meaning task `a` must be done before task `b`. Return the lexicographically smallest order that does every task once an...
{ "kind": "code.debug.drop_stmt.topo_order", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 15, "entry": "task_order", "checked_by": "buggy code fails on [2, []]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "723aad79cf87"...
codedebug-train-000070
[ { "role": "user", "content": "This is supposed to solve the task below, but `min_cost_path(3, [[0, 1, 5]], 0, 2, 1)` returns `inf` instead of `-1`. Find and fix the bug.\n\nTask: There are `n` cities `0..n-1` and one-way flights `[u, v, price]`. Return the cheapest total price from `src` to `dst` using at m...
{ "kind": "code.debug.cmp_flip.cheapest_path", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 11, "entry": "min_cost_path", "checked_by": "buggy code fails on [3, [[0, 1, 5]], 0, 2, 1]...; fix == verified reference (oracle-checked on 19 inputs)", "prob...
codedebug-train-000071
[ { "role": "user", "content": "Here is my solution. Something is wrong but I can't see it. Can you find the bug?\n\nTask: Implement `RangeSum(nums)` with `update(index, value)`, which sets `nums[index] = value`, and `query(left, right)`, which returns the sum of `nums[left..right]` (both ends included, `left...
{ "kind": "code.debug.arith_flip.range_sum", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 26, "entry": "RangeSum", "checked_by": "buggy code fails on {\"init\": [[1, 2, 3]], \"ops\": [[\"update\", 1, 2], [\"query\", 0,...; fix == verified reference (...
codedebug-train-000072
[ { "role": "user", "content": "My solution gives the wrong answer: `valid_brackets('(())')` should be `True`, I get `False`. What's wrong?\n\nTask: Return True if every `(`, `[` and `{` in `s` is closed by the matching bracket in the right order, and False otherwise. Other characters are ignored.\n\n```pytho...
{ "kind": "code.debug.cmp_flip.brackets", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 8, "entry": "valid_brackets", "checked_by": "buggy code fails on [\"(())\"]...; fix == verified reference (oracle-checked on 22 inputs)", "problem_id": "9719044729...
codedebug-train-000073
[ { "role": "user", "content": "Ratkaisuni antaa väärän vastauksen: `obj = LRUCache(1); obj.put(1, 1); obj.put(2, 2); obj.get(1); obj.get(2)` pitäisi olla `2`, saan `-1`. Mikä on vialla?\n\nTehtävä: Toteuta `LRUCache(capacity)`, jossa on `get(key)` (arvo tai -1, jos avainta ei ole) ja `put(key, value)`. Molem...
{ "kind": "code.debug.cmp_flip.lru_cache", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 19, "entry": "LRUCache", "checked_by": "buggy code fails on {\"init\": [1], \"ops\": [[\"put\", 1, 1], [\"put\", 2, 2], [\"get\", ...; fix == verified reference (or...
codedebug-train-000074
[ { "role": "user", "content": "This is supposed to solve the task below, but `spiral_order([[1]])` returns `[]` instead of `[1]`. Find and fix the bug.\n\nTask: Return all elements of the `rows × cols` matrix in spiral order, starting at the top-left corner and going clockwise (right along the top row first)...
{ "kind": "code.debug.arith_flip.spiral", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 7, "entry": "spiral_order", "checked_by": "buggy code fails on [[[1]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "38f2502ba7af", ...
codedebug-train-000075
[ { "role": "user", "content": "Tässä ratkaisuni. Jokin on vialla, mutta en näe mikä. Löydätkö virheen?\n\nTehtävä: `s` sisältää vain pieniä kirjaimia. Korvaa jokainen samojen kirjainten jakso kirjaimella ja jakson pituudella (jokainen jakso kirjoitetaan kirjaimena ja pituutena, myös pituus 1). Esimerkki: 'aa...
{ "kind": "code.debug.cmp_flip.rle", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 6, "entry": "run_length", "checked_by": "buggy code fails on [\"abc\"]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "082a4c4820df", "...
codedebug-train-000076
[ { "role": "user", "content": "Please review this solution: there is a bug somewhere. Find it, show an input that fails, and fix it.\n\nTask: Return the number of different ways to split `s` into words from `words` (each word can be used any number of times), modulo 1,000,000,007. The empty string has exactl...
{ "kind": "code.debug.arith_flip.word_break", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 10, "entry": "segment_ways", "checked_by": "buggy code fails on [\"aaaa\", [\"a\", \"aa\"]]...; fix == verified reference (oracle-checked on 20 inputs)", "pr...
codedebug-train-000077
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `first_cycle_edge(8, [[2, 6]])` palauttaa `[2, 6]` eikä `[]`. Etsi ja korjaa virhe.\n\nTehtävä: Solmuja on `n`, numeroitu 0..n-1, ja suuntaamattomat kaaret annetaan listana `[u, v]`. Kaaret lisätään yksi kerrallaan annetussa jär...
{ "kind": "code.debug.cmp_flip.union_find", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 13, "entry": "first_cycle_edge", "checked_by": "buggy code fails on [8, [[2, 6]]]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_id": "68...
codedebug-train-000078
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `peak_time([[7, 8]])` palauttaa `None` eikä `7`. Etsi ja korjaa virhe.\n\nTehtävä: Jokainen kokous on `[start, end)` (se on käynnissä hetkellä t, kun start <= t < end). Palauta aikaisin kokonaislukuhetki, jolloin käynnissä olevi...
{ "kind": "code.debug.cmp_flip.meeting_rooms", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 7, "entry": "peak_time", "checked_by": "buggy code fails on [[[7, 8]]]...; fix == verified reference (oracle-checked on 17 inputs)", "problem_id": "4e1403982f...
codedebug-train-000079
[ { "role": "user", "content": "Ratkaisuni antaa väärän vastauksen: `most_frequent(['a', 'b', 'a'], 1)` pitäisi olla `['a']`, saan `['b']`. Mikä on vialla?\n\nTehtävä: Palauta listan `words` `k` yleisintä sanaa yleisimmästä alkaen. Saman verran esiintyvät sanat järjestetään aakkosjärjestykseen. Jos erilaisia ...
{ "kind": "code.debug.neg_drop.top_k_words", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 7, "entry": "most_frequent", "checked_by": "buggy code fails on [[\"a\", \"b\", \"a\"], 1]...; fix == verified reference (oracle-checked on 18 inputs)", "proble...
codedebug-train-000080
[ { "role": "user", "content": "Kun ajan `longest_with_k_kinds('dcc', 0)`, ohjelma kaatuu tällä virheilmoituksella. Mistä on kyse ja miten korjaan sen?\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 18, in <module>\n longest_with_k_kinds('dcc', 0)\n ~~~~~~~~~~~~~~~~~~~~^^^^^^^^...
{ "kind": "code.debug.drop_stmt.longest_window", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 10, "entry": "longest_with_k_kinds", "checked_by": "buggy code fails on [\"dcc\", 0]...; fix == verified reference (oracle-checked on 20 inputs)", "pro...
codedebug-train-000081
[ { "role": "user", "content": "Please review this solution: there is a bug somewhere. Find it, show an input that fails, and fix it.\n\nTask: You are given a list of intervals `[start, end]` with `start < end`, in no particular order. Merge every group of intervals that overlap by more than a single point ([...
{ "kind": "code.debug.cmp_flip.merge_intervals", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 8, "entry": "merge", "checked_by": "buggy code fails on [[[1, 3], [3, 5]]]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "62...
codedebug-train-000082
[ { "role": "user", "content": "This is supposed to solve the task below, but `obj = RecentCache(1); obj.put(1, 1); obj.put(2, 2); obj.get(1); obj.get(2)` returns `-1` instead of `2`. Find and fix the bug.\n\nTask: Implement `RecentCache(capacity)` with `get(key)` (the value, or -1 if absent) and `put(key, va...
{ "kind": "code.debug.cmp_flip.lru_cache", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 19, "entry": "RecentCache", "checked_by": "buggy code fails on {\"init\": [1], \"ops\": [[\"put\", 1, 1], [\"put\", 2, 2], [\"get\", ...; fix == verified reference ...
codedebug-train-000083
[ { "role": "user", "content": "This is supposed to solve the task below, but `largest_square([4, 6, 8])` returns `25` instead of `9`. Find and fix the bug.\n\nTask: `heights[i]` is the height of bar `i` in a histogram; every bar is 1 wide and bars stand side by side. Return the area of the largest axis-align...
{ "kind": "code.debug.arith_flip.histogram", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 8, "entry": "largest_square", "checked_by": "buggy code fails on [[4, 6, 8]]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id": "d87fff...
codedebug-train-000084
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `longest_palindromic_substring('a')` palauttaa `3` eikä `1`. Etsi ja korjaa virhe.\n\nTehtävä: Palauta merkkijonon `s` pisimmän sellaisen osajonon pituus, joka on sama takaperin luettuna. `s` voi olla tuhansia merkkejä pitkä, jo...
{ "kind": "code.debug.arith_flip.palindromes", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 8, "entry": "longest_palindromic_substring", "checked_by": "buggy code fails on [\"a\"]...; fix == verified reference (oracle-checked on 20 inputs)", "problem...
codedebug-train-000085
[ { "role": "user", "content": "I get an exception for `longest_with_k_kinds('c', 0)`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 18, in <module>\n longest_with_k_kinds('c', 0)\n ~~~~~~~~~~~~~~~~~~~~^^^^^^^^\n File \"solution.py\", line 10, in longest_with_k_kinds\n cou...
{ "kind": "code.debug.drop_stmt.longest_window", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 10, "entry": "longest_with_k_kinds", "checked_by": "buggy code fails on [\"c\", 0]...; fix == verified reference (oracle-checked on 20 inputs)", "probl...
codedebug-train-000086
[ { "role": "user", "content": "This is supposed to solve the task below, but `calc('1')` raises `IndexError: list index out of range` instead of returning `1`. Find and fix the bug.\n\nTask: The string contains non-negative integers, `+`, `-`, `*`, `/`, parentheses, spaces, and unary minus (as in `-3` or `-(...
{ "kind": "code.debug.cmp_flip.expr_eval", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 20, "entry": "calc", "checked_by": "buggy code fails on [\"1\"]...; fix == verified reference (oracle-checked on 22 inputs)", "problem_id": "ba1b3f285f18", "pro...
codedebug-train-000087
[ { "role": "user", "content": "Ratkaisuni kaatuu: `calc('8')` pitäisi palauttaa `8`, mutta se nostaa poikkeuksen `IndexError: list index out of range`. Mikä on vialla?\n\nTehtävä: Merkkijonossa on ei-negatiivisia kokonaislukuja, `+`, `-`, `*`, `/`, sulkeita, välilyöntejä ja unaarinen miinus (kuten `-3` tai `...
{ "kind": "code.debug.arith_flip.expr_eval", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 23, "entry": "calc", "checked_by": "buggy code fails on [\"8\"]...; fix == verified reference (oracle-checked on 22 inputs)", "problem_id": "2918dd17ef27", "p...
codedebug-train-000088
[ { "role": "user", "content": "Please review this solution: there is a bug somewhere. Find it, show an input that fails, and fix it.\n\nTask: Return the `k` most frequent words in `words`, most frequent first. Words with the same count are ordered alphabetically. If there are fewer than `k` distinct words, r...
{ "kind": "code.debug.neg_drop.top_k_words", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 7, "entry": "top_words", "checked_by": "buggy code fails on [[\"a\", \"b\", \"a\"], 1]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_...
codedebug-train-000089
[ { "role": "user", "content": "Please review this solution: there is a bug somewhere. Find it, show an input that fails, and fix it.\n\nTask: The grid is a list of equal-length strings of '1' (land) and '0' (water). Two land cells belong to the same island when they are next to each other horizontally, verti...
{ "kind": "code.debug.cmp_flip.count_islands", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 10, "entry": "islands", "checked_by": "buggy code fails on [[\"0\"]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "49595087de...
codedebug-train-000090
[ { "role": "user", "content": "My solution gives the wrong answer: `cheapest_price(3, [[2, 1, 22], [1, 2, 36]], 1, 2, 1)` should be `36`, I get `-36`. What's wrong?\n\nTask: There are `n` cities `0..n-1` and one-way flights `[u, v, price]` with positive prices. Return the cheapest total price from `src` to `...
{ "kind": "code.debug.arith_flip.cheapest_path", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 19, "entry": "cheapest_price", "checked_by": "buggy code fails on [3, [[2, 1, 22], [1, 2, 36]], 1, 2, 1]...; fix == verified reference (oracle-checked on 19 i...
codedebug-train-000091
[ { "role": "user", "content": "Ratkaisuni kaatuu: `min_eating_speed([15], 3)` pitäisi palauttaa `5`, mutta se nostaa poikkeuksen `NameError: name 'mid' is not defined`. Mikä on vialla?\n\nTehtävä: Kasoja on `piles`. Nopeudella `k` otat yhdestä kasasta enintään `k` esinettä tunnissa (kasa, jossa on vähemmän, ...
{ "kind": "code.debug.drop_stmt.search_answer", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 7, "entry": "min_eating_speed", "checked_by": "buggy code fails on [[15], 3]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "aa3...
codedebug-train-000092
[ { "role": "user", "content": "Running `count_ways([2], 3)` crashes with this traceback. What's going on and how do I fix it?\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 10, in <module>\n count_ways([2], 3)\n ~~~~~~~~~~^^^^^^^^\n File \"solution.py\", line 3, in count_ways...
{ "kind": "code.debug.arith_flip.coin_change", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 3, "entry": "count_ways", "checked_by": "buggy code fails on [[2], 3]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "c64d99...
codedebug-train-000093
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `busiest_moment([[0, 2], [8, 12]])` palauttaa `8` eikä `0`. Etsi ja korjaa virhe.\n\nTehtävä: Jokainen kokous on `[start, end)` (se on käynnissä hetkellä t, kun start <= t < end). Palauta aikaisin kokonaislukuhetki, jolloin käyn...
{ "kind": "code.debug.cmp_flip.meeting_rooms", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 7, "entry": "busiest_moment", "checked_by": "buggy code fails on [[[0, 2], [8, 12]]]...; fix == verified reference (oracle-checked on 17 inputs)", "problem_id...
codedebug-train-000094
[ { "role": "user", "content": "Here is my solution. Something is wrong but I can't see it. Can you find the bug?\n\nTask: Implement `PrefixCounter()` with three methods: `insert(word)` adds a word (duplicates count again), `count(word)` returns how many times exactly `word` was inserted, and `starts_with(pre...
{ "kind": "code.debug.drop_stmt.prefix_counter", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 10, "entry": "PrefixCounter", "checked_by": "buggy code fails on {\"init\": [], \"ops\": [[\"insert\", \"abc\"], [\"starts_with\", \"abc...; fix == verified...
codedebug-train-000095
[ { "role": "user", "content": "Please review this solution: there is a bug somewhere. Find it, show an input that fails, and fix it.\n\nTask: Return how many non-empty contiguous subarrays of `nums` there are whose sum is exactly `k`. Values can be negative and the list can have hundreds of thousands of elem...
{ "kind": "code.debug.index_swap.subarray_count", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 6, "entry": "subarrays_with_sum", "checked_by": "buggy code fails on [[3], 3]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id":...
codedebug-train-000096
[ { "role": "user", "content": "Ratkaisuni antaa väärän vastauksen: `longest_k_distinct('ca', 2)` pitäisi olla `2`, saan `0`. Mikä on vialla?\n\nTehtävä: Palauta merkkijonon `s` pisimmän sellaisen osajonon pituus, jossa on enintään `k` eri merkkiä (`k >= 0`). `s` voi olla satojatuhansia merkkejä pitkä.\n\n```...
{ "kind": "code.debug.arith_flip.longest_window", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 15, "entry": "longest_k_distinct", "checked_by": "buggy code fails on [\"ca\", 2]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_id...
codedebug-train-000097
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `transform_cost('d', 'bd')` nostaa poikkeuksen `IndexError: string index out of range` eikä palauta `2`. Etsi ja korjaa virhe.\n\nTehtävä: Muuta merkkijono `a` merkkijonoksi `b`. Merkin lisääminen maksaa 2, poistaminen 2 ja merk...
{ "kind": "code.debug.arith_flip.edit_distance", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 7, "entry": "transform_cost", "checked_by": "buggy code fails on [\"d\", \"bd\"]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id":...
codedebug-train-000098
[ { "role": "user", "content": "This is supposed to solve the task below, but `longest_increasing([7])` raises `IndexError: list assignment index out of range` instead of returning `1`. Find and fix the bug.\n\nTask: Return the length of the longest subsequence of `nums` (not necessarily contiguous) that is s...
{ "kind": "code.debug.cmp_flip.lis", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 8, "entry": "longest_increasing", "checked_by": "buggy code fails on [[7]]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "a9b07ae35241", ...
codedebug-train-000099
[ { "role": "user", "content": "Ratkaisuni antaa väärän vastauksen: `max_profit_once([1, 2])` pitäisi olla `1`, saan `0`. Mikä on vialla?\n\nTehtävä: `prices[i]` on osakkeen hinta päivänä `i`. Saat ostaa kerran ja myydä kerran myöhemmin (tai olla käymättä kauppaa). Palauta suurin mahdollinen voitto. Päiviä vo...
{ "kind": "code.debug.drop_stmt.stock_profit", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 5, "entry": "max_profit_once", "checked_by": "buggy code fails on [[1, 2]]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "0405ef...