id
stringlengths
22
22
messages
listlengths
2
2
meta
dict
codedebug-train-000400
[ { "role": "user", "content": "Ratkaisuni antaa väärän vastauksen: `lcs_length('c', 'ccb')` pitäisi olla `1`, saan `0`. Mikä on vialla?\n\nTehtävä: Palauta merkkijonojen `a` ja `b` pisimmän yhteisen alijonon pituus (merkit samassa järjestyksessä, ei välttämättä vierekkäin). Molemmat jonot voivat olla yli tuh...
{ "kind": "code.debug.minmax_swap.common_sequence", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 6, "entry": "lcs_length", "checked_by": "buggy code fails on [\"c\", \"ccb\"]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_id":...
codedebug-train-000401
[ { "role": "user", "content": "My solution gives the wrong answer: `count_palindromes('a')` should be `1`, I get `0`. What's wrong?\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 checking every substring sepa...
{ "kind": "code.debug.cmp_flip.palindromes", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 5, "entry": "count_palindromes", "checked_by": "buggy code fails on [\"a\"]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_id": "d8eb67d...
codedebug-train-000402
[ { "role": "user", "content": "Kun ajan `calc('(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 53, in <module>\n calc('(1)')\n ~~~~^^^^^^^\n File \"solution.py\", line 34, 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": 33, "entry": "calc", "checked_by": "buggy code fails on [\"(1)\"]...; fix == verified reference (oracle-checked on 22 inputs)", "problem_id": "ba1b3f285f18",...
codedebug-train-000403
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `num_islands(['1'])` palauttaa `0` eikä `1`. Etsi ja korjaa virhe.\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- ta...
{ "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 [[\"1\"]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "f54b612...
codedebug-train-000404
[ { "role": "user", "content": "Saan poikkeuksen kutsulla `count_inversions([1, 8])`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 25, in <module>\n count_inversions([1, 8])\n ~~~~~~~~~~~~~~~~^^^^^^^^\n File \"solution.py\", line 22, in count_inversions\n return sort_coun...
{ "kind": "code.debug.arith_flip.inversions", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 19, "entry": "count_inversions", "checked_by": "buggy code fails on [[1, 8]]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id": "...
codedebug-train-000405
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `best_path([[1, 2, 3]])` nostaa poikkeuksen `IndexError: list index out of range` eikä palauta `6`. Etsi ja korjaa virhe.\n\nTehtävä: Ruudukossa on kokonaislukuja (myös negatiivisia). Palauta suurin mahdollinen polun arvojen sum...
{ "kind": "code.debug.arith_flip.grid_paths", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 9, "entry": "best_path", "checked_by": "buggy code fails on [[[1, 2, 3]]]...; fix == verified reference (oracle-checked on 17 inputs)", "problem_id": "88866def...
codedebug-train-000406
[ { "role": "user", "content": "Please review this solution: there is a bug somewhere. Find it, show an input that fails, and fix it.\n\nTask: The grid holds integers (possibly negative). Starting at the top-left cell and moving only right or down to the bottom-right cell, return the largest possible sum of t...
{ "kind": "code.debug.arith_flip.grid_paths", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 11, "entry": "max_path_sum", "checked_by": "buggy code fails on [[[6], [6]]]...; fix == verified reference (oracle-checked on 17 inputs)", "problem_id": "888...
codedebug-train-000407
[ { "role": "user", "content": "Ratkaisuni antaa väärän vastauksen: `eval_expression('2 - 3 - 4')` pitäisi olla `-5`, saan `3`. Mikä on vialla?\n\nTehtävä: Merkkijonossa on ei-negatiivisia kokonaislukuja, `+`, `-`, `*`, `/`, sulkeita, välilyöntejä ja unaarinen miinus (kuten `-3` tai `-(2 + 1)`). Laske se tava...
{ "kind": "code.debug.cmp_flip.expr_eval", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 41, "entry": "eval_expression", "checked_by": "buggy code fails on [\"2 - 3 - 4\"]...; fix == verified reference (oracle-checked on 22 inputs)", "problem_id": "ba...
codedebug-train-000408
[ { "role": "user", "content": "Please review this solution: there is a bug somewhere. Find it, show an input that fails, and fix it.\n\nTask: Return the number of different ways to split `s` into words from `words` (each word can be used any number of times), modulo 1,000,000,007. The empty string has exactl...
{ "kind": "code.debug.off_by_one.word_break", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 9, "entry": "segment_ways", "checked_by": "buggy code fails on [\"bab\", [\"bab\"]]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_id...
codedebug-train-000409
[ { "role": "user", "content": "My solution gives the wrong answer: `palindromic_substrings('aaaa')` should be `10`, I get `16`. What's wrong?\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 checking every subs...
{ "kind": "code.debug.drop_stmt.palindromes", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 8, "entry": "palindromic_substrings", "checked_by": "buggy code fails on [\"aaaa\"]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_id":...
codedebug-train-000410
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `trade_with_fee([1, 10], 0)` palauttaa `0` eikä `9`. Etsi ja korjaa virhe.\n\nTehtävä: `prices[i]` on osakkeen hinta päivänä `i`. Saat tehdä kauppoja niin monta kuin haluat, mutta voit omistaa enintään yhden osakkeen kerrallaan,...
{ "kind": "code.debug.arith_flip.stock_profit", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 4, "entry": "trade_with_fee", "checked_by": "buggy code fails on [[1, 10], 0]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "7c...
codedebug-train-000411
[ { "role": "user", "content": "I get an exception for `first_redundant_edge(1, [[0, 0]])`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 21, in <module>\n first_redundant_edge(1, [[0, 0]])\n ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^\n File \"solution.py\", line 12, in first_redundan...
{ "kind": "code.debug.drop_stmt.union_find", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 12, "entry": "first_redundant_edge", "checked_by": "buggy code fails on [1, [[0, 0]]]...; fix == verified reference (oracle-checked on 20 inputs)", "proble...
codedebug-train-000412
[ { "role": "user", "content": "Here is my solution. Something is wrong but I can't see it. Can you find the bug?\n\nTask: There are `n` tasks `0..n-1` and pairs `[a, b]` meaning task `a` must be done before task `b`. Return the lexicographically smallest order that does every task once and respects all pairs...
{ "kind": "code.debug.drop_stmt.topo_order", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 17, "entry": "task_order", "checked_by": "buggy code fails on [7, [[2, 5], [0, 1]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id"...
codedebug-train-000413
[ { "role": "user", "content": "I get an exception for `count_islands(['1'])`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 24, in <module>\n count_islands(['1'])\n ~~~~~~~~~~~~~^^^^^^^\n File \"solution.py\", line 18, in count_islands\n if 0 <= ny < rows and 0 <= nx < co...
{ "kind": "code.debug.drop_stmt.count_islands", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 18, "entry": "count_islands", "checked_by": "buggy code fails on [[\"1\"]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "...
codedebug-train-000414
[ { "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ä: Kaupunkeja on `n` (`0..n-1`) ja yhdensuuntaisia lentoja `[u, v, price]`. Palauta halvin kokonaishinta kaupungista `src` kaupunkiin `dst`, kun välilaskuja on enintää...
{ "kind": "code.debug.arith_flip.cheapest_path", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 5, "entry": "cheapest_route", "checked_by": "buggy code fails on [2, [[0, 1, 16]], 0, 1, 0]...; fix == verified reference (oracle-checked on 19 inputs)", ...
codedebug-train-000415
[ { "role": "user", "content": "My solution gives the wrong answer: `window_maxima([8], 1)` should be `[8]`, I get `[]`. 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 right. The list ca...
{ "kind": "code.debug.cmp_flip.window_extreme", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 13, "entry": "window_maxima", "checked_by": "buggy code fails on [[8], 1]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "13c182...
codedebug-train-000416
[ { "role": "user", "content": "My solution gives the wrong answer: `obj = WordIndex(); obj.insert(''); obj.insert('c'); obj.count('')` should be `1`, I get `-1`. What's wrong?\n\nTask: Implement `WordIndex()` with three methods: `insert(word)` adds a word (duplicates count again), `count(word)` returns how m...
{ "kind": "code.debug.arith_flip.prefix_counter", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 11, "entry": "WordIndex", "checked_by": "buggy code fails on {\"init\": [], \"ops\": [[\"insert\", \"\"], [\"insert\", \"c\"], [\"coun...; fix == verified re...
codedebug-train-000417
[ { "role": "user", "content": "This is supposed to solve the task below, but `obj = WordIndex(); obj.insert('bacb'); obj.starts_with('b')` returns `-1` instead of `1`. Find and fix the bug.\n\nTask: Implement `WordIndex()` with three methods: `insert(word)` adds a word (duplicates count again), `count(word)`...
{ "kind": "code.debug.arith_flip.prefix_counter", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 10, "entry": "WordIndex", "checked_by": "buggy code fails on {\"init\": [], \"ops\": [[\"insert\", \"bacb\"], [\"starts_with\", \"b\"...; fix == verified ref...
codedebug-train-000418
[ { "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 common subsequence of `a` and `b` (characters in the same order, not necessarily adjacent). Both strings can be over a thousand characters long.\n\n```pyt...
{ "kind": "code.debug.arith_flip.common_sequence", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 6, "entry": "lcs_length", "checked_by": "buggy code fails on [\"cb\", \"b\"]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_id":...
codedebug-train-000419
[ { "role": "user", "content": "Please review this solution: there is a bug somewhere. Find it, show an input that fails, and fix it.\n\nTask: Return how many 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 prim...
{ "kind": "code.debug.cmp_flip.primes_range", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 2, "entry": "primes_between", "checked_by": "buggy code fails on [2, 2]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "fcfb2ec4...
codedebug-train-000420
[ { "role": "user", "content": "My solution gives the wrong answer: `count_sum_k([], 2)` should be `0`, I get `1`. What's wrong?\n\nTask: Return how many non-empty contiguous subarrays of `nums` there are whose sum is exactly `k`. Values can be negative and the list can have hundreds of thousands of elements....
{ "kind": "code.debug.init_change.subarray_count", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 7, "entry": "count_sum_k", "checked_by": "buggy code fails on [[], 2]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id": "30cbcb3...
codedebug-train-000421
[ { "role": "user", "content": "Kun ajan `merge_ranges([[1, 3], [3, 5]])`, ohjelma kaatuu tällä virheilmoituksella. Mistä on kyse ja miten korjaan sen?\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 14, in <module>\n merge_ranges([[1, 3], [3, 5]])\n ~~~~~~~~~~~~^^^^^^^^^^^^^^^^...
{ "kind": "code.debug.drop_stmt.merge_intervals", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 7, "entry": "merge_ranges", "checked_by": "buggy code fails on [[[1, 3], [3, 5]]]...; fix == verified reference (oracle-checked on 19 inputs)", "probl...
codedebug-train-000422
[ { "role": "user", "content": "Tässä ratkaisuni. Jokin on vialla, mutta en näe mikä. Löydätkö virheen?\n\nTehtävä: Kaupunkeja on `n` (`0..n-1`) ja yhdensuuntaisia lentoja `[u, v, price]`. Palauta halvin kokonaishinta kaupungista `src` kaupunkiin `dst`, kun välilaskuja on enintään `k` (siis enintään k + 1 len...
{ "kind": "code.debug.arith_flip.cheapest_path", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 5, "entry": "cheapest_route", "checked_by": "buggy code fails on [3, [[0, 1, 1], [1, 2, 1], [0, 2, 5]], 0, 2, 0]...; fix == verified reference (oracle-check...
codedebug-train-000423
[ { "role": "user", "content": "Please review this solution: there is a bug somewhere. Find it, show an input that fails, and fix it.\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 ...
{ "kind": "code.debug.off_by_one.knapsack", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 4, "entry": "best_load", "checked_by": "buggy code fails on [[5], [10], 5]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "ad345a8...
codedebug-train-000424
[ { "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.index_swap.window_extreme", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 14, "entry": "sliding_max", "checked_by": "buggy code fails on [[9, 4, 4], 2]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id":...
codedebug-train-000425
[ { "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ä: Kasoja on `piles`. Nopeudella `k` otat yhdestä kasasta enintään `k` esinettä tunnissa (kasa, jossa on vähemmän, vie silti koko tunnin). Palauta pienin kokonaislukun...
{ "kind": "code.debug.cmp_flip.search_answer", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 3, "entry": "min_eating_speed", "checked_by": "buggy code fails on [[30], 30]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "a...
codedebug-train-000426
[ { "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.drop_stmt.robot_walk", "lang": "en", "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": "ed0035dc3a9...
codedebug-train-000427
[ { "role": "user", "content": "Ratkaisuni kaatuu: `window_maxima([-2, 7], 1)` pitäisi palauttaa `[-2, 7]`, mutta se nostaa poikkeuksen `IndexError: list index out of range`. Mikä on vialla?\n\nTehtävä: Annettu lista `nums` ja ikkunan koko `k` (1 <= k <= len(nums)). Palauta jokaisen `k` peräkkäisen alkion ikk...
{ "kind": "code.debug.index_swap.window_extreme", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 10, "entry": "window_maxima", "checked_by": "buggy code fails on [[-2, 7], 1]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "...
codedebug-train-000428
[ { "role": "user", "content": "Saan poikkeuksen kutsulla `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[...
{ "kind": "code.debug.arith_flip.spiral", "lang": "fi", "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-000429
[ { "role": "user", "content": "Ratkaisuni antaa väärän vastauksen: `spiral([[3]])` pitäisi olla `[3]`, saan `[]`. Mikä on vialla?\n\nTehtävä: Palauta `rows × cols` -matriisin kaikki alkiot spiraalijärjestyksessä alkaen vasemmasta yläkulmasta ja kulkien myötäpäivään (ensin oikealle ylintä riviä) keskustaan as...
{ "kind": "code.debug.drop_stmt.spiral", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 7, "entry": "spiral", "checked_by": "buggy code fails on [[[3]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "38f2502ba7af", "prog...
codedebug-train-000430
[ { "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": 9, "entry": "max_square_area", "checked_by": "buggy code fails on [[5]]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id": "d87fffcb...
codedebug-train-000431
[ { "role": "user", "content": "Ratkaisuni antaa väärän vastauksen: `count_paths(['#'])` pitäisi olla `0`, saan `1`. Mikä on vialla?\n\nTehtävä: Ruudukko on lista merkkijonoja, joissa '.' on vapaa ja '#' estetty. Kuinka monta polkua vie vasemmasta yläkulmasta oikeaan alakulmaan, kun saa liikkua vain oikealle ...
{ "kind": "code.debug.init_change.grid_paths", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 9, "entry": "count_paths", "checked_by": "buggy code fails on [[\"#\"]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "9cbaa9481...
codedebug-train-000432
[ { "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.arith_flip.expr_eval", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 15, "entry": "evaluate", "checked_by": "buggy code fails on [\"2 - 3 - 4\"]...; fix == verified reference (oracle-checked on 22 inputs)", "problem_id": "ba1b3...
codedebug-train-000433
[ { "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.arith_flip.histogram", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 7, "entry": "largest_rectangle", "checked_by": "buggy code fails on [[5, 7, 3, 7]]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id":...
codedebug-train-000434
[ { "role": "user", "content": "Ratkaisuni antaa väärän vastauksen: `unique_paths(['.'])` pitäisi olla `1`, saan `0`. Mikä on vialla?\n\nTehtävä: Ruudukko on lista merkkijonoja, joissa '.' on vapaa ja '#' estetty. Kuinka monta polkua vie vasemmasta yläkulmasta oikeaan alakulmaan, kun saa liikkua vain oikealle...
{ "kind": "code.debug.cmp_flip.grid_paths", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 5, "entry": "unique_paths", "checked_by": "buggy code fails on [[\".\"]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "9cbaa94810d...
codedebug-train-000435
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `num_islands(['011'])` palauttaa `3` eikä `1`. Etsi ja korjaa virhe.\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-,...
{ "kind": "code.debug.bool_flip.count_islands", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 10, "entry": "num_islands", "checked_by": "buggy code fails on [[\"011\"]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "75d0d...
codedebug-train-000436
[ { "role": "user", "content": "Here is my solution. Something is wrong but I can't see it. Can you find the bug?\n\nTask: Implement `SlidingWindowLimiter(limit, window)` with `allow(t)`. A call at time `t` is allowed if fewer than `limit` allowed calls happened in the window `(t - window, t]`; allowed calls ...
{ "kind": "code.debug.cmp_flip.rate_limiter", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 10, "entry": "SlidingWindowLimiter", "checked_by": "buggy code fails on {\"init\": [1, 10], \"ops\": [[\"allow\", 0], [\"allow\", 9], [\"allo...; fix == verifi...
codedebug-train-000437
[ { "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.cmp_flip.spiral", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 11, "entry": "spiral", "checked_by": "buggy code fails on [[[1], [2], [3]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "38f2502ba7...
codedebug-train-000438
[ { "role": "user", "content": "Tässä ratkaisuni. Jokin on vialla, mutta en näe mikä. Löydätkö virheen?\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 tai koskettavat toisiaan (pelkkä yhteinen päätepi...
{ "kind": "code.debug.index_swap.merge_intervals", "lang": "fi", "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)", "prob...
codedebug-train-000439
[ { "role": "user", "content": "Ratkaisuni antaa väärän vastauksen: `spiral([[1]])` pitäisi olla `[1]`, saan `[1, 1]`. Mikä on vialla?\n\nTehtävä: Palauta `rows × cols` -matriisin kaikki alkiot spiraalijärjestyksessä alkaen vasemmasta yläkulmasta ja kulkien vastapäivään (ensin alas vasenta saraketta) keskusta...
{ "kind": "code.debug.off_by_one.spiral", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 8, "entry": "spiral", "checked_by": "buggy code fails on [[[1]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "af4362bd16a8", "pro...
codedebug-train-000440
[ { "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 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 th...
{ "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 [[[0, 9, 0]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "af4362bd16a8...
codedebug-train-000441
[ { "role": "user", "content": "I get an exception for `max_histogram_area([0])`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 17, in <module>\n max_histogram_area([0])\n ~~~~~~~~~~~~~~~~~~^^^^^\n File \"solution.py\", line 6, in max_histogram_area\n while stack or height...
{ "kind": "code.debug.bool_flip.histogram", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 6, "entry": "max_histogram_area", "checked_by": "buggy code fails on [[0]]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id": "88cf...
codedebug-train-000442
[ { "role": "user", "content": "My solution gives the wrong answer: `edit_cost('db', 'cba')` should be `6`, I get `3`. What's wrong?\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...
{ "kind": "code.debug.cmp_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 [\"db\", \"cba\"]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "66d...
codedebug-train-000443
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `transform_cost('d', 'ab')` palauttaa `-2` eikä `6`. Etsi ja korjaa virhe.\n\nTehtävä: Muuta merkkijono `a` merkkijonoksi `b`. Merkin lisääminen maksaa 2, poistaminen 2 ja merkin korvaaminen eri merkillä 4. Palauta pienin kokona...
{ "kind": "code.debug.arith_flip.edit_distance", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 8, "entry": "transform_cost", "checked_by": "buggy code fails on [\"d\", \"ab\"]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id":...
codedebug-train-000444
[ { "role": "user", "content": "This is supposed to solve the task below, but `obj = PointUpdateSums([5]); obj.query(0, 0)` returns `0` instead of `5`. Find and fix the bug.\n\nTask: Implement `PointUpdateSums(nums)` with `update(index, value)`, which sets `nums[index] = value`, and `query(left, right)`, whic...
{ "kind": "code.debug.drop_stmt.range_sum", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 11, "entry": "PointUpdateSums", "checked_by": "buggy code fails on {\"init\": [[5]], \"ops\": [[\"query\", 0, 0], [\"update\", 0, -3], ...; fix == verified referen...
codedebug-train-000445
[ { "role": "user", "content": "Running `lcs_length('b', '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 11, in <module>\n lcs_length('b', 'b')\n ~~~~~~~~~~^^^^^^^^^^\n File \"solution.py\", line 6, in lcs_...
{ "kind": "code.debug.arith_flip.common_sequence", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 6, "entry": "lcs_length", "checked_by": "buggy code fails on [\"b\", \"b\"]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_id...
codedebug-train-000446
[ { "role": "user", "content": "Saan poikkeuksen kutsulla `islands(['10', '00'])`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 24, in <module>\n islands(['10', '00'])\n ~~~~~~~^^^^^^^^^^^^^^\n File \"solution.py\", line 14, in islands\n while stack:\n ^^^^^\nNam...
{ "kind": "code.debug.drop_stmt.count_islands", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 14, "entry": "islands", "checked_by": "buggy code fails on [[\"10\", \"00\"]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id"...
codedebug-train-000447
[ { "role": "user", "content": "Please review this solution: there is a bug somewhere. Find it, show an input that fails, and fix it.\n\nTask: The string contains non-negative integers, `+`, `-`, `*`, `/`, parentheses, spaces, and unary minus (as in `-3` or `-(2 + 1)`). Evaluate it with the usual precedence (...
{ "kind": "code.debug.cmp_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 [\"0 + 1\"]...; fix == verified reference (oracle-checked on 22 inputs)", "problem_id": "2918dd17ef2...
codedebug-train-000448
[ { "role": "user", "content": "Ratkaisuni kaatuu: `reverse_pairs([9, 5])` pitäisi palauttaa `0`, mutta se nostaa poikkeuksen `TypeError: unsupported operand type(s) for -: 'list' and 'list'`. Mikä on vialla?\n\nTehtävä: Palauta niiden indeksiparien `i < j` määrä, joille `a[i] > 2 * a[j]`. Arvot voivat olla n...
{ "kind": "code.debug.arith_flip.inversions", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 14, "entry": "reverse_pairs", "checked_by": "buggy code fails on [[9, 5]]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id": "ee3155a9...
codedebug-train-000449
[ { "role": "user", "content": "Running `num_islands(['0111'])` 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 num_islands(['0111'])\n ~~~~~~~~~~~^^^^^^^^^^\n File \"solution.py\", line 14, in ...
{ "kind": "code.debug.drop_stmt.count_islands", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 14, "entry": "num_islands", "checked_by": "buggy code fails on [[\"0111\"]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": ...
codedebug-train-000450
[ { "role": "user", "content": "My solution gives the wrong answer: `min_ship_capacity([6, 3], 1)` should be `9`, I get `6`. What's wrong?\n\nTask: Packages with weights `weights` must be shipped in the given order within `days` days (1 <= days <= len(weights)). Each day the ship takes a run of consecutive pa...
{ "kind": "code.debug.arith_flip.search_answer", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 5, "entry": "min_ship_capacity", "checked_by": "buggy code fails on [[6, 3], 1]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": ...
codedebug-train-000451
[ { "role": "user", "content": "I get an exception for `transform_cost('a', '')`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 13, in <module>\n transform_cost('a', '')\n ~~~~~~~~~~~~~~^^^^^^^^^\n File \"solution.py\", line 5, in transform_cost\n cur = [i * DEL] - [0] * l...
{ "kind": "code.debug.arith_flip.edit_distance", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 5, "entry": "transform_cost", "checked_by": "buggy code fails on [\"a\", \"\"]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_i...
codedebug-train-000452
[ { "role": "user", "content": "Ratkaisuni antaa väärän vastauksen: `spiral([[0], [5], [7]])` pitäisi olla `[0, 5, 7]`, saan `[0, 5, 7, 5]`. Mikä on vialla?\n\nTehtävä: Palauta `rows × cols` -matriisin kaikki alkiot spiraalijärjestyksessä alkaen vasemmasta yläkulmasta ja kulkien myötäpäivään (ensin oikealle y...
{ "kind": "code.debug.arith_flip.spiral", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 13, "entry": "spiral", "checked_by": "buggy code fails on [[[0], [5], [7]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "38f2502ba7...
codedebug-train-000453
[ { "role": "user", "content": "My solution crashes: `merge([[1, 3], [3, 5]])` should return `[[1, 3], [3, 5]]`, but it raises `NameError: name 'last' is not defined`. What is wrong?\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.drop_stmt.merge_intervals", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 7, "entry": "merge", "checked_by": "buggy code fails on [[[1, 3], [3, 5]]]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "624...
codedebug-train-000454
[ { "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 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 string needs 0 words. `s...
{ "kind": "code.debug.minmax_swap.word_break", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 12, "entry": "min_word_split", "checked_by": "buggy code fails on [\"ab\", [\"ab\"]]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_...
codedebug-train-000455
[ { "role": "user", "content": "My solution gives the wrong answer: `transform_cost('d', 'a')` 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 3. Return the minimum tot...
{ "kind": "code.debug.off_by_one.edit_distance", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 6, "entry": "transform_cost", "checked_by": "buggy code fails on [\"d\", \"a\"]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": ...
codedebug-train-000456
[ { "role": "user", "content": "My solution gives the wrong answer: `transform_cost('c', 'ca')` should be `2`, I get `0`. What's wrong?\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 3. Return the minimum to...
{ "kind": "code.debug.drop_stmt.edit_distance", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 8, "entry": "transform_cost", "checked_by": "buggy code fails on [\"c\", \"ca\"]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": ...
codedebug-train-000457
[ { "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] > 2 * a[j]`. Arvot voivat olla negatiivisia, ja listassa voi olla 150 000 alkiota, joten jokaisen parin tar...
{ "kind": "code.debug.arith_flip.inversions", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 14, "entry": "count_big_inversions", "checked_by": "buggy code fails on [[9, 7]]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id": ...
codedebug-train-000458
[ { "role": "user", "content": "Please review this solution: there is a bug somewhere. Find it, show an input that fails, and fix it.\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 buy on th...
{ "kind": "code.debug.minmax_swap.stock_profit", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 4, "entry": "trade_with_cooldown", "checked_by": "buggy code fails on [[7, 1]]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id":...
codedebug-train-000459
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `weighted_edit_distance('b', 'dab')` palauttaa `-6` eikä `6`. Etsi ja korjaa virhe.\n\nTehtävä: Muuta merkkijono `a` merkkijonoksi `b`. Merkin lisääminen maksaa 3, poistaminen 3 ja merkin korvaaminen eri merkillä 2. Palauta pien...
{ "kind": "code.debug.arith_flip.edit_distance", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 8, "entry": "weighted_edit_distance", "checked_by": "buggy code fails on [\"b\", \"dab\"]...; fix == verified reference (oracle-checked on 18 inputs)", "pro...
codedebug-train-000460
[ { "role": "user", "content": "Ratkaisuni antaa väärän vastauksen: `segment_ways('ababab', ['ab'])` 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": 8, "entry": "segment_ways", "checked_by": "buggy code fails on [\"ababab\", [\"ab\"]]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_id...
codedebug-train-000461
[ { "role": "user", "content": "Ratkaisuni antaa väärän vastauksen: `knapsack([3], [26], 9)` pitäisi olla `78`, 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 `capa...
{ "kind": "code.debug.arith_flip.knapsack", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 5, "entry": "knapsack", "checked_by": "buggy code fails on [[3], [26], 9]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "bbd6816492...
codedebug-train-000462
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `longest_unique_run('ddd')` palauttaa `5` eikä `1`. Etsi ja korjaa virhe.\n\nTehtävä: Palauta merkkijonon `s` pisimmän sellaisen osajonon pituus, jossa mikään merkki ei esiinny kahdesti. `s` voi olla satojatuhansia merkkejä pitk...
{ "kind": "code.debug.arith_flip.longest_window", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 8, "entry": "longest_unique_run", "checked_by": "buggy code fails on [\"ddd\"]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_id": ...
codedebug-train-000463
[ { "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ä: 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 s...
{ "kind": "code.debug.index_swap.window_extreme", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 11, "entry": "window_maxima", "checked_by": "buggy code fails on [[9, 5, 8, 9], 2]...; fix == verified reference (oracle-checked on 19 inputs)", "problem...
codedebug-train-000464
[ { "role": "user", "content": "This is supposed to solve the task below, but `knapsack([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 `capacity...
{ "kind": "code.debug.off_by_one.knapsack", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 3, "entry": "knapsack", "checked_by": "buggy code fails on [[5], [10], 5]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "bbd6816492...
codedebug-train-000465
[ { "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": 2, "entry": "knapsack", "checked_by": "buggy code fails on [[], [], 10]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "bbd6816492...
codedebug-train-000466
[ { "role": "user", "content": "This is supposed to solve the task below, but `evaluate('4')` raises `IndexError: list index out of range` instead of returning `4`. 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": 18, "entry": "evaluate", "checked_by": "buggy code fails on [\"4\"]...; fix == verified reference (oracle-checked on 22 inputs)", "problem_id": "2918dd17ef27", ...
codedebug-train-000467
[ { "role": "user", "content": "This is supposed to solve the task below, but `obj = PrefixCounter(); obj.insert('aacb'); obj.insert(''); obj.insert('aa'); obj.count('bab')` returns `1` instead of `0`. Find and fix the bug.\n\nTask: Implement `PrefixCounter()` with three methods: `insert(word)` adds a word (d...
{ "kind": "code.debug.drop_stmt.prefix_counter", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 16, "entry": "PrefixCounter", "checked_by": "buggy code fails on {\"init\": [], \"ops\": [[\"insert\", \"aacb\"], [\"insert\", \"\"], [\"i...; fix == verified...
codedebug-train-000468
[ { "role": "user", "content": "Tässä ratkaisuni. Jokin on vialla, mutta en näe mikä. Löydätkö virheen?\n\nTehtävä: Ruudukko on lista merkkijonoja, joissa '.' on vapaa ja '#' estetty. Kuinka monta polkua vie vasemmasta yläkulmasta oikeaan alakulmaan, kun saa liikkua vain oikealle tai alas eikä astua ruutuun '...
{ "kind": "code.debug.cmp_flip.grid_paths", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 10, "entry": "unique_paths", "checked_by": "buggy code fails on [[\".\"]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "9cbaa948...
codedebug-train-000469
[ { "role": "user", "content": "Here is my solution. Something is wrong but I can't see it. Can you find the bug?\n\nTask: `s` contains only `(` and `)`. Return the minimum number of parentheses you must insert (anywhere) to make it balanced.\n\n```python\ndef fix_parens(s: str) -> int:\n open_count = inse...
{ "kind": "code.debug.init_change.brackets", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 2, "entry": "fix_parens", "checked_by": "buggy code fails on [\"\"]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id": "f26917dfccd0"...
codedebug-train-000470
[ { "role": "user", "content": "Running `longest_common_substring('bcb', '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 15, in <module>\n longest_common_substring('bcb', 'b')\n ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^...
{ "kind": "code.debug.arith_flip.common_sequence", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 5, "entry": "longest_common_substring", "checked_by": "buggy code fails on [\"bcb\", \"b\"]...; fix == verified reference (oracle-checked on 20 inputs)...
codedebug-train-000471
[ { "role": "user", "content": "Tässä ratkaisuni. Jokin on vialla, mutta en näe mikä. Löydätkö virheen?\n\nTehtävä: Ruudukko on lista merkkijonoja, joissa '.' on vapaa ja '#' estetty. Kuinka monta polkua vie vasemmasta yläkulmasta oikeaan alakulmaan, kun saa liikkua vain oikealle tai alas eikä astua ruutuun '...
{ "kind": "code.debug.cmp_flip.grid_paths", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 8, "entry": "count_paths", "checked_by": "buggy code fails on [[\".\"]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "9cbaa94810...
codedebug-train-000472
[ { "role": "user", "content": "Tässä ratkaisuni. Jokin on vialla, mutta en näe mikä. Löydätkö virheen?\n\nTehtävä: Ruudukko on lista merkkijonoja, joissa '.' on vapaa ja '#' estetty. Kuinka monta polkua vie vasemmasta yläkulmasta oikeaan alakulmaan, kun saa liikkua vain oikealle tai alas eikä astua ruutuun '...
{ "kind": "code.debug.arith_flip.grid_paths", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 11, "entry": "count_paths", "checked_by": "buggy code fails on [[\"......\"]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "9c...
codedebug-train-000473
[ { "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 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 th...
{ "kind": "code.debug.arith_flip.spiral", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 7, "entry": "spiral", "checked_by": "buggy code fails on [[[1]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "af4362bd16a8", "p...
codedebug-train-000474
[ { "role": "user", "content": "I get an exception for `spiral([[1]])`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 17, in <module>\n spiral([[1]])\n ~~~~~~^^^^^^^\n File \"solution.py\", line 7, in spiral\n out.extend(matrix[top][c] for c in range(left, right + 1))\n ...
{ "kind": "code.debug.arith_flip.spiral", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 5, "entry": "spiral", "checked_by": "buggy code fails on [[[1]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "38f2502ba7af", ...
codedebug-train-000475
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `min_ship_capacity([2, 9], 1)` palauttaa `9` eikä `11`. Etsi ja korjaa virhe.\n\nTehtävä: Paketit painoilla `weights` on kuljetettava annetussa järjestyksessä `days` päivässä (1 <= days <= len(weights)). Joka päivä laiva ottaa p...
{ "kind": "code.debug.drop_stmt.search_answer", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 7, "entry": "min_ship_capacity", "checked_by": "buggy code fails on [[2, 9], 1]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "...
codedebug-train-000476
[ { "role": "user", "content": "My solution gives the wrong answer: `robot_max_distance([4, -2, -1, -1, 6, -1, 6, 1, 3, 3], [[-3, -1], [1, 1], [2, 2], [1, 4]])` should be `81`, I get `325`. What's wrong?\n\nTask: A robot starts at (0, 0) facing north. Commands: `-2` turns left 90°, `-1` turns right 90°, and `...
{ "kind": "code.debug.arith_flip.robot_walk", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 8, "entry": "robot_max_distance", "checked_by": "buggy code fails on [[4, -2, -1, -1, 6, -1, 6, 1, 3, 3], [[-3, -1], [1, 1], [2, ...; fix == verified reference (...
codedebug-train-000477
[ { "role": "user", "content": "My solution gives the wrong answer: `weighted_edit_distance('da', 'baa')` should be `5`, I get `-2`. What's wrong?\n\nTask: Turn string `a` into string `b`. Inserting a character costs 2, deleting one costs 2, and replacing one character with a different one costs 3. Return the...
{ "kind": "code.debug.arith_flip.edit_distance", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 8, "entry": "weighted_edit_distance", "checked_by": "buggy code fails on [\"da\", \"baa\"]...; fix == verified reference (oracle-checked on 18 inputs)", "pr...
codedebug-train-000478
[ { "role": "user", "content": "Running `first_redundant_edge(7, [[1, 3]])` crashes with this traceback. What's going on and how do I fix it?\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 21, in <module>\n first_redundant_edge(7, [[1, 3]])\n ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^\n...
{ "kind": "code.debug.drop_stmt.union_find", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 12, "entry": "first_redundant_edge", "checked_by": "buggy code fails on [7, [[1, 3]]]...; fix == verified reference (oracle-checked on 20 inputs)", "proble...
codedebug-train-000479
[ { "role": "user", "content": "This is supposed to solve the task below, but `merge_intervals([[0, 3], [0, 1]])` raises `IndexError: list index out of range` instead of returning `[[0, 3]]`. Find and fix the bug.\n\nTask: You are given a list of intervals `[start, end]` with `start < end`, in no particular o...
{ "kind": "code.debug.bool_flip.merge_intervals", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 5, "entry": "merge_intervals", "checked_by": "buggy code fails on [[[0, 3], [0, 1]]]...; fix == verified reference (oracle-checked on 19 inputs)", "problem...
codedebug-train-000480
[ { "role": "user", "content": "This is supposed to solve the task below, but `sliding_max([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 largest value in every window of `k` consecutive elements, from left to ...
{ "kind": "code.debug.arith_flip.window_extreme", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 13, "entry": "sliding_max", "checked_by": "buggy code fails on [[5], 1]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "13c182...
codedebug-train-000481
[ { "role": "user", "content": "This is supposed to solve the task below, but `common_substring_len('abc', '')` raises `NameError: name 'cur' is not defined` instead of returning `0`. Find and fix the bug.\n\nTask: Return the length of the longest string that appears as a contiguous substring in both `a` and ...
{ "kind": "code.debug.drop_stmt.common_sequence", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 5, "entry": "common_substring_len", "checked_by": "buggy code fails on [\"abc\", \"\"]...; fix == verified reference (oracle-checked on 20 inputs)", "probl...
codedebug-train-000482
[ { "role": "user", "content": "Ratkaisuni antaa väärän vastauksen: `obj = PointUpdateSums([-5, 4, 7]); obj.update(2, 2); obj.query(1, 1); obj.query(1, 1); obj.query(0, 2)` pitäisi olla `1`, saan `9`. Mikä on vialla?\n\nTehtävä: Toteuta `PointUpdateSums(nums)`, jossa `update(index, value)` asettaa `nums[index...
{ "kind": "code.debug.arith_flip.range_sum", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 13, "entry": "PointUpdateSums", "checked_by": "buggy code fails on {\"init\": [[-5, 4, 7]], \"ops\": [[\"update\", 2, 2], [\"query\", 1...; fix == verified refere...
codedebug-train-000483
[ { "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 number of different ways to split `s` into words from `words` (each word can be used any number of times), modulo 1,000,000,007. The empty string has exactly one split. `s` can...
{ "kind": "code.debug.arith_flip.word_break", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 8, "entry": "segment_ways", "checked_by": "buggy code fails on [\"bababa\", [\"ba\"]]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_...
codedebug-train-000484
[ { "role": "user", "content": "My solution gives the wrong answer: `best_path([[1, 2, 3]])` should be `6`, I get `3`. 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 possible sum of th...
{ "kind": "code.debug.cmp_flip.grid_paths", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 6, "entry": "best_path", "checked_by": "buggy code fails on [[[1, 2, 3]]]...; fix == verified reference (oracle-checked on 17 inputs)", "problem_id": "88866def76...
codedebug-train-000485
[ { "role": "user", "content": "Ratkaisuni antaa väärän vastauksen: `obj = RangeSum([5]); obj.query(0, 0); obj.update(0, -3); obj.query(0, 0)` pitäisi olla `-3`, saan `7`. Mikä on vialla?\n\nTehtävä: Toteuta `RangeSum(nums)`, jossa `update(index, value)` asettaa `nums[index] = value` ja `query(left, right)` p...
{ "kind": "code.debug.arith_flip.range_sum", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 22, "entry": "RangeSum", "checked_by": "buggy code fails on {\"init\": [[5]], \"ops\": [[\"query\", 0, 0], [\"update\", 0, -3], ...; fix == verified reference (or...
codedebug-train-000486
[ { "role": "user", "content": "My solution crashes: `eval_expression('8')` should return `8`, but it raises `IndexError: string index out of range`. What is wrong?\n\nTask: The string contains non-negative integers, `+`, `-`, `*`, `/`, parentheses, spaces, and unary minus (as in `-3` or `-(2 + 1)`). Evaluate...
{ "kind": "code.debug.cmp_flip.expr_eval", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 7, "entry": "eval_expression", "checked_by": "buggy code fails on [\"8\"]...; fix == verified reference (oracle-checked on 22 inputs)", "problem_id": "2918dd17ef2...
codedebug-train-000487
[ { "role": "user", "content": "Tässä ratkaisuni. Jokin on vialla, mutta en näe mikä. Löydätkö virheen?\n\nTehtävä: Solmuja on `n`, numeroitu 0..n-1, ja suuntaamattomat kaaret annetaan listana `[u, v]`. Palauta yhtenäisten ryhmien määrä. Sekä `n` että kaarten määrä voivat olla 200 000.\n\n```python\ndef numbe...
{ "kind": "code.debug.cmp_flip.union_find", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 14, "entry": "number_of_groups", "checked_by": "buggy code fails on [5, [[3, 3]]]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_id": "...
codedebug-train-000488
[ { "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 pienin arvo vasemmalta oikealle. Listassa voi olla satoja tuhansia alkioita ja `k`...
{ "kind": "code.debug.index_swap.window_extreme", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 11, "entry": "window_minima", "checked_by": "buggy code fails on [[-8, 4], 1]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id":...
codedebug-train-000489
[ { "role": "user", "content": "This is supposed to solve the task below, but `min_meeting_rooms([[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 t...
{ "kind": "code.debug.minmax_swap.meeting_rooms", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 10, "entry": "min_meeting_rooms", "checked_by": "buggy code fails on [[[0, 1]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id":...
codedebug-train-000490
[ { "role": "user", "content": "This is supposed to solve the task below, but `common_substring_len('abca', 'bc')` returns `1` instead of `2`. Find and fix the bug.\n\nTask: Return the length of the longest string that appears as a contiguous substring in both `a` and `b`. Both strings can be over a thousand ...
{ "kind": "code.debug.drop_stmt.common_sequence", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 11, "entry": "common_substring_len", "checked_by": "buggy code fails on [\"abca\", \"bc\"]...; fix == verified reference (oracle-checked on 20 inputs)", "p...
codedebug-train-000491
[ { "role": "user", "content": "Please review this solution: there is a bug somewhere. Find it, show an input that fails, and fix it.\n\nTask: Each meeting is `[start, end)` (it is running at time t when start <= t < end). Return the earliest integer time at which the number of running meetings is largest. Th...
{ "kind": "code.debug.bool_flip.meeting_rooms", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 7, "entry": "busiest_moment", "checked_by": "buggy code fails on [[[9, 10], [10, 11]]]...; fix == verified reference (oracle-checked on 17 inputs)", "probl...
codedebug-train-000492
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `trade_with_cooldown([3])` palauttaa `-inf` 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, omistaen enintään yhden osakkeen kerrallaan, mutta my...
{ "kind": "code.debug.minmax_swap.stock_profit", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 5, "entry": "trade_with_cooldown", "checked_by": "buggy code fails on [[3]]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "15e...
codedebug-train-000493
[ { "role": "user", "content": "Ratkaisuni antaa väärän vastauksen: `window_minima([8, 7, -6, -2], 1)` pitäisi olla `[8, 7, -6, -2]`, saan `[8, 7, -6, -6]`. Mikä on vialla?\n\nTehtävä: Annettu lista `nums` ja ikkunan koko `k` (1 <= k <= len(nums)). Palauta jokaisen `k` peräkkäisen alkion ikkunan pienin arvo v...
{ "kind": "code.debug.cmp_flip.window_extreme", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 10, "entry": "window_minima", "checked_by": "buggy code fails on [[8, 7, -6, -2], 1]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_i...
codedebug-train-000494
[ { "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 `SlidingWindowLimiter(limit, window)` with `allow(t)`. A call at time `t` is allowed if fewer than `limit` allowed calls happened in the window `(t - window,...
{ "kind": "code.debug.bool_flip.rate_limiter", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 10, "entry": "SlidingWindowLimiter", "checked_by": "buggy code fails on {\"init\": [1, 3], \"ops\": [[\"allow\", 1], [\"allow\", 1], [\"allow...; fix == verif...
codedebug-train-000495
[ { "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.drop_stmt.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": "0405...
codedebug-train-000496
[ { "role": "user", "content": "Ratkaisuni antaa väärän vastauksen: `obj = PointUpdateSums([5]); obj.query(0, 0)` pitäisi olla `5`, saan `10`. Mikä on vialla?\n\nTehtävä: Toteuta `PointUpdateSums(nums)`, jossa `update(index, value)` asettaa `nums[index] = value` ja `query(left, right)` palauttaa summan `nums[...
{ "kind": "code.debug.cmp_flip.range_sum", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 23, "entry": "PointUpdateSums", "checked_by": "buggy code fails on {\"init\": [[5]], \"ops\": [[\"query\", 0, 0], [\"update\", 0, -3], ...; fix == verified referenc...
codedebug-train-000497
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `subarrays_div_by([], 5)` palauttaa `1` eikä `0`. 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 voivat ol...
{ "kind": "code.debug.init_change.subarray_count", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 4, "entry": "subarrays_div_by", "checked_by": "buggy code fails on [[], 5]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "d4...
codedebug-train-000498
[ { "role": "user", "content": "Ratkaisuni antaa väärän vastauksen: `eval_expression('19 - -5')` pitäisi olla `24`, saan `19`. Mikä on vialla?\n\nTehtävä: Merkkijonossa on ei-negatiivisia kokonaislukuja, `+`, `-`, `*`, `/`, sulkeita, välilyöntejä ja unaarinen miinus (kuten `-3` tai `-(2 + 1)`). Laske se taval...
{ "kind": "code.debug.bool_flip.expr_eval", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 40, "entry": "eval_expression", "checked_by": "buggy code fails on [\"19 - -5\"]...; fix == verified reference (oracle-checked on 22 inputs)", "problem_id": "ba1...
codedebug-train-000499
[ { "role": "user", "content": "Saan poikkeuksen kutsulla `rle_encode('a')`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 12, in <module>\n rle_encode('a')\n ~~~~~~~~~~^^^^^\n File \"solution.py\", line 7, in rle_encode\n out.append(s[i] if run == 1 else f\"{s[i]}{run}\")...
{ "kind": "code.debug.drop_stmt.rle", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 7, "entry": "rle_encode", "checked_by": "buggy code fails on [\"a\"]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "29749195abb7", ...