Dataset Viewer
Auto-converted to Parquet Duplicate
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"...
End of preview. Expand in Data Studio

Kreatix Code Debug

1,364 debugging conversations in English and Finnish. Each one shows a Python solution with one real bug. The reply finds the line, explains the cause, fixes it, and shows the input that failed. Every bug was checked: the buggy code really fails, and the fix restores a solution verified against an independent brute-force solver.

The user asks in one of three ways:

Mode The user gives The reply starts from
failing call a call that returns the wrong value the expected and actual values
traceback the real traceback from running the buggy file the line that raised the error
no hint only the code and the task finding a failing input first, then the bug

Bugs are the kind people actually make: a flipped comparison (< vs <=), + and - swapped, and and or swapped, min and max swapped, bisect_left and bisect_right swapped, an off-by-one in range(), index 0 and -1 swapped, a wrong starting value, a dropped minus sign, or a statement missing from a loop.

Made by KreatixLabs. Every row is built by a program: no language model wrote any text or code in this dataset.

Injected bug types in the train split

What it looks like

User

I get an exception for `rooms_needed([[0, 1]])`:

```
Traceback (most recent call last):
  File "solution.py", line 14, in <module>
    rooms_needed([[0, 1]])
    ~~~~~~~~~~~~^^^^^^^^^^
  File "solution.py", line 7, in rooms_needed
    if ends or ends[0] <= start:
               ~~~~^^^
IndexError: list index out of range
```

```python
import heapq


def rooms_needed(meetings: list[list[int]]) -> int:
    ends = []
    for start, end in sorted(meetings):
        if ends or ends[0] <= start:
            heapq.heapreplace(ends, end)
        else:
            heapq.heappush(ends, end)
    return len(ends)
```

Assistant

The crash comes from line 7: on this input the bug drives the code into an invalid operation (`IndexError`).

**Bug:** line 7
```python
        if ends or ends[0] <= start:
```
The two conditions are joined with `or`, but the logic needs `and` (both conditions must hold).

**Fix:**
```python
        if ends and ends[0] <= start:
```

**Corrected code:**
```python
import heapq


def rooms_needed(meetings: list[list[int]]) -> int:
    ends = []
    for start, end in sorted(meetings):
        if ends and ends[0] <= start:
            heapq.heapreplace(ends, end)
        else:
            heapq.heappush(ends, end)
    return len(ends)
```

With the fix, `rooms_needed([[0, 1]])` returns `1` instead of raising an error, and the code gives the expected result on all 18 test inputs, including the edge cases.

meta: {"kind": "code.debug.bool_flip.meeting_rooms", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 7, "entry": "rooms_needed", "checked_by": "buggy code fails on [[[0, 1]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "a177e8982e5d", "program_id": "0788d5ac5157"}

How it was checked

  1. The starting solution comes from Kreatix Code Hard: it agrees with an independent brute-force solver on every test input and passes a large-input time limit.
  2. One bug is injected by editing an exact span of the source found through Python's AST, so comments and layout are untouched and the diff is a single line.
  3. The buggy program is run on all of the problem's inputs. It is kept only if it compiles and fails at least one of them; the smallest failing input is the one shown.
  4. Tracebacks are real output from running the buggy file (file name shown as solution.py).
  5. The fix shown restores the verified solution exactly, so "with the fix, all N test inputs pass" is true.

meta.bug_line is the line of the bug in the code the user shows.

Size and repetition

Split Rows en fi Distinct buggy programs
train 1,196 809 387 642
test 168 116 52 84

About 0.8M tokens in total.

Each buggy program appears at most twice (with different request styles or failing inputs), and each problem family at most 80 times. meta.program_id identifies the buggy program and meta.problem_id the solution it came from.

Test split: bugs in five families that never appear in train (two-colouring, decode ways, next greater element, trapped water / container, running median), so the test measures debugging code the model has not seen.

stats.json has the counts per bug type and problem family; samples.md shows examples in full.

Limitations

  • One bug per program. Real code often has several interacting bugs; this dataset teaches the core loop: reproduce, localise, explain, fix, re-check.
  • Explanations come from a template per bug type, filled with the actual line, values and error.
  • Python only. The Finnish text is awaiting review by native speakers.

License

Apache-2.0.

Downloads last month
42