id
stringlengths
22
22
messages
listlengths
2
2
meta
dict
codedebug-train-000200
[ { "role": "user", "content": "My solution gives the wrong answer: `sliding_max([2, -1, 2, -1], 1)` should be `[2, -1, 2, -1]`, I get `[2, 2, 2, 2]`. What's wrong?\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, f...
{ "kind": "code.debug.index_swap.window_extreme", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 11, "entry": "sliding_max", "checked_by": "buggy code fails on [[2, -1, 2, -1], 1]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_i...
codedebug-train-000201
[ { "role": "user", "content": "This is supposed to solve the task below, but `count_inversions([-2, -2])` returns `1` instead of `0`. Find and fix the bug.\n\nTask: Return the number of index pairs `i < j` with `a[i] > a[j]`. Values can be negative and the list can have 150,000 elements, so checking every pa...
{ "kind": "code.debug.cmp_flip.inversions", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 12, "entry": "count_inversions", "checked_by": "buggy code fails on [[-2, -2]]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id": "ee7e5...
codedebug-train-000202
[ { "role": "user", "content": "My solution crashes: `palindromic_substrings('a')` should return `1`, but it raises `UnboundLocalError: cannot access local variable 'lo' where it is not associated with a value`. What is wrong?\n\nTask: Return how many non-empty substrings of `s` (counted by position) read the...
{ "kind": "code.debug.drop_stmt.palindromes", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 4, "entry": "palindromic_substrings", "checked_by": "buggy code fails on [\"a\"]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_id": "d...
codedebug-train-000203
[ { "role": "user", "content": "Running `valid_brackets(')')` 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 13, in <module>\n valid_brackets(')')\n ~~~~~~~~~~~~~~^^^^^\n File \"solution.py\", line 8, in valid_b...
{ "kind": "code.debug.bool_flip.brackets", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 8, "entry": "valid_brackets", "checked_by": "buggy code fails on [\")\"]...; fix == verified reference (oracle-checked on 22 inputs)", "problem_id": "9719044...
codedebug-train-000204
[ { "role": "user", "content": "Running `lis_length([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 15, in <module>\n lis_length([7])\n ~~~~~~~~~~^^^^^\n File \"solution.py\", line 7, in lis_length\n i =...
{ "kind": "code.debug.bisect_swap.lis", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 7, "entry": "lis_length", "checked_by": "buggy code fails on [[7]]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "53e040dea565", ...
codedebug-train-000205
[ { "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.cmp_flip.range_sum", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 10, "entry": "RangeSum", "checked_by": "buggy code fails on {\"init\": [[-6, 6, 3, 5]], \"ops\": [[\"query\", 0, 3], [\"query\",...; fix == verified reference (or...
codedebug-train-000206
[ { "role": "user", "content": "This is supposed to solve the task below, but `obj = RangeSum([-8, 4, 4, -2, -7, 9, -9, 9, 0]); obj.query(5, 8)` returns `16` instead of `9`. Find and fix the bug.\n\nTask: Implement `RangeSum(nums)` with `update(index, value)`, which sets `nums[index] = value`, and `query(left...
{ "kind": "code.debug.neg_drop.range_sum", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 12, "entry": "RangeSum", "checked_by": "buggy code fails on {\"init\": [[-8, 4, 4, -2, -7, 9, -9, 9, 0]], \"ops\": [[\"query\"...; fix == verified reference (oracle...
codedebug-train-000207
[ { "role": "user", "content": "Tässä ratkaisuni. Jokin on vialla, mutta en näe mikä. Löydätkö virheen?\n\nTehtävä: Paketit painoilla `weights` on kuljetettava annetussa järjestyksessä `days` päivässä (1 <= days <= len(weights)). Joka päivä laiva ottaa peräkkäisiä paketteja, joiden yhteispaino ei ylitä sen ka...
{ "kind": "code.debug.cmp_flip.search_answer", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 5, "entry": "min_ship_capacity", "checked_by": "buggy code fails on [[6, 6, 5], 2]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id...
codedebug-train-000208
[ { "role": "user", "content": "This is supposed to solve the task below, but `longest_distinct_substring('a')` returns `0` instead of `1`. Find and fix the bug.\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....
{ "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-000209
[ { "role": "user", "content": "My solution gives the wrong answer: `run_length('abc')` should be `'a1b1c1'`, I get `'c1b1c1'`. 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 l...
{ "kind": "code.debug.index_swap.rle", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 4, "entry": "run_length", "checked_by": "buggy code fails on [\"abc\"]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "082a4c4820df", "...
codedebug-train-000210
[ { "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.arith_flip.robot_walk", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 15, "entry": "robot_max_distance", "checked_by": "buggy code fails on [[4], [[0, 2]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_...
codedebug-train-000211
[ { "role": "user", "content": "This is supposed to solve the task below, but `longest_palindrome_len('a')` returns `0` instead of `1`. Find and fix the bug.\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...
{ "kind": "code.debug.minmax_swap.palindromes", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 8, "entry": "longest_palindrome_len", "checked_by": "buggy code fails on [\"a\"]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_id": ...
codedebug-train-000212
[ { "role": "user", "content": "My solution gives the wrong answer: `robot_max_distance([6, -1, 3, -2, 1, 2, 4, 5], [[-1, -1], [-4, 2], [2, 1], [4, 3]])` should be `333`, I get `45`. What's wrong?\n\nTask: A robot starts at (0, 0) facing north. Commands: `-2` turns left 90°, `-1` turns right 90°, and `k` (1-9...
{ "kind": "code.debug.arith_flip.robot_walk", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 10, "entry": "robot_max_distance", "checked_by": "buggy code fails on [[6, -1, 3, -2, 1, 2, 4, 5], [[-1, -1], [-4, 2], [2, 1], [4,...; fix == verified reference ...
codedebug-train-000213
[ { "role": "user", "content": "My solution gives the wrong answer: `trade_with_cooldown([2, 2, 7])` should be `5`, I get `0`. 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, holding at most one share at a time, but after a sale you cannot bu...
{ "kind": "code.debug.minmax_swap.stock_profit", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 4, "entry": "trade_with_cooldown", "checked_by": "buggy code fails on [[2, 2, 7]]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id"...
codedebug-train-000214
[ { "role": "user", "content": "My solution gives the wrong answer: `can_segment('bcacab', ['ca', 'b'])` should be `True`, I get `False`. What's wrong?\n\nTask: Return True if `s` can be split into a sequence of one or more words from `words` (each word can be used any number of times), and False otherwise. T...
{ "kind": "code.debug.minmax_swap.word_break", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 3, "entry": "can_segment", "checked_by": "buggy code fails on [\"bcacab\", [\"ca\", \"b\"]]...; fix == verified reference (oracle-checked on 20 inputs)", "pro...
codedebug-train-000215
[ { "role": "user", "content": "Ratkaisuni antaa väärän vastauksen: `walk([4], [[0, 2]])` pitäisi olla `1`, saan `16`. Mikä on vialla?\n\nTehtävä: Robotti aloittaa pisteestä (0, 0) pohjoiseen päin. Komennot: `-2` kääntää 90° vasemmalle, `-1` kääntää 90° oikealle ja `k` (1-9) liikkuu k askelta eteenpäin. Jos s...
{ "kind": "code.debug.arith_flip.robot_walk", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 15, "entry": "walk", "checked_by": "buggy code fails on [[4], [[0, 2]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "ed0035dc3a...
codedebug-train-000216
[ { "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": 22, "entry": "RangeSum", "checked_by": "buggy code fails on {\"init\": [[1, 2, 3]], \"ops\": [[\"update\", 1, 2], [\"query\", 0,...; fix == verified reference (...
codedebug-train-000217
[ { "role": "user", "content": "My solution gives the wrong answer: `slowest_speed([20, 9], 2)` should be `20`, I get `9`. What's wrong?\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). Return the smal...
{ "kind": "code.debug.minmax_swap.search_answer", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 5, "entry": "slowest_speed", "checked_by": "buggy code fails on [[20, 9], 2]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "a...
codedebug-train-000218
[ { "role": "user", "content": "Please review this solution: there is a bug somewhere. Find it, show an input that fails, and fix it.\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, ...
{ "kind": "code.debug.arith_flip.prefix_counter", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 7, "entry": "PrefixCounter", "checked_by": "buggy code fails on {\"init\": [], \"ops\": [[\"starts_with\", \"\"], [\"count\", \"\"], [\"i...; fix == verifi...
codedebug-train-000219
[ { "role": "user", "content": "Tässä ratkaisuni. Jokin on vialla, mutta en näe mikä. Löydätkö virheen?\n\nTehtävä: Palauta niiden indeksiparien `i < j` määrä, joille `a[i] > a[j]`. Arvot voivat olla negatiivisia, ja listassa voi olla 150 000 alkiota, joten jokaisen parin tarkistaminen on liian hidasta.\n\n``...
{ "kind": "code.debug.cmp_flip.inversions", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 12, "entry": "count_inversions", "checked_by": "buggy code fails on [[2, 2, 2]]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id": "ee...
codedebug-train-000220
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `eval_expression('-3 * (2 + 4)')` palauttaa `6` eikä `-18`. Etsi ja korjaa virhe.\n\nTehtävä: Merkkijonossa on ei-negatiivisia kokonaislukuja, `+`, `-`, `*`, `/`, sulkeita, välilyöntejä ja unaarinen miinus (kuten `-3` tai `-(2 +...
{ "kind": "code.debug.arith_flip.expr_eval", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 50, "entry": "eval_expression", "checked_by": "buggy code fails on [\"-3 * (2 + 4)\"]...; fix == verified reference (oracle-checked on 22 inputs)", "problem_id"...
codedebug-train-000221
[ { "role": "user", "content": "I get an exception for `segment_ways('ccccc', ['c'])`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 15, in <module>\n segment_ways('ccccc', ['c'])\n ~~~~~~~~~~~~^^^^^^^^^^^^^^^^\n File \"solution.py\", line 10, in segment_ways\n if w in voc...
{ "kind": "code.debug.drop_stmt.word_break", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 10, "entry": "segment_ways", "checked_by": "buggy code fails on [\"ccccc\", [\"c\"]]...; fix == verified reference (oracle-checked on 20 inputs)", "problem...
codedebug-train-000222
[ { "role": "user", "content": "My solution gives the wrong answer: `smallest_capacity([3, 8, 9], 2)` should be `11`, I get `9`. 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 consecutiv...
{ "kind": "code.debug.arith_flip.search_answer", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 6, "entry": "smallest_capacity", "checked_by": "buggy code fails on [[3, 8, 9], 2]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id...
codedebug-train-000223
[ { "role": "user", "content": "Tässä ratkaisuni. Jokin on vialla, mutta en näe mikä. Löydätkö virheen?\n\nTehtävä: `heights[i]` on histogrammin pylvään `i` korkeus; jokainen pylväs on 1 leveä, ja pylväät ovat vierekkäin. Palauta suurimman pylväiden sisään mahtuvan akselien suuntaisen suorakulmion pinta-ala. ...
{ "kind": "code.debug.drop_stmt.histogram", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 9, "entry": "largest_rectangle", "checked_by": "buggy code fails on [[6, 2]]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id": "88cfb...
codedebug-train-000224
[ { "role": "user", "content": "I get an exception for `fewest_coins([4], 7)`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 11, in <module>\n fewest_coins([4], 7)\n ~~~~~~~~~~~~^^^^^^^^\n File \"solution.py\", line 7, in fewest_coins\n best[a] = best[a + c] + 1\n ...
{ "kind": "code.debug.arith_flip.coin_change", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 7, "entry": "fewest_coins", "checked_by": "buggy code fails on [[4], 7]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "9d7f...
codedebug-train-000225
[ { "role": "user", "content": "I get an exception for `min_word_split('abca', ['abca'])`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 16, in <module>\n min_word_split('abca', ['abca'])\n ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^\n File \"solution.py\", line 12, in min_word_split\n ...
{ "kind": "code.debug.arith_flip.word_break", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 12, "entry": "min_word_split", "checked_by": "buggy code fails on [\"abca\", [\"abca\"]]...; fix == verified reference (oracle-checked on 20 inputs)", "pr...
codedebug-train-000226
[ { "role": "user", "content": "Tässä ratkaisuni. Jokin on vialla, mutta en näe mikä. Löydätkö virheen?\n\nTehtävä: Ruudukko on lista yhtä pitkiä merkkijonoja, joissa '1' on maata ja '0' vettä. Kaksi maaruutua kuuluu samaan saareen, kun ne ovat vierekkäin vaaka-, pysty- tai vinosuunnassa. Palauta saarten määr...
{ "kind": "code.debug.drop_stmt.count_islands", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 16, "entry": "count_islands", "checked_by": "buggy code fails on [[\"11\"]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "75...
codedebug-train-000227
[ { "role": "user", "content": "This is supposed to solve the task below, but `robot_max_distance([4], [[0, 2]])` returns `0` instead of `1`. Find and fix 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 ...
{ "kind": "code.debug.arith_flip.robot_walk", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 16, "entry": "robot_max_distance", "checked_by": "buggy code fails on [[4], [[0, 2]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id...
codedebug-train-000228
[ { "role": "user", "content": "Kun ajan `longest_increasing([7])`, ohjelma kaatuu tällä virheilmoituksella. Mistä on kyse ja miten korjaan sen?\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 15, in <module>\n longest_increasing([7])\n ~~~~~~~~~~~~~~~~~~^^^^^\n File \"solution...
{ "kind": "code.debug.bisect_swap.lis", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 7, "entry": "longest_increasing", "checked_by": "buggy code fails on [[7]]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "a9b07ae3...
codedebug-train-000229
[ { "role": "user", "content": "Ratkaisuni antaa väärän vastauksen: `obj = PrefixCounter(); obj.insert('abc'); obj.starts_with('abcd'); obj.count('abcd'); obj.starts_with('abc')` pitäisi olla `1`, saan `0`. Mikä on vialla?\n\nTehtävä: Toteuta `PrefixCounter()`, jossa on kolme metodia: `insert(word)` lisää san...
{ "kind": "code.debug.arith_flip.prefix_counter", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 11, "entry": "PrefixCounter", "checked_by": "buggy code fails on {\"init\": [], \"ops\": [[\"insert\", \"abc\"], [\"starts_with\", \"abc...; fix == verified ...
codedebug-train-000230
[ { "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.minmax_swap.robot_walk", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 16, "entry": "robot_max_distance", "checked_by": "buggy code fails on [[5], []]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": ...
codedebug-train-000231
[ { "role": "user", "content": "Ratkaisuni antaa väärän vastauksen: `obj = RateLimiter(1, 2); obj.allow(1); obj.allow(3); obj.allow(4)` 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\": [1, 2], \"ops\": [[\"allow\", 1], [\"allow\", 3], [\"allow...; fix == verified refere...
codedebug-train-000232
[ { "role": "user", "content": "Ratkaisuni antaa väärän vastauksen: `min_cost_path(2, [], 0, 1, 2)` pitäisi olla `-1`, saan `0`. Mikä on vialla?\n\nTehtävä: Kaupunkeja on `n` (`0..n-1`) ja yhdensuuntaisia lentoja `[u, v, price]` positiivisin hinnoin. Palauta halvin kokonaishinta kaupungista `src` kaupunkiin `...
{ "kind": "code.debug.cmp_flip.cheapest_path", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 15, "entry": "min_cost_path", "checked_by": "buggy code fails on [2, [], 0, 1, 2]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": ...
codedebug-train-000233
[ { "role": "user", "content": "Here is my solution. Something is wrong but I can't see it. Can you find the bug?\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_primes(lo: int, hi...
{ "kind": "code.debug.cmp_flip.primes_range", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 2, "entry": "count_primes", "checked_by": "buggy code fails on [2, 2]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "fcfb2ec4ac...
codedebug-train-000234
[ { "role": "user", "content": "This is supposed to solve the task below, but `merge([[1, 3], [3, 5]])` returns `[[1, 3]]` instead of `[[1, 5]]`. Find and fix the bug.\n\nTask: You are given a list of intervals `[start, end]` with `start < end`, in no particular order. Merge every group of intervals that over...
{ "kind": "code.debug.minmax_swap.merge_intervals", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 6, "entry": "merge", "checked_by": "buggy code fails on [[[1, 3], [3, 5]]]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "7...
codedebug-train-000235
[ { "role": "user", "content": "Here is my solution. Something is wrong but I can't see it. Can you find the bug?\n\nTask: Given distinct positive coin values (unlimited supply of each) and an amount, return the number of different combinations that add up to the amount, modulo 1,000,000,007. Order does not m...
{ "kind": "code.debug.arith_flip.coin_change", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 6, "entry": "coin_combinations", "checked_by": "buggy code fails on [[5, 6], 6]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": ...
codedebug-train-000236
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `walk([4], [[0, 2]])` palauttaa `0` eikä `1`. Etsi ja korjaa virhe.\n\nTehtävä: Robotti aloittaa pisteestä (0, 0) pohjoiseen päin. Komennot: `-2` kääntää 90° vasemmalle, `-1` kääntää 90° oikealle ja `k` (1-9) liikkuu k askelta e...
{ "kind": "code.debug.minmax_swap.robot_walk", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 16, "entry": "walk", "checked_by": "buggy code fails on [[4], [[0, 2]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "ed0035dc3...
codedebug-train-000237
[ { "role": "user", "content": "My solution crashes: `longest_increasing([7])` should return `1`, but it raises `NameError: name 'i' is not defined`. What is wrong?\n\nTask: Return the length of the longest subsequence of `nums` (not necessarily contiguous) that is strictly increasing. `nums` can have up to 3...
{ "kind": "code.debug.drop_stmt.lis", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 7, "entry": "longest_increasing", "checked_by": "buggy code fails on [[7]]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "a9b07ae35241", ...
codedebug-train-000238
[ { "role": "user", "content": "Here is my solution. Something is wrong but I can't see it. Can you find 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 usual precedence (`*` and `/` before `...
{ "kind": "code.debug.arith_flip.expr_eval", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 50, "entry": "evaluate", "checked_by": "buggy code fails on [\"-3 * (2 + 4)\"]...; fix == verified reference (oracle-checked on 22 inputs)", "problem_id": "29...
codedebug-train-000239
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `obj = RecentCache(1); obj.put(1, 1); obj.put(2, 2); obj.get(1); obj.get(2)` palauttaa `-1` eikä `2`. Etsi ja korjaa virhe.\n\nTehtävä: Toteuta `RecentCache(capacity)`, jossa on `get(key)` (arvo tai -1, jos avainta ei ole) ja `p...
{ "kind": "code.debug.cmp_flip.lru_cache", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 43, "entry": "RecentCache", "checked_by": "buggy code fails on {\"init\": [1], \"ops\": [[\"put\", 1, 1], [\"put\", 2, 2], [\"get\", ...; fix == verified reference ...
codedebug-train-000240
[ { "role": "user", "content": "This is supposed to solve the task below, but `rooms_needed([[9, 10], [10, 11]])` returns `2` instead of `1`. Find and fix the bug.\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 neede...
{ "kind": "code.debug.cmp_flip.meeting_rooms", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 7, "entry": "rooms_needed", "checked_by": "buggy code fails on [[[9, 10], [10, 11]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id...
codedebug-train-000241
[ { "role": "user", "content": "Saan poikkeuksen kutsulla `count_inversions([1, 2, 3])`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 25, in <module>\n count_inversions([1, 2, 3])\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^\n File \"solution.py\", line 22, in count_inversions\n return ...
{ "kind": "code.debug.cmp_flip.inversions", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 11, "entry": "count_inversions", "checked_by": "buggy code fails on [[1, 2, 3]]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id": ...
codedebug-train-000242
[ { "role": "user", "content": "Ratkaisuni antaa väärän vastauksen: `schedule(3, [])` pitäisi olla `[0, 1, 2]`, saan `[]`. Mikä on vialla?\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, ...
{ "kind": "code.debug.cmp_flip.topo_order", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 10, "entry": "schedule", "checked_by": "buggy code fails on [3, []]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "723aad79cf87", ...
codedebug-train-000243
[ { "role": "user", "content": "This is supposed to solve the task below, but `min_word_split('babbab', ['bab'])` returns `-2` instead of `2`. Find and fix the bug.\n\nTask: Return the smallest number of words from `words` that concatenate to exactly `s` (each word can be used any number of times), or -1 if i...
{ "kind": "code.debug.arith_flip.word_break", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 12, "entry": "min_word_split", "checked_by": "buggy code fails on [\"babbab\", [\"bab\"]]...; fix == verified reference (oracle-checked on 20 inputs)", "proble...
codedebug-train-000244
[ { "role": "user", "content": "I get an exception for `schedule(7, [])`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 22, in <module>\n schedule(7, [])\n ~~~~~~~~^^^^^^^\n File \"solution.py\", line 14, in schedule\n order.append(task)\n ^^^^\nNameError: ...
{ "kind": "code.debug.drop_stmt.topo_order", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 14, "entry": "schedule", "checked_by": "buggy code fails on [7, []]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "723aad79cf...
codedebug-train-000245
[ { "role": "user", "content": "This is supposed to solve the task below, but `first_cycle_edge(5, [[0, 1], [0, 1]])` returns `[]` instead of `[0, 1]`. Find and fix the bug.\n\nTask: There are `n` nodes numbered 0..n-1 and a list of undirected edges `[u, v]`. Edges are added one by one in the given order. Ret...
{ "kind": "code.debug.drop_stmt.union_find", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 17, "entry": "first_cycle_edge", "checked_by": "buggy code fails on [5, [[0, 1], [0, 1]]]...; fix == verified reference (oracle-checked on 20 inputs)", "problem...
codedebug-train-000246
[ { "role": "user", "content": "This is supposed to solve the task below, but `merge([[1, 10], [2, 3], [4, 5]])` returns `[[2, 3], [4, 10]]` instead of `[[1, 10]]`. Find and fix the bug.\n\nTask: You are given a list of intervals `[start, end]` with `start < end`, in no particular order. Merge every group of ...
{ "kind": "code.debug.index_swap.merge_intervals", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 4, "entry": "merge", "checked_by": "buggy code fails on [[[1, 10], [2, 3], [4, 5]]]...; fix == verified reference (oracle-checked on 19 inputs)", "problem...
codedebug-train-000247
[ { "role": "user", "content": "This is supposed to solve the task below, but `merge_ranges([[1, 3], [3, 5]])` returns `[[1, 3], [3, 5]]` instead of `[[1, 5]]`. Find and fix the bug.\n\nTask: You are given a list of intervals `[start, end]` with `start < end`, in no particular order. Merge every group of inte...
{ "kind": "code.debug.cmp_flip.merge_intervals", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 5, "entry": "merge_ranges", "checked_by": "buggy code fails on [[[1, 3], [3, 5]]]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id"...
codedebug-train-000248
[ { "role": "user", "content": "My solution gives the wrong answer: `eval_expression('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 precedenc...
{ "kind": "code.debug.neg_drop.expr_eval", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 12, "entry": "eval_expression", "checked_by": "buggy code fails on [\"7 / -2\"]...; fix == verified reference (oracle-checked on 22 inputs)", "problem_id": "ba1b3...
codedebug-train-000249
[ { "role": "user", "content": "Kun ajan `spiral_order([[4], [1]])`, ohjelma kaatuu tällä virheilmoituksella. Mistä on kyse ja miten korjaan sen?\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 17, in <module>\n spiral_order([[4], [1]])\n ~~~~~~~~~~~~^^^^^^^^^^^^\n File \"solut...
{ "kind": "code.debug.arith_flip.spiral", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 10, "entry": "spiral_order", "checked_by": "buggy code fails on [[[4], [1]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "38f2...
codedebug-train-000250
[ { "role": "user", "content": "My solution gives the wrong answer: `max_value([6], [7], 9)` should be `7`, I get `0`. What's wrong?\n\nTask: Item i weighs `weights[i]` and is worth `values[i]` (all positive integers). Return the largest total value whose total weight is at most `capacity`; each item can be t...
{ "kind": "code.debug.arith_flip.knapsack", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 3, "entry": "max_value", "checked_by": "buggy code fails on [[6], [7], 9]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "bbd6816492...
codedebug-train-000251
[ { "role": "user", "content": "Ratkaisuni antaa väärän vastauksen: `max_histogram_area([5])` pitäisi olla `5`, saan `0`. Mikä on vialla?\n\nTehtävä: `heights[i]` on histogrammin pylvään `i` korkeus; jokainen pylväs on 1 leveä, ja pylväät ovat vierekkäin. Palauta suurimman pylväiden sisään mahtuvan akselien s...
{ "kind": "code.debug.minmax_swap.histogram", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 13, "entry": "max_histogram_area", "checked_by": "buggy code fails on [[5]]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id": "88cfb8...
codedebug-train-000252
[ { "role": "user", "content": "This is supposed to solve the task below, but `schedule(6, [[5, 1]])` returns `[]` instead of `[0, 2, 3, 4, 5, 1]`. Find and fix 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 smalles...
{ "kind": "code.debug.drop_stmt.topo_order", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 8, "entry": "schedule", "checked_by": "buggy code fails on [6, [[5, 1]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "723aad79cf...
codedebug-train-000253
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `subarrays_div_by([-4, 4], 4)` palauttaa `2` eikä `3`. Etsi ja korjaa virhe.\n\nTehtävä: Palauta, montako sellaista listan `nums` epätyhjää yhtenäistä osataulukkoa on, joiden summa on jaollinen luvulla `k` (`k >= 1`). Arvot voiv...
{ "kind": "code.debug.drop_stmt.subarray_count", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 8, "entry": "subarrays_div_by", "checked_by": "buggy code fails on [[-4, 4], 4]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": ...
codedebug-train-000254
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `longest_common_substring('', '')` palauttaa `1` eikä `0`. Etsi ja korjaa virhe.\n\nTehtävä: Palauta pisimmän sellaisen merkkijonon pituus, joka esiintyy yhtenäisenä osajonona sekä jonossa `a` että `b`. Molemmat jonot voivat oll...
{ "kind": "code.debug.init_change.common_sequence", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 2, "entry": "longest_common_substring", "checked_by": "buggy code fails on [\"\", \"\"]...; fix == verified reference (oracle-checked on 20 inputs)", "pr...
codedebug-train-000255
[ { "role": "user", "content": "Running `largest_rectangle([0])` 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 16, in <module>\n largest_rectangle([0])\n ~~~~~~~~~~~~~~~~~^^^^^\n File \"solution.py\", line 12, ...
{ "kind": "code.debug.drop_stmt.histogram", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 12, "entry": "largest_rectangle", "checked_by": "buggy code fails on [[0]]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id": "88cf...
codedebug-train-000256
[ { "role": "user", "content": "My solution gives the wrong answer: `count_big_inversions([3, 2, 1])` should be `1`, I get `2`. What's wrong?\n\nTask: Return the number of index pairs `i < j` with `a[i] > 2 * a[j]`. Values can be negative and the list can have 150,000 elements, so checking every pair is too s...
{ "kind": "code.debug.cmp_flip.inversions", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 11, "entry": "count_big_inversions", "checked_by": "buggy code fails on [[3, 2, 1]]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id": "...
codedebug-train-000257
[ { "role": "user", "content": "Ratkaisuni antaa väärän vastauksen: `longest_palindrome_len('b')` pitäisi olla `1`, saan `0`. Mikä on vialla?\n\nTehtävä: Palauta merkkijonon `s` pisimmän sellaisen osajonon pituus, joka on sama takaperin luettuna. `s` voi olla tuhansia merkkejä pitkä, joten jokaisen osajonon t...
{ "kind": "code.debug.drop_stmt.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": "9...
codedebug-train-000258
[ { "role": "user", "content": "My solution gives the wrong answer: `first_redundant_edge(1, [[0, 0]])` should be `[0, 0]`, I get `[]`. What's wrong?\n\nTask: There are `n` nodes numbered 0..n-1 and a list of undirected edges `[u, v]`. Edges are added one by one in the given order. Return the first edge `[u, ...
{ "kind": "code.debug.cmp_flip.union_find", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 13, "entry": "first_redundant_edge", "checked_by": "buggy code fails on [1, [[0, 0]]]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_id":...
codedebug-train-000259
[ { "role": "user", "content": "This is supposed to solve the task below, but `largest_group(7, [[1, 3]])` returns `1` instead of `2`. Find and fix the bug.\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 ...
{ "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 [7, [[1, 3]]]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_id": "2b...
codedebug-train-000260
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `fewest_to_cancel([[1, 2], [2, 3]])` palauttaa `1` eikä `0`. Etsi ja korjaa virhe.\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äi...
{ "kind": "code.debug.cmp_flip.interval_greedy", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 4, "entry": "fewest_to_cancel", "checked_by": "buggy code fails on [[[1, 2], [2, 3]]]...; fix == verified reference (oracle-checked on 20 inputs)", "problem...
codedebug-train-000261
[ { "role": "user", "content": "Ratkaisuni kaatuu: `longest_common_substring('a', 'bbaba')` pitäisi palauttaa `1`, mutta se nostaa poikkeuksen `IndexError: list index out of range`. Mikä on vialla?\n\nTehtävä: Palauta pisimmän sellaisen merkkijonon pituus, joka esiintyy yhtenäisenä osajonona sekä jonossa `a` ...
{ "kind": "code.debug.arith_flip.common_sequence", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 3, "entry": "longest_common_substring", "checked_by": "buggy code fails on [\"a\", \"bbaba\"]...; fix == verified reference (oracle-checked on 20 inputs)", ...
codedebug-train-000262
[ { "role": "user", "content": "Running `run_length('a')` 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 12, in <module>\n run_length('a')\n ~~~~~~~~~~^^^^^\n File \"solution.py\", line 4, in run_length\n whi...
{ "kind": "code.debug.drop_stmt.rle", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 4, "entry": "run_length", "checked_by": "buggy code fails on [\"a\"]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "29749195abb7", ...
codedebug-train-000263
[ { "role": "user", "content": "This is supposed to solve the task below, but `longest_common_subsequence('cbabbc', 'ac')` returns `1` instead of `2`. Find and fix the bug.\n\nTask: Return the length of the longest common subsequence of `a` and `b` (characters in the same order, not necessarily adjacent). Bot...
{ "kind": "code.debug.minmax_swap.common_sequence", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 6, "entry": "longest_common_subsequence", "checked_by": "buggy code fails on [\"cbabbc\", \"ac\"]...; fix == verified reference (oracle-checked on 20 input...
codedebug-train-000264
[ { "role": "user", "content": "My solution gives the wrong answer: `best_single_trade([1, 2])` should be `1`, I get `0`. What's wrong?\n\nTask: `prices[i]` is the price of a share on day `i`. You may buy once and sell once later (or not trade at all). Return the maximum profit. There can be hundreds of thous...
{ "kind": "code.debug.minmax_swap.stock_profit", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 4, "entry": "best_single_trade", "checked_by": "buggy code fails on [[1, 2]]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "04...
codedebug-train-000265
[ { "role": "user", "content": "This is supposed to solve the task below, but `best_load([5], [10], 5)` returns `0` instead of `10`. Find and fix the bug.\n\nTask: Item i weighs `weights[i]` and is worth `values[i]` (all positive integers). Return the largest total value whose total weight is at most `capacit...
{ "kind": "code.debug.arith_flip.knapsack", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 5, "entry": "best_load", "checked_by": "buggy code fails on [[5], [10], 5]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "ad345a84d...
codedebug-train-000266
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `max_value([5], [34], 6)` palauttaa `-34` eikä `34`. Etsi ja korjaa virhe.\n\nTehtävä: Esine i painaa `weights[i]` ja on arvoltaan `values[i]` (kaikki positiivisia kokonaislukuja). Palauta suurin kokonaisarvo, jonka kokonaispain...
{ "kind": "code.debug.arith_flip.knapsack", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 6, "entry": "max_value", "checked_by": "buggy code fails on [[5], [34], 6]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "ad345a84d...
codedebug-train-000267
[ { "role": "user", "content": "This is supposed to solve the task below, but `rooms_needed([[0, 1]])` returns `0` instead of `1`. Find and fix the bug.\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 n...
{ "kind": "code.debug.minmax_swap.meeting_rooms", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 10, "entry": "rooms_needed", "checked_by": "buggy code fails on [[[0, 1]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "11d...
codedebug-train-000268
[ { "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": 17, "entry": "smallest_topo_order", "checked_by": "buggy code fails on [3, [[1, 2]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id...
codedebug-train-000269
[ { "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ä: Muuta merkkijono `a` merkkijonoksi `b`. Merkin lisääminen maksaa 3, poistaminen 1 ja merkin korvaaminen eri merkillä 3. Palauta pienin kokonaiskustannus.\n\n```pyth...
{ "kind": "code.debug.minmax_swap.edit_distance", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 8, "entry": "edit_cost", "checked_by": "buggy code fails on [\"d\", \"dc\"]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "...
codedebug-train-000270
[ { "role": "user", "content": "Ratkaisuni antaa väärän vastauksen: `max_value([5], [10], 5)` pitäisi olla `10`, saan `0`. Mikä on vialla?\n\nTehtävä: Esine i painaa `weights[i]` ja on arvoltaan `values[i]` (kaikki positiivisia kokonaislukuja). Palauta suurin kokonaisarvo, jonka kokonaispaino on enintään `cap...
{ "kind": "code.debug.off_by_one.knapsack", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 3, "entry": "max_value", "checked_by": "buggy code fails on [[5], [10], 5]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "bbd681649...
codedebug-train-000271
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `best_path([[5], [-9]])` palauttaa `-9` eikä `-4`. Etsi ja korjaa virhe.\n\nTehtävä: Ruudukossa on kokonaislukuja (myös negatiivisia). Palauta suurin mahdollinen polun arvojen summa, kun liikutaan vasemmasta yläkulmasta oikeaan ...
{ "kind": "code.debug.bool_flip.grid_paths", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 6, "entry": "best_path", "checked_by": "buggy code fails on [[[5], [-9]]]...; fix == verified reference (oracle-checked on 17 inputs)", "problem_id": "88866def7...
codedebug-train-000272
[ { "role": "user", "content": "This is supposed to solve the task below, but `palindromic_substrings('a')` returns `0` instead of `1`. Find and fix the bug.\n\nTask: Return how many non-empty substrings of `s` (counted by position) read the same backwards. `s` can be several thousand characters long, so chec...
{ "kind": "code.debug.cmp_flip.palindromes", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 5, "entry": "palindromic_substrings", "checked_by": "buggy code fails on [\"a\"]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_id": "d8...
codedebug-train-000273
[ { "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.drop_stmt.prefix_counter", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 9, "entry": "WordIndex", "checked_by": "buggy code fails on {\"init\": [], \"ops\": [[\"insert\", \"abc\"], [\"starts_with\", \"abc...; fix == verified refere...
codedebug-train-000274
[ { "role": "user", "content": "My solution gives the wrong answer: `min_coins([12], 12)` should be `1`, I get `-1`. What's wrong?\n\nTask: Given distinct positive coin values (unlimited supply of each) and an amount, return the fewest coins that add up to exactly the amount, or -1 if it cannot be made. An am...
{ "kind": "code.debug.cmp_flip.coin_change", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 6, "entry": "min_coins", "checked_by": "buggy code fails on [[12], 12]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "9d7f7ca67fff...
codedebug-train-000275
[ { "role": "user", "content": "I get an exception for `max_path_sum([[-9, -9], [1, 8]])`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 18, in <module>\n max_path_sum([[-9, -9], [1, 8]])\n ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^\n File \"solution.py\", line 13, in max_path_sum\n ...
{ "kind": "code.debug.arith_flip.grid_paths", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 13, "entry": "max_path_sum", "checked_by": "buggy code fails on [[[-9, -9], [1, 8]]]...; fix == verified reference (oracle-checked on 17 inputs)", "proble...
codedebug-train-000276
[ { "role": "user", "content": "This is supposed to solve the task below, but `window_minima([5, -2, -9, 9], 4)` returns `[9]` instead of `[-9]`. Find and fix the bug.\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 element...
{ "kind": "code.debug.index_swap.window_extreme", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 14, "entry": "window_minima", "checked_by": "buggy code fails on [[5, -2, -9, 9], 4]...; fix == verified reference (oracle-checked on 19 inputs)", "problem...
codedebug-train-000277
[ { "role": "user", "content": "Ratkaisuni antaa väärän vastauksen: `all_distances(2, [], 0)` pitäisi olla `[0, -1]`, saan `[-1, -1]`. Mikä on vialla?\n\nTehtävä: Suunnatussa verkossa on `n` solmua (0..n-1) ja kaaret `[u, v, w]` solmusta `u` solmuun `v` painolla `w >= 1`. Palauta lista, jossa on lyhimmän polu...
{ "kind": "code.debug.cmp_flip.dijkstra", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 12, "entry": "all_distances", "checked_by": "buggy code fails on [2, [], 0]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "22d6698072...
codedebug-train-000278
[ { "role": "user", "content": "This is supposed to solve the task below, but `robot_max_distance([4], [[0, 2]])` returns `0` instead of `1`. Find and fix 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 ...
{ "kind": "code.debug.drop_stmt.robot_walk", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 15, "entry": "robot_max_distance", "checked_by": "buggy code fails on [[4], [[0, 2]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id"...
codedebug-train-000279
[ { "role": "user", "content": "Saan poikkeuksen kutsulla `longest_k_distinct('c', 0)`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 18, in <module>\n longest_k_distinct('c', 0)\n ~~~~~~~~~~~~~~~~~~^^^^^^^^\n File \"solution.py\", line 10, in longest_k_distinct\n left = s...
{ "kind": "code.debug.drop_stmt.longest_window", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 11, "entry": "longest_k_distinct", "checked_by": "buggy code fails on [\"c\", 0]...; fix == verified reference (oracle-checked on 20 inputs)", "problem...
codedebug-train-000280
[ { "role": "user", "content": "Please review this solution: there is a bug somewhere. Find it, show an input that fails, and fix it.\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-aligned rectangle that fits ...
{ "kind": "code.debug.drop_stmt.histogram", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 8, "entry": "max_histogram_area", "checked_by": "buggy code fails on [[3, 5]]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id": "88cf...
codedebug-train-000281
[ { "role": "user", "content": "Here is my solution. Something is wrong but I can't see it. Can you find the bug?\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.\n\n```python\nfrom collect...
{ "kind": "code.debug.arith_flip.longest_window", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 15, "entry": "longest_with_k_kinds", "checked_by": "buggy code fails on [\"d\", 0]...; fix == verified reference (oracle-checked on 20 inputs)", "problem...
codedebug-train-000282
[ { "role": "user", "content": "Ratkaisuni antaa väärän vastauksen: `num_islands(['11000'])` pitäisi olla `1`, saan `0`. Mikä on vialla?\n\nTehtävä: Ruudukko on lista yhtä pitkiä merkkijonoja, joissa '1' on maata ja '0' vettä. Kaksi maaruutua kuuluu samaan saareen, kun ne ovat vierekkäin vaaka-, pysty- tai vi...
{ "kind": "code.debug.drop_stmt.count_islands", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 12, "entry": "num_islands", "checked_by": "buggy code fails on [[\"11000\"]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "75d...
codedebug-train-000283
[ { "role": "user", "content": "Ratkaisuni antaa väärän vastauksen: `merge_intervals([[1, 3], [3, 5]])` pitäisi olla `[[1, 5]]`, saan `[[1, 3]]`. Mikä on vialla?\n\nTehtävä: Saat listan välejä `[start, end]`, joissa `start < end`, satunnaisessa järjestyksessä. Yhdistä jokainen joukko välejä, jotka menevät pää...
{ "kind": "code.debug.minmax_swap.merge_intervals", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 9, "entry": "merge_intervals", "checked_by": "buggy code fails on [[[1, 3], [3, 5]]]...; fix == verified reference (oracle-checked on 19 inputs)", "probl...
codedebug-train-000284
[ { "role": "user", "content": "Here is my solution. Something is wrong but I can't see it. Can you find the bug?\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 longest_distinct_substring(s:...
{ "kind": "code.debug.arith_flip.longest_window", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 6, "entry": "longest_distinct_substring", "checked_by": "buggy code fails on [\"bb\"]...; fix == verified reference (oracle-checked on 20 inputs)", "prob...
codedebug-train-000285
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `merge([[1, 4], [1, 2], [1, 3]])` palauttaa `[[1, 2]]` eikä `[[1, 4]]`. Etsi ja korjaa virhe.\n\nTehtävä: Saat listan välejä `[start, end]`, joissa `start < end`, satunnaisessa järjestyksessä. Yhdistä jokainen joukko välejä, jot...
{ "kind": "code.debug.minmax_swap.merge_intervals", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 9, "entry": "merge", "checked_by": "buggy code fails on [[[1, 4], [1, 2], [1, 3]]]...; fix == verified reference (oracle-checked on 19 inputs)", "problem...
codedebug-train-000286
[ { "role": "user", "content": "My solution gives the wrong answer: `max_path_sum([[-1, -8], [5, 3]])` should be `7`, I get `-6`. What's wrong?\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 largest possibl...
{ "kind": "code.debug.cmp_flip.grid_paths", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 10, "entry": "max_path_sum", "checked_by": "buggy code fails on [[[-1, -8], [5, 3]]]...; fix == verified reference (oracle-checked on 17 inputs)", "problem_id": ...
codedebug-train-000287
[ { "role": "user", "content": "My solution gives the wrong answer: `sliding_max([0, -6, 0], 1)` should be `[0, -6, 0]`, I get `[0, 0, 0]`. What's wrong?\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...
{ "kind": "code.debug.index_swap.window_extreme", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 10, "entry": "sliding_max", "checked_by": "buggy code fails on [[0, -6, 0], 1]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": ...
codedebug-train-000288
[ { "role": "user", "content": "Kun ajan `reverse_pairs([1])`, ohjelma kaatuu tällä virheilmoituksella. Mistä on kyse ja miten korjaan sen?\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 19, in <module>\n reverse_pairs([1])\n ~~~~~~~~~~~~~^^^^^\n File \"solution.py\", line 16,...
{ "kind": "code.debug.cmp_flip.inversions", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 3, "entry": "reverse_pairs", "checked_by": "buggy code fails on [[1]]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id": "ee3155a92...
codedebug-train-000289
[ { "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 smallest number of words from `words` that concatenate to exactly `s` (each word can be used any number of times), or -1 if it is impossible. The empty stri...
{ "kind": "code.debug.arith_flip.word_break", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 8, "entry": "fewest_words", "checked_by": "buggy code fails on [\"bababa\", [\"ba\"]]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_...
codedebug-train-000290
[ { "role": "user", "content": "Tässä ratkaisuni. Jokin on vialla, mutta en näe mikä. Löydätkö virheen?\n\nTehtävä: Suunnatussa verkossa on `n` solmua (0..n-1) ja kaaret `[u, v, w]` solmusta `u` solmuun `v` painolla `w >= 1`. Palauta lyhimmän polun pituus solmusta `src` solmuun `dst`, tai -1, jos sinne ei pää...
{ "kind": "code.debug.cmp_flip.dijkstra", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 15, "entry": "shortest_path_cost", "checked_by": "buggy code fails on [2, [[0, 1, 9]], 0, 1]...; fix == verified reference (oracle-checked on 20 inputs)", "probl...
codedebug-train-000291
[ { "role": "user", "content": "My solution crashes: `window_maxima([5], 1)` should return `[5]`, but it raises `IndexError: list index out of range`. What is wrong?\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, ...
{ "kind": "code.debug.drop_stmt.window_extreme", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 8, "entry": "window_maxima", "checked_by": "buggy code fails on [[5], 1]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "c24ff9...
codedebug-train-000292
[ { "role": "user", "content": "I get an exception for `transform_cost('cddab', 'b')`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 13, in <module>\n transform_cost('cddab', 'b')\n ~~~~~~~~~~~~~~^^^^^^^^^^^^^^\n File \"solution.py\", line 7, in transform_cost\n keep = pre...
{ "kind": "code.debug.arith_flip.edit_distance", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 7, "entry": "transform_cost", "checked_by": "buggy code fails on [\"cddab\", \"b\"]...; fix == verified reference (oracle-checked on 18 inputs)", "prob...
codedebug-train-000293
[ { "role": "user", "content": "Here is my solution. Something is wrong but I can't see it. Can you find 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-aligned square that fits inside the bars. There ...
{ "kind": "code.debug.minmax_swap.histogram", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 13, "entry": "max_square_area", "checked_by": "buggy code fails on [[2]]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id": "cd7bb6a...
codedebug-train-000294
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `can_segment('c', ['c'])` palauttaa `False` eikä `True`. Etsi ja korjaa virhe.\n\nTehtävä: Palauta True, jos `s` voidaan jakaa yhden tai useamman listan `words` sanan jonoksi (jokaista sanaa saa käyttää kuinka monesti tahansa), ...
{ "kind": "code.debug.bool_flip.word_break", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 11, "entry": "can_segment", "checked_by": "buggy code fails on [\"c\", [\"c\"]]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_id": "b1a...
codedebug-train-000295
[ { "role": "user", "content": "Kun ajan `max_value([5], [7], 7)`, ohjelma kaatuu tällä virheilmoituksella. Mistä on kyse ja miten korjaan sen?\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 10, in <module>\n max_value([5], [7], 7)\n ~~~~~~~~~^^^^^^^^^^^^^\n File \"solution.py...
{ "kind": "code.debug.arith_flip.knapsack", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 5, "entry": "max_value", "checked_by": "buggy code fails on [[5], [7], 7]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "bbd68...
codedebug-train-000296
[ { "role": "user", "content": "Please review this solution: there is a bug somewhere. Find it, show an input that fails, and fix it.\n\nTask: `s` contains only lowercase letters. Replace each run of equal letters with the letter and the run length (a run of length 1 is written as just the letter). Example: '...
{ "kind": "code.debug.arith_flip.rle", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 7, "entry": "rle_encode", "checked_by": "buggy code fails on [\"abc\"]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "29749195abb7", ...
codedebug-train-000297
[ { "role": "user", "content": "My solution gives the wrong answer: `longest_palindromic_substring('a')` 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 [\"a\"]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_i...
codedebug-train-000298
[ { "role": "user", "content": "My solution gives the wrong answer: `merge([[2, 3], [5, 9]])` should be `[[2, 3], [5, 9]]`, I get `[[5, 9]]`. What's wrong?\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 ...
{ "kind": "code.debug.index_swap.merge_intervals", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 5, "entry": "merge", "checked_by": "buggy code fails on [[[2, 3], [5, 9]]]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "62...
codedebug-train-000299
[ { "role": "user", "content": "Please review this solution: there is a bug somewhere. Find it, show an input that fails, and fix it.\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 `dst`, or -1 if `dst` cannot be r...
{ "kind": "code.debug.cmp_flip.cheapest_path", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 15, "entry": "cheapest_price", "checked_by": "buggy code fails on [3, [[0, 1, 5]], 0, 0, 0]...; fix == verified reference (oracle-checked on 19 inputs)", "p...