id
stringlengths
22
22
messages
listlengths
2
2
meta
dict
codedebug-train-000900
[ { "role": "user", "content": "My solution gives the wrong answer: `spiral([[1]])` should be `[1]`, I get `[]`. What's wrong?\n\nTask: Return all elements of the `rows × cols` matrix in spiral order, starting at the top-left corner and going clockwise (right along the top row first), ending at the centre.\n\...
{ "kind": "code.debug.off_by_one.spiral", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 7, "entry": "spiral", "checked_by": "buggy code fails on [[[1]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "38f2502ba7af", "pro...
codedebug-train-000901
[ { "role": "user", "content": "My solution gives the wrong answer: `count_islands(['1', '1'])` should be `1`, I get `0`. What's wrong?\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, ver...
{ "kind": "code.debug.drop_stmt.count_islands", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 12, "entry": "count_islands", "checked_by": "buggy code fails on [[\"1\", \"1\"]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id":...
codedebug-train-000902
[ { "role": "user", "content": "This is supposed to solve the task below, but `obj = RangeSum([-9, -7, -8, 0]); obj.update(0, -1); obj.query(2, 3)` returns `-24` instead of `-8`. Find and fix the bug.\n\nTask: Implement `RangeSum(nums)` with `update(index, value)`, which sets `nums[index] = value`, and `query...
{ "kind": "code.debug.cmp_flip.range_sum", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 23, "entry": "RangeSum", "checked_by": "buggy code fails on {\"init\": [[-9, -7, -8, 0]], \"ops\": [[\"update\", 0, -1], [\"que...; fix == verified reference (oracl...
codedebug-train-000903
[ { "role": "user", "content": "This is supposed to solve the task below, but `longest_palindrome_len('')` returns `1` instead of `0`. 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.init_change.palindromes", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 2, "entry": "longest_palindrome_len", "checked_by": "buggy code fails on [\"\"]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_id": "...
codedebug-train-000904
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `robot_max_distance([4], [[0, 2]])` palauttaa `26` 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) liik...
{ "kind": "code.debug.init_change.robot_walk", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "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_id...
codedebug-train-000905
[ { "role": "user", "content": "This is supposed to solve the task below, but `max_path_sum([[9], [-8]])` returns `-8` instead of `1`. 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 la...
{ "kind": "code.debug.cmp_flip.grid_paths", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 6, "entry": "max_path_sum", "checked_by": "buggy code fails on [[[9], [-8]]]...; fix == verified reference (oracle-checked on 17 inputs)", "problem_id": "88866de...
codedebug-train-000906
[ { "role": "user", "content": "Running `islands(['101'])` 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 24, in <module>\n islands(['101'])\n ~~~~~~~^^^^^^^^^\n File \"solution.py\", line 18, in islands\n if...
{ "kind": "code.debug.drop_stmt.count_islands", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 18, "entry": "islands", "checked_by": "buggy code fails on [[\"101\"]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "cdd4...
codedebug-train-000907
[ { "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]`. Return the cheapest total price from `src` to `dst` using at most `k` intermediate stops (so at most...
{ "kind": "code.debug.init_change.cheapest_path", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 4, "entry": "cheapest_route", "checked_by": "buggy code fails on [3, [[0, 1, 5]], 0, 0, 0]...; fix == verified reference (oracle-checked on 19 inputs)", ...
codedebug-train-000908
[ { "role": "user", "content": "Running `longest_common_substring('ab', 'cab')` 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 longest_common_substring('ab', 'cab')\n ~~~~~~~~~~~~~~~~~~~~~~~~^^^...
{ "kind": "code.debug.arith_flip.common_sequence", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 8, "entry": "longest_common_substring", "checked_by": "buggy code fails on [\"ab\", \"cab\"]...; fix == verified reference (oracle-checked on 20 inputs...
codedebug-train-000909
[ { "role": "user", "content": "This is supposed to solve the task below, but `window_minima([5], 1)` returns `[]` instead of `[5]`. 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 elements, from left ...
{ "kind": "code.debug.cmp_flip.window_extreme", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 9, "entry": "window_minima", "checked_by": "buggy code fails on [[5], 1]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "3d3c27e...
codedebug-train-000910
[ { "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ä: Toteuta `RangeSum(nums)`, jossa `update(index, value)` asettaa `nums[index] = value` ja `query(left, right)` palauttaa summan `nums[left..right]` (molemmat päät muk...
{ "kind": "code.debug.arith_flip.range_sum", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 17, "entry": "RangeSum", "checked_by": "buggy code fails on {\"init\": [[1, 2, 3]], \"ops\": [[\"update\", 1, 2], [\"query\", 0,...; fix == verified reference (...
codedebug-train-000911
[ { "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 smallest value in every window of `k` consecutive elements, from left to right. The list can have hundreds of t...
{ "kind": "code.debug.cmp_flip.window_extreme", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 9, "entry": "sliding_min", "checked_by": "buggy code fails on [[9], 1]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "3d3c27e...
codedebug-train-000912
[ { "role": "user", "content": "Here is my solution. Something is wrong but I can't see it. Can you find the bug?\n\nTask: Return all elements of the `rows × cols` matrix in spiral order, starting at the top-left corner and going clockwise (right along the top row first), ending at the centre.\n\n```python\nd...
{ "kind": "code.debug.arith_flip.spiral", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 13, "entry": "spiral", "checked_by": "buggy code fails on [[[8], [1], [8]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "38f2502b...
codedebug-train-000913
[ { "role": "user", "content": "This is supposed to solve the task below, but `max_profit_with_fee([6, 10], 1)` returns `0` instead of `3`. Find and fix the bug.\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 a...
{ "kind": "code.debug.minmax_swap.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 [[6, 10], 1]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id...
codedebug-train-000914
[ { "role": "user", "content": "Running `eval_expression('4')` 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 52, in <module>\n eval_expression('4')\n ~~~~~~~~~~~~~~~^^^^^\n File \"solution.py\", line 19, in eva...
{ "kind": "code.debug.drop_stmt.expr_eval", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 19, "entry": "eval_expression", "checked_by": "buggy code fails on [\"4\"]...; fix == verified reference (oracle-checked on 22 inputs)", "problem_id": "ba1b...
codedebug-train-000915
[ { "role": "user", "content": "Saan poikkeuksen kutsulla `max_square_area([])`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 14, in <module>\n max_square_area([])\n ~~~~~~~~~~~~~~~^^^^\n File \"solution.py\", line 4, in max_square_area\n for i, h in enumerate(heights - [...
{ "kind": "code.debug.arith_flip.histogram", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 4, "entry": "max_square_area", "checked_by": "buggy code fails on [[]]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id": "d87fffc...
codedebug-train-000916
[ { "role": "user", "content": "Ratkaisuni antaa väärän vastauksen: `min_meeting_rooms([[0, 1]])` pitäisi olla `1`, saan `0`. Mikä on vialla?\n\nTehtävä: Jokainen kokous on `[start, end)`: se varaa huoneen hetkestä `start` hetkeen `end` asti, mutta ei hetkeä `end`. Palauta pienin määrä huoneita, jotta kaksi k...
{ "kind": "code.debug.drop_stmt.meeting_rooms", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 4, "entry": "min_meeting_rooms", "checked_by": "buggy code fails on [[[0, 1]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "1...
codedebug-train-000917
[ { "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 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 tarkist...
{ "kind": "code.debug.arith_flip.inversions", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 8, "entry": "inversion_count", "checked_by": "buggy code fails on [[3, 2, 1]]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id": "ee...
codedebug-train-000918
[ { "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 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,0...
{ "kind": "code.debug.off_by_one.coin_change", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 5, "entry": "coin_combinations", "checked_by": "buggy code fails on [[3, 7], 14]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id":...
codedebug-train-000919
[ { "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ä: `s` sisältää vain pieniä kirjaimia. Korvaa jokainen samojen kirjainten jakso kirjaimella ja jakson pituudella (pituuden 1 jakso kirjoitetaan pelkkänä kirjaimena). E...
{ "kind": "code.debug.drop_stmt.rle", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 7, "entry": "run_length", "checked_by": "buggy code fails on [\"b\"]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "29749195abb7", "p...
codedebug-train-000920
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `max_profit_with_fee([7, 2], 2)` palauttaa `7` eikä `0`. 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 kerrall...
{ "kind": "code.debug.arith_flip.stock_profit", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 4, "entry": "max_profit_with_fee", "checked_by": "buggy code fails on [[7, 2], 2]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id":...
codedebug-train-000921
[ { "role": "user", "content": "I get an exception for `eval_expression('(1)')`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 53, in <module>\n eval_expression('(1)')\n ~~~~~~~~~~~~~~~^^^^^^^\n File \"solution.py\", line 34, in eval_expression\n apply()\n ~~~~~^^\n Fi...
{ "kind": "code.debug.cmp_flip.expr_eval", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 33, "entry": "eval_expression", "checked_by": "buggy code fails on [\"(1)\"]...; fix == verified reference (oracle-checked on 22 inputs)", "problem_id": "ba1...
codedebug-train-000922
[ { "role": "user", "content": "Running `spiral_order([[6, 4, 4]])` 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 17, in <module>\n spiral_order([[6, 4, 4]])\n ~~~~~~~~~~~~^^^^^^^^^^^^^\n File \"solution.py\", ...
{ "kind": "code.debug.arith_flip.spiral", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 12, "entry": "spiral_order", "checked_by": "buggy code fails on [[[6, 4, 4]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "38f...
codedebug-train-000923
[ { "role": "user", "content": "I get an exception for `max_square_area([5])`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 16, in <module>\n max_square_area([5])\n ~~~~~~~~~~~~~~~^^^^^\n File \"solution.py\", line 12, in max_square_area\n best = max(best, min(height, wid...
{ "kind": "code.debug.drop_stmt.histogram", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 12, "entry": "max_square_area", "checked_by": "buggy code fails on [[5]]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id": "cd7bb6...
codedebug-train-000924
[ { "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 2, poistaminen 1 ja merkin korvaaminen eri merkillä 4. Palauta pienin kokonaiskustannus.\n\n```pyth...
{ "kind": "code.debug.drop_stmt.edit_distance", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 7, "entry": "transform_cost", "checked_by": "buggy code fails on [\"a\", \"bcb\"]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id...
codedebug-train-000925
[ { "role": "user", "content": "My solution gives the wrong answer: `weighted_edit_distance('ad', 'c')` should be `3`, I get `2`. What's wrong?\n\nTask: Turn string `a` into string `b`. Inserting a character costs 1, deleting one costs 2, and replacing one character with a different one costs 1. Return the mi...
{ "kind": "code.debug.cmp_flip.edit_distance", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 7, "entry": "weighted_edit_distance", "checked_by": "buggy code fails on [\"ad\", \"c\"]...; fix == verified reference (oracle-checked on 18 inputs)", "proble...
codedebug-train-000926
[ { "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": 40, "entry": "evaluate", "checked_by": "buggy code fails on [\"7 / -2\"]...; fix == verified reference (oracle-checked on 22 inputs)", "problem_id": "ba1b3f285f...
codedebug-train-000927
[ { "role": "user", "content": "My solution gives the wrong answer: `evaluate('-3 * (2 + 4)')` should be `-18`, I get `6`. 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.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 [\"-3 * (2 + 4)\"]...; fix == verified reference (oracle-checked on 22 inputs)", "problem_id": "ba1b...
codedebug-train-000928
[ { "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.arith_flip.histogram", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 4, "entry": "largest_rectangle", "checked_by": "buggy code fails on [[]]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id": "b594cfa6...
codedebug-train-000929
[ { "role": "user", "content": "This is supposed to solve the task below, but `spiral_order([[1]])` returns `[1, 1]` instead of `[1]`. Find and fix the bug.\n\nTask: Return all elements of the `rows × cols` matrix in spiral order, starting at the top-left corner and going clockwise (right along the top row fi...
{ "kind": "code.debug.off_by_one.spiral", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 8, "entry": "spiral_order", "checked_by": "buggy code fails on [[[1]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "38f2502ba7af", ...
codedebug-train-000930
[ { "role": "user", "content": "Here is my solution. Something is wrong but I can't see it. Can you find the bug?\n\nTask: Turn string `a` into string `b`. Inserting a character costs 2, deleting one costs 3, and replacing one character with a different one costs 2. Return the minimum total cost.\n\n```python...
{ "kind": "code.debug.drop_stmt.edit_distance", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 9, "entry": "transform_cost", "checked_by": "buggy code fails on [\"bc\", \"\"]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id":...
codedebug-train-000931
[ { "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.drop_stmt.histogram", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 9, "entry": "max_square_area", "checked_by": "buggy code fails on [[5, 2, 4, 5, 0]]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id":...
codedebug-train-000932
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `merge_intervals([[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...
{ "kind": "code.debug.minmax_swap.merge_intervals", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 6, "entry": "merge_intervals", "checked_by": "buggy code fails on [[[1, 4], [1, 2], [1, 3]]]...; fix == verified reference (oracle-checked on 19 inputs)", ...
codedebug-train-000933
[ { "role": "user", "content": "Running `eval_expression('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 53, in <module>\n eval_expression('2')\n ~~~~~~~~~~~~~~~^^^^^\n File \"solution.py\", line 25, in eva...
{ "kind": "code.debug.bool_flip.expr_eval", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 25, "entry": "eval_expression", "checked_by": "buggy code fails on [\"2\"]...; fix == verified reference (oracle-checked on 22 inputs)", "problem_id": "ba1b...
codedebug-train-000934
[ { "role": "user", "content": "Here is my solution. Something is wrong but I can't see it. Can you find the bug?\n\nTask: Return all elements of the `rows × cols` matrix in spiral order, starting at the top-left corner and going clockwise (right along the top row first), ending at the centre.\n\n```python\nd...
{ "kind": "code.debug.off_by_one.spiral", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 7, "entry": "spiral_order", "checked_by": "buggy code fails on [[[3]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "38f2502ba7af"...
codedebug-train-000935
[ { "role": "user", "content": "This is supposed to solve the task below, but `fewest_words('a', [])` returns `0` instead of `-1`. 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 it is impossi...
{ "kind": "code.debug.index_swap.word_break", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 7, "entry": "fewest_words", "checked_by": "buggy code fails on [\"a\", []]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_id": "80e4a77...
codedebug-train-000936
[ { "role": "user", "content": "Kun ajan `sliding_min([6], 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 15, in <module>\n sliding_min([6], 1)\n ~~~~~~~~~~~^^^^^^^^\n File \"solution.py\", line ...
{ "kind": "code.debug.drop_stmt.window_extreme", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 8, "entry": "sliding_min", "checked_by": "buggy code fails on [[6], 1]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "3d3...
codedebug-train-000937
[ { "role": "user", "content": "Running `transform_cost('', 'ab')` 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 transform_cost('', 'ab')\n ~~~~~~~~~~~~~~^^^^^^^^^^\n File \"solution.py\", lin...
{ "kind": "code.debug.off_by_one.edit_distance", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 4, "entry": "transform_cost", "checked_by": "buggy code fails on [\"\", \"ab\"]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_...
codedebug-train-000938
[ { "role": "user", "content": "Saan poikkeuksen kutsulla `islands(['10101'])`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 24, in <module>\n islands(['10101'])\n ~~~~~~~^^^^^^^^^^^\n File \"solution.py\", line 18, in islands\n if 0 <= ny < rows and 0 <= nx < cols and gr...
{ "kind": "code.debug.drop_stmt.count_islands", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 18, "entry": "islands", "checked_by": "buggy code fails on [[\"10101\"]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "49...
codedebug-train-000939
[ { "role": "user", "content": "My solution gives the wrong answer: `islands(['1'])` should be `1`, I get `0`. What's wrong?\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, vertically or ...
{ "kind": "code.debug.drop_stmt.count_islands", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 12, "entry": "islands", "checked_by": "buggy code fails on [[\"1\"]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "49595087dec...
codedebug-train-000940
[ { "role": "user", "content": "My solution gives the wrong answer: `walk([4], [[0, 2]])` should be `1`, I get `0`. 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) moves forward k unit steps. If the next square is an obstacle, th...
{ "kind": "code.debug.arith_flip.robot_walk", "lang": "en", "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": "ed0035dc3a...
codedebug-train-000941
[ { "role": "user", "content": "Ratkaisuni antaa väärän vastauksen: `largest_square([1, 5, 7])` pitäisi olla `4`, saan `16`. 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 akselie...
{ "kind": "code.debug.arith_flip.histogram", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 7, "entry": "largest_square", "checked_by": "buggy code fails on [[1, 5, 7]]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id": "d87fff...
codedebug-train-000942
[ { "role": "user", "content": "Ratkaisuni antaa väärän vastauksen: `segment_ways('aaaa', ['a', 'aa'])` pitäisi olla `5`, saan `1`. Mikä on vialla?\n\nTehtävä: Palauta, kuinka monella eri tavalla `s` voidaan jakaa listan `words` sanoiksi (jokaista sanaa saa käyttää kuinka monesti tahansa), modulo 1 000 000 00...
{ "kind": "code.debug.minmax_swap.word_break", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 4, "entry": "segment_ways", "checked_by": "buggy code fails on [\"aaaa\", [\"a\", \"aa\"]]...; fix == verified reference (oracle-checked on 20 inputs)", "prob...
codedebug-train-000943
[ { "role": "user", "content": "This is supposed to solve the task below, but `inversion_count([3, 2, 1])` returns `1` instead of `3`. 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.arith_flip.inversions", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 8, "entry": "inversion_count", "checked_by": "buggy code fails on [[3, 2, 1]]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id": "ee7e...
codedebug-train-000944
[ { "role": "user", "content": "I get an exception for `eval_expression('0')`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 55, in <module>\n eval_expression('0')\n ~~~~~~~~~~~~~~~^^^^^\n File \"solution.py\", line 4, in eval_expression\n if ch.isdigit():\n ^^\nName...
{ "kind": "code.debug.drop_stmt.expr_eval", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 4, "entry": "eval_expression", "checked_by": "buggy code fails on [\"0\"]...; fix == verified reference (oracle-checked on 22 inputs)", "problem_id": "2918d...
codedebug-train-000945
[ { "role": "user", "content": "My solution crashes: `edit_cost('c', 'bd')` should return `4`, but it raises `IndexError: string index out of range`. What is wrong?\n\nTask: Turn string `a` into string `b`. Inserting a character costs 2, deleting one costs 1, and replacing one character with a different one c...
{ "kind": "code.debug.arith_flip.edit_distance", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 7, "entry": "edit_cost", "checked_by": "buggy code fails on [\"c\", \"bd\"]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "1bb...
codedebug-train-000946
[ { "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, kuinka monella eri tavalla `s` voidaan jakaa listan `words` sanoiksi (jokaista sanaa saa käyttää kuinka monesti tahansa), modulo 1 000 000 007. Tyhjällä jo...
{ "kind": "code.debug.arith_flip.word_break", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 12, "entry": "count_segmentations", "checked_by": "buggy code fails on [\"bbbbbbb\", [\"b\"]]...; fix == verified reference (oracle-checked on 20 inputs)", "...
codedebug-train-000947
[ { "role": "user", "content": "Running `weighted_edit_distance('dd', 'b')` 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 weighted_edit_distance('dd', 'b')\n ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^\n...
{ "kind": "code.debug.drop_stmt.edit_distance", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 5, "entry": "weighted_edit_distance", "checked_by": "buggy code fails on [\"dd\", \"b\"]...; fix == verified reference (oracle-checked on 18 inputs)", "...
codedebug-train-000948
[ { "role": "user", "content": "This is supposed to solve the task below, but `longest_with_k_kinds('bd', 3)` returns `0` instead of `2`. Find and fix 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 ...
{ "kind": "code.debug.drop_stmt.longest_window", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 15, "entry": "longest_with_k_kinds", "checked_by": "buggy code fails on [\"bd\", 3]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_i...
codedebug-train-000949
[ { "role": "user", "content": "Ratkaisuni antaa väärän vastauksen: `segment_ways('ca', ['a', 'ca'])` pitäisi olla `1`, saan `0`. Mikä on vialla?\n\nTehtävä: Palauta, kuinka monella eri tavalla `s` voidaan jakaa listan `words` sanoiksi (jokaista sanaa saa käyttää kuinka monesti tahansa), modulo 1 000 000 007....
{ "kind": "code.debug.arith_flip.word_break", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 9, "entry": "segment_ways", "checked_by": "buggy code fails on [\"ca\", [\"a\", \"ca\"]]...; fix == verified reference (oracle-checked on 20 inputs)", "problem...
codedebug-train-000950
[ { "role": "user", "content": "This is supposed to solve the task below, but `spiral_order([[3]])` returns `[]` instead of `[3]`. Find and fix the bug.\n\nTask: Return all elements of the `rows × cols` matrix in spiral order, starting at the top-left corner and going counter-clockwise (down the left column f...
{ "kind": "code.debug.cmp_flip.spiral", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 6, "entry": "spiral_order", "checked_by": "buggy code fails on [[[3]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "af4362bd16a8", ...
codedebug-train-000951
[ { "role": "user", "content": "My solution gives the wrong answer: `spiral([[1]])` should be `[1]`, I get `[]`. What's wrong?\n\nTask: Return all elements of the `rows × cols` matrix in spiral order, starting at the top-left corner and going counter-clockwise (down the left column first), ending at the centr...
{ "kind": "code.debug.off_by_one.spiral", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 7, "entry": "spiral", "checked_by": "buggy code fails on [[[1]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "af4362bd16a8", "pro...
codedebug-train-000952
[ { "role": "user", "content": "This is supposed to solve the task below, but `obj = PointUpdateSums([-3, 4, 9]); obj.update(0, 5); obj.query(0, 1)` returns `0` instead of `9`. Find and fix the bug.\n\nTask: Implement `PointUpdateSums(nums)` with `update(index, value)`, which sets `nums[index] = value`, and `...
{ "kind": "code.debug.drop_stmt.range_sum", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 30, "entry": "PointUpdateSums", "checked_by": "buggy code fails on {\"init\": [[-3, 4, 9]], \"ops\": [[\"update\", 0, 5], [\"query\", 0...; fix == verified referen...
codedebug-train-000953
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `max_histogram_area([6])` palauttaa `0` eikä `6`. Etsi ja korjaa virhe.\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 mah...
{ "kind": "code.debug.drop_stmt.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 [[6]]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id": "88cfb8e3...
codedebug-train-000954
[ { "role": "user", "content": "My solution gives the wrong answer: `num_islands(['1'])` should be `1`, I get `0`. What's wrong?\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, vertically...
{ "kind": "code.debug.cmp_flip.count_islands", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 10, "entry": "num_islands", "checked_by": "buggy code fails on [[\"1\"]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "75d0deff...
codedebug-train-000955
[ { "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 pienin määrä listan `words` sanoja, jotka peräkkäin muodostavat täsmälleen jonon `s` (jokaista sanaa saa käyttää kuinka monesti tahansa), tai -1, jos se on ...
{ "kind": "code.debug.minmax_swap.word_break", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 4, "entry": "min_word_split", "checked_by": "buggy code fails on [\"aaaa\", [\"a\", \"aa\"]]...; fix == verified reference (oracle-checked on 20 inputs)", "...
codedebug-train-000956
[ { "role": "user", "content": "Ratkaisuni antaa väärän vastauksen: `edit_cost('db', 'badb')` pitäisi olla `2`, saan `0`. Mikä on vialla?\n\nTehtävä: Muuta merkkijono `a` merkkijonoksi `b`. Merkin lisääminen maksaa 1, poistaminen 3 ja merkin korvaaminen eri merkillä 1. Palauta pienin kokonaiskustannus.\n\n```...
{ "kind": "code.debug.drop_stmt.edit_distance", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 8, "entry": "edit_cost", "checked_by": "buggy code fails on [\"db\", \"badb\"]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "b...
codedebug-train-000957
[ { "role": "user", "content": "Here is my solution. Something is wrong but I can't see it. Can you find the bug?\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, vertically or diagonally....
{ "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 [[\"11\"]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "49595087...
codedebug-train-000958
[ { "role": "user", "content": "Kun ajan `can_segment('', [])`, 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 can_segment('', [])\n ~~~~~~~~~~~^^^^^^^^\n File \"solution.py\", line ...
{ "kind": "code.debug.arith_flip.word_break", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 5, "entry": "can_segment", "checked_by": "buggy code fails on [\"\", []]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_id": "b1a7...
codedebug-train-000959
[ { "role": "user", "content": "My solution gives the wrong answer: `fewest_words('b', ['b'])` should be `1`, I get `-1`. What's wrong?\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 st...
{ "kind": "code.debug.off_by_one.word_break", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 9, "entry": "fewest_words", "checked_by": "buggy code fails on [\"b\", [\"b\"]]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_id": "80...
codedebug-train-000960
[ { "role": "user", "content": "Here is my solution. Something is wrong but I can't see it. Can you find 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 overlap by more than a single point ([1, 3] and [3, 5] sta...
{ "kind": "code.debug.cmp_flip.merge_intervals", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 5, "entry": "merge_intervals", "checked_by": "buggy code fails on [[[1, 3], [3, 5]]]...; fix == verified reference (oracle-checked on 19 inputs)", "proble...
codedebug-train-000961
[ { "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` cities `0..n-1` and one-way flights `[u, v, price]`. Return the cheapest total price from `src` to `dst` using at most `k` intermediate stops (so at most k + 1 flights), or ...
{ "kind": "code.debug.arith_flip.cheapest_path", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 8, "entry": "min_cost_path", "checked_by": "buggy code fails on [4, [[1, 0, 23], [3, 1, 31], [2, 3, 25], [3, 1, 49], [3, 0, ...; fix == verified reference (...
codedebug-train-000962
[ { "role": "user", "content": "Saan poikkeuksen kutsulla `calc('-7 / 2')`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 53, in <module>\n calc('-7 / 2')\n ~~~~^^^^^^^^^^\n File \"solution.py\", line 42, in calc\n apply()\n ~~~~~^^\n File \"solution.py\", line 14, in ...
{ "kind": "code.debug.cmp_flip.expr_eval", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 11, "entry": "calc", "checked_by": "buggy code fails on [\"-7 / 2\"]...; fix == verified reference (oracle-checked on 22 inputs)", "problem_id": "ba1b3f285f1...
codedebug-train-000963
[ { "role": "user", "content": "Here is my solution. Something is wrong but I can't see it. Can you find the bug?\n\nTask: Turn string `a` into string `b`. Inserting a character costs 3, deleting one costs 3, and replacing one character with a different one costs 1. Return the minimum total cost.\n\n```python...
{ "kind": "code.debug.arith_flip.edit_distance", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 7, "entry": "edit_cost", "checked_by": "buggy code fails on [\"b\", \"c\"]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "b5...
codedebug-train-000964
[ { "role": "user", "content": "Kun ajan `edit_cost('b', '')`, ohjelma kaatuu tällä virheilmoituksella. Mistä on kyse ja miten korjaan sen?\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 13, in <module>\n edit_cost('b', '')\n ~~~~~~~~~^^^^^^^^^\n File \"solution.py\", line 7, ...
{ "kind": "code.debug.off_by_one.edit_distance", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 6, "entry": "edit_cost", "checked_by": "buggy code fails on [\"b\", \"\"]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "...
codedebug-train-000965
[ { "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 listan välejä `[start, end]`, joissa `start < end`, satunnaisessa järjestyksessä. Yhdistä jokainen joukko välejä, jotka menevät päällekkäin enemmän kuin yhden ...
{ "kind": "code.debug.bool_flip.merge_intervals", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "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_...
codedebug-train-000966
[ { "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 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...
{ "kind": "code.debug.arith_flip.coin_change", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 6, "entry": "fewest_coins", "checked_by": "buggy code fails on [[3, 5, 8, 10], 22]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id...
codedebug-train-000967
[ { "role": "user", "content": "My solution gives the wrong answer: `obj = RangeSum([1, 2, 3]); obj.update(1, 2); obj.query(0, 2)` should be `6`, I get `3`. What's wrong?\n\nTask: Implement `RangeSum(nums)` with `update(index, value)`, which sets `nums[index] = value`, and `query(left, right)`, which returns ...
{ "kind": "code.debug.neg_drop.range_sum", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 18, "entry": "RangeSum", "checked_by": "buggy code fails on {\"init\": [[1, 2, 3]], \"ops\": [[\"update\", 1, 2], [\"query\", 0,...; fix == verified reference (orac...
codedebug-train-000968
[ { "role": "user", "content": "Tässä ratkaisuni. Jokin on vialla, mutta en näe mikä. Löydätkö virheen?\n\nTehtävä: Annettu lista `nums` ja ikkunan koko `k` (1 <= k <= len(nums)). Palauta jokaisen `k` peräkkäisen alkion ikkunan suurin arvo vasemmalta oikealle. Listassa voi olla satoja tuhansia alkioita ja `k`...
{ "kind": "code.debug.cmp_flip.window_extreme", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 10, "entry": "sliding_max", "checked_by": "buggy code fails on [[3, 5, 2, 2], 2]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id"...
codedebug-train-000969
[ { "role": "user", "content": "Please review this solution: there is a bug somewhere. Find it, show an input that fails, and fix it.\n\nTask: Return the number of 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 slow.\n\n...
{ "kind": "code.debug.cmp_flip.inversions", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 11, "entry": "count_big_inversions", "checked_by": "buggy code fails on [[5, 1, -3]]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id"...
codedebug-train-000970
[ { "role": "user", "content": "I get an exception for `count_islands(['00111'])`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 24, in <module>\n count_islands(['00111'])\n ~~~~~~~~~~~~~^^^^^^^^^^^\n File \"solution.py\", line 14, in count_islands\n while stack:\n ...
{ "kind": "code.debug.drop_stmt.count_islands", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 14, "entry": "count_islands", "checked_by": "buggy code fails on [[\"00111\"]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id...
codedebug-train-000971
[ { "role": "user", "content": "This is supposed to solve the task below, but `calc('2')` raises `IndexError: list index out of range` instead of returning `2`. Find and fix the bug.\n\nTask: The string contains non-negative integers, `+`, `-`, `*`, `/`, parentheses, spaces, and unary minus (as in `-3` or `-(...
{ "kind": "code.debug.cmp_flip.expr_eval", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 29, "entry": "calc", "checked_by": "buggy code fails on [\"2\"]...; fix == verified reference (oracle-checked on 22 inputs)", "problem_id": "2918dd17ef27", "pro...
codedebug-train-000972
[ { "role": "user", "content": "My solution gives the wrong answer: `longest_unique_run('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 longest_u...
{ "kind": "code.debug.minmax_swap.longest_window", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 8, "entry": "longest_unique_run", "checked_by": "buggy code fails on [\"a\"]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_id": "...
codedebug-train-000973
[ { "role": "user", "content": "Saan poikkeuksen kutsulla `can_segment('aaaa', ['a', 'aa'])`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 15, in <module>\n can_segment('aaaa', ['a', 'aa'])\n ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^\n File \"solution.py\", line 11, in can_segment\n ...
{ "kind": "code.debug.arith_flip.word_break", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 11, "entry": "can_segment", "checked_by": "buggy code fails on [\"aaaa\", [\"a\", \"aa\"]]...; fix == verified reference (oracle-checked on 20 inputs)", "...
codedebug-train-000974
[ { "role": "user", "content": "Running `window_minima([9], 1)` 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 18, in <module>\n window_minima([9], 1)\n ~~~~~~~~~~~~~^^^^^^^^\n File \"solution.py\", line 8, in w...
{ "kind": "code.debug.bool_flip.window_extreme", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 8, "entry": "window_minima", "checked_by": "buggy code fails on [[9], 1]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "8...
codedebug-train-000975
[ { "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.drop_stmt.palindromes", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 7, "entry": "longest_palindrome_len", "checked_by": "buggy code fails on [\"a\"]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_id": "9...
codedebug-train-000976
[ { "role": "user", "content": "I get an exception for `spiral_order([[1, 2, 3]])`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 17, in <module>\n spiral_order([[1, 2, 3]])\n ~~~~~~~~~~~~^^^^^^^^^^^^^\n File \"solution.py\", line 7, in spiral_order\n out.extend(matrix[top...
{ "kind": "code.debug.arith_flip.spiral", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 13, "entry": "spiral_order", "checked_by": "buggy code fails on [[[1, 2, 3]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "38f...
codedebug-train-000977
[ { "role": "user", "content": "My solution gives the wrong answer: `weighted_edit_distance('a', 'bdbb')` should be `11`, I get `9`. What's wrong?\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 2. Return the...
{ "kind": "code.debug.cmp_flip.edit_distance", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 7, "entry": "weighted_edit_distance", "checked_by": "buggy code fails on [\"a\", \"bdbb\"]...; fix == verified reference (oracle-checked on 18 inputs)", "prob...
codedebug-train-000978
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `spiral_order([[6, 4, 7]])` palauttaa `[6]` eikä `[6, 4, 7]`. Etsi ja korjaa virhe.\n\nTehtävä: Palauta `rows × cols` -matriisin kaikki alkiot spiraalijärjestyksessä alkaen vasemmasta yläkulmasta ja kulkien vastapäivään (ensin a...
{ "kind": "code.debug.arith_flip.spiral", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 8, "entry": "spiral_order", "checked_by": "buggy code fails on [[[6, 4, 7]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "af4362bd1...
codedebug-train-000979
[ { "role": "user", "content": "My solution gives the wrong answer: `longest_palindrome_len('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 separatel...
{ "kind": "code.debug.drop_stmt.palindromes", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 6, "entry": "longest_palindrome_len", "checked_by": "buggy code fails on [\"a\"]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_id": "9...
codedebug-train-000980
[ { "role": "user", "content": "Here is my solution. Something is wrong but I can't see it. Can you find the bug?\n\nTask: Turn string `a` into string `b`. Inserting a character costs 3, deleting one costs 3, and replacing one character with a different one costs 3. Return the minimum total cost.\n\n```python...
{ "kind": "code.debug.off_by_one.edit_distance", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 4, "entry": "transform_cost", "checked_by": "buggy code fails on [\"c\", \"\"]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id":...
codedebug-train-000981
[ { "role": "user", "content": "This is supposed to solve the task below, but `spiral([[6, 0]])` raises `IndexError: list index out of range` instead of returning `[6, 0]`. Find and fix the bug.\n\nTask: Return all elements of the `rows × cols` matrix in spiral order, starting at the top-left corner and going...
{ "kind": "code.debug.arith_flip.spiral", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 10, "entry": "spiral", "checked_by": "buggy code fails on [[[6, 0]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "af4362bd16a8", ...
codedebug-train-000982
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `weighted_edit_distance('c', 'cdbd')` palauttaa `0` eikä `9`. Etsi ja korjaa virhe.\n\nTehtävä: Muuta merkkijono `a` merkkijonoksi `b`. Merkin lisääminen maksaa 3, poistaminen 2 ja merkin korvaaminen eri merkillä 3. Palauta pien...
{ "kind": "code.debug.off_by_one.edit_distance", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 6, "entry": "weighted_edit_distance", "checked_by": "buggy code fails on [\"c\", \"cdbd\"]...; fix == verified reference (oracle-checked on 18 inputs)", "pr...
codedebug-train-000983
[ { "role": "user", "content": "I get an exception for `segment_ways('', [])`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 16, in <module>\n segment_ways('', [])\n ~~~~~~~~~~~~^^^^^^^^\n File \"solution.py\", line 7, in segment_ways\n best[0] = 1 # t...
{ "kind": "code.debug.arith_flip.word_break", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 6, "entry": "segment_ways", "checked_by": "buggy code fails on [\"\", []]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_id": "661...
codedebug-train-000984
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `max_histogram_area([0])` nostaa poikkeuksen `NameError: name 'width' is not defined` eikä palauta `0`. Etsi ja korjaa virhe.\n\nTehtävä: `heights[i]` on histogrammin pylvään `i` korkeus; jokainen pylväs on 1 leveä, ja pylväät o...
{ "kind": "code.debug.drop_stmt.histogram", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 8, "entry": "max_histogram_area", "checked_by": "buggy code fails on [[0]]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id": "b594cfa64...
codedebug-train-000985
[ { "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 `RangeSum(nums)` with `update(index, value)`, which sets `nums[index] = value`, and `query(left, right)`, which returns the sum of `nums[left..right]` (both ...
{ "kind": "code.debug.drop_stmt.range_sum", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 17, "entry": "RangeSum", "checked_by": "buggy code fails on {\"init\": [[0, 0, 0, 0]], \"ops\": [[\"update\", 3, 7], [\"query\",...; fix == verified reference (o...
codedebug-train-000986
[ { "role": "user", "content": "Saan poikkeuksen kutsulla `can_segment('aaaa', ['aa', 'a'])`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 14, in <module>\n can_segment('aaaa', ['aa', 'a'])\n ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^\n File \"solution.py\", line 9, in can_segment\n ...
{ "kind": "code.debug.drop_stmt.word_break", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 9, "entry": "can_segment", "checked_by": "buggy code fails on [\"aaaa\", [\"aa\", \"a\"]]...; fix == verified reference (oracle-checked on 20 inputs)", "pr...
codedebug-train-000987
[ { "role": "user", "content": "Here is my solution. Something is wrong but I can't see it. Can you find 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 `capacity`; each item can be taken any number of ...
{ "kind": "code.debug.arith_flip.knapsack", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 6, "entry": "max_value", "checked_by": "buggy code fails on [[2], [8], 13]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "bbd6816...
codedebug-train-000988
[ { "role": "user", "content": "My solution gives the wrong answer: `max_square_area([0, 4])` should be `1`, I get `4`. What's wrong?\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 ins...
{ "kind": "code.debug.drop_stmt.histogram", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 8, "entry": "max_square_area", "checked_by": "buggy code fails on [[0, 4]]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id": "cd7bb6afd...
codedebug-train-000989
[ { "role": "user", "content": "My solution gives the wrong answer: `merge([[1, 3], [3, 5]])` should be `[[1, 3], [3, 5]]`, I get `[[1, 5]]`. 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.cmp_flip.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 [[[1, 3], [3, 5]]]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "e480...
codedebug-train-000990
[ { "role": "user", "content": "I get an exception for `transform_cost('', '')`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 13, in <module>\n transform_cost('', '')\n ~~~~~~~~~~~~~~^^^^^^^^\n File \"solution.py\", line 10, in transform_cost\n return prev[len(b)]\n ...
{ "kind": "code.debug.off_by_one.edit_distance", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 3, "entry": "transform_cost", "checked_by": "buggy code fails on [\"\", \"\"]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id...
codedebug-train-000991
[ { "role": "user", "content": "Kun ajan `calc('-10')`, ohjelma kaatuu tällä virheilmoituksella. Mistä on kyse ja miten korjaan sen?\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 53, in <module>\n calc('-10')\n ~~~~^^^^^^^\n File \"solution.py\", line 49, in calc\n apply()...
{ "kind": "code.debug.cmp_flip.expr_eval", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 30, "entry": "calc", "checked_by": "buggy code fails on [\"-10\"]...; fix == verified reference (oracle-checked on 22 inputs)", "problem_id": "ba1b3f285f18",...
codedebug-train-000992
[ { "role": "user", "content": "I get an exception for `weighted_edit_distance('b', 'a')`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 13, in <module>\n weighted_edit_distance('b', 'a')\n ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^\n File \"solution.py\", line 8, in weighted_edit_dist...
{ "kind": "code.debug.arith_flip.edit_distance", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 8, "entry": "weighted_edit_distance", "checked_by": "buggy code fails on [\"b\", \"a\"]...; fix == verified reference (oracle-checked on 18 inputs)", "...
codedebug-train-000993
[ { "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 rectangle that fits inside the bars. The...
{ "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 [[0, 7]]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id": "88cf...
codedebug-train-000994
[ { "role": "user", "content": "I get an exception for `weighted_edit_distance('', 'ab')`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 13, in <module>\n weighted_edit_distance('', 'ab')\n ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^\n File \"solution.py\", line 7, in weighted_edit_dist...
{ "kind": "code.debug.off_by_one.edit_distance", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 4, "entry": "weighted_edit_distance", "checked_by": "buggy code fails on [\"\", \"ab\"]...; fix == verified reference (oracle-checked on 18 inputs)", "...
codedebug-train-000995
[ { "role": "user", "content": "My solution gives the wrong answer: `count_islands(['000'])` should be `0`, I get `3`. What's wrong?\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 vert...
{ "kind": "code.debug.cmp_flip.count_islands", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 10, "entry": "count_islands", "checked_by": "buggy code fails on [[\"000\"]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "f54b...
codedebug-train-000996
[ { "role": "user", "content": "Saan poikkeuksen kutsulla `spiral([[1, 2, 3]])`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 17, in <module>\n spiral([[1, 2, 3]])\n ~~~~~~^^^^^^^^^^^^^\n File \"solution.py\", line 7, in spiral\n out.extend(matrix[r][left] for r in range(...
{ "kind": "code.debug.arith_flip.spiral", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 13, "entry": "spiral", "checked_by": "buggy code fails on [[[1, 2, 3]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "af4362bd1...
codedebug-train-000997
[ { "role": "user", "content": "I get an exception for `spiral([[1, 2, 3]])`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 17, in <module>\n spiral([[1, 2, 3]])\n ~~~~~~^^^^^^^^^^^^^\n File \"solution.py\", line 12, in spiral\n out.extend(matrix[r][left] for r in range(bo...
{ "kind": "code.debug.arith_flip.spiral", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 12, "entry": "spiral", "checked_by": "buggy code fails on [[[1, 2, 3]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "38f2502ba...
codedebug-train-000998
[ { "role": "user", "content": "I get an exception for `longest_k_distinct('bd', 0)`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 19, in <module>\n longest_k_distinct('bd', 0)\n ~~~~~~~~~~~~~~~~~~^^^^^^^^^\n File \"solution.py\", line 10, in longest_k_distinct\n left = s...
{ "kind": "code.debug.cmp_flip.longest_window", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 12, "entry": "longest_k_distinct", "checked_by": "buggy code fails on [\"bd\", 0]...; fix == verified reference (oracle-checked on 20 inputs)", "problem...
codedebug-train-000999
[ { "role": "user", "content": "Ratkaisuni antaa väärän vastauksen: `knapsack([5], [10], 5)` pitäisi olla `10`, saan `-10`. 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 `ca...
{ "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": "bbd6816492...