id
stringlengths
22
22
messages
listlengths
2
2
meta
dict
codedebug-train-000700
[ { "role": "user", "content": "Here is my solution. Something is wrong but I can't see it. Can you find the bug?\n\nTask: Return how many 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.\n\n```python\n...
{ "kind": "code.debug.init_change.subarray_count", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 6, "entry": "count_sum_k", "checked_by": "buggy code fails on [[3], 3]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id": "30cb...
codedebug-train-000701
[ { "role": "user", "content": "This is supposed to solve the task below, but `max_square_area([])` raises `IndexError: list index out of range` instead of returning `0`. Find and fix the bug.\n\nTask: `heights[i]` is the height of bar `i` in a histogram; every bar is 1 wide and bars stand side by side. Retur...
{ "kind": "code.debug.bool_flip.histogram", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 5, "entry": "max_square_area", "checked_by": "buggy code fails on [[]]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id": "d87fffcb5cc7"...
codedebug-train-000702
[ { "role": "user", "content": "Tässä ratkaisuni. Jokin on vialla, mutta en näe mikä. Löydätkö virheen?\n\nTehtävä: Ruudukossa on kokonaislukuja (myös negatiivisia). Palauta suurin mahdollinen polun arvojen summa, kun liikutaan vasemmasta yläkulmasta oikeaan alakulmaan vain oikealle tai alas, molemmat kulmat ...
{ "kind": "code.debug.drop_stmt.grid_paths", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 14, "entry": "best_path", "checked_by": "buggy code fails on [[[5]]]...; fix == verified reference (oracle-checked on 17 inputs)", "problem_id": "88866def76ad...
codedebug-train-000703
[ { "role": "user", "content": "Kun ajan `longest_palindrome_len('a')`, ohjelma kaatuu tällä virheilmoituksella. Mistä on kyse ja miten korjaan sen?\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 11, in <module>\n longest_palindrome_len('a')\n ~~~~~~~~~~~~~~~~~~~~~~^^^^^\n Fil...
{ "kind": "code.debug.drop_stmt.palindromes", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 4, "entry": "longest_palindrome_len", "checked_by": "buggy code fails on [\"a\"]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_id...
codedebug-train-000704
[ { "role": "user", "content": "Please review this solution: there is a bug somewhere. Find it, show an input that fails, and fix it.\n\nTask: Given a list `nums` and a window size `k` (1 <= k <= len(nums)), return the largest value in every window of `k` consecutive elements, from left to right. The list can...
{ "kind": "code.debug.index_swap.window_extreme", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 12, "entry": "window_maxima", "checked_by": "buggy code fails on [[-3, -4], 2]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id"...
codedebug-train-000705
[ { "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.arith_flip.range_sum", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 22, "entry": "RangeSum", "checked_by": "buggy code fails on {\"init\": [[7, 6, -4, 3, -1, 0]], \"ops\": [[\"query\", 1, 5], [\"...; fix == verified reference (o...
codedebug-train-000706
[ { "role": "user", "content": "My solution gives the wrong answer: `num_islands(['11111'])` should be `1`, I get `5`. 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, vertic...
{ "kind": "code.debug.cmp_flip.count_islands", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 19, "entry": "num_islands", "checked_by": "buggy code fails on [[\"11111\"]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "75d0...
codedebug-train-000707
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `best_path([[5]])` palauttaa `6` eikä `5`. Etsi ja korjaa virhe.\n\nTehtävä: Ruudukossa on kokonaislukuja (myös negatiivisia). Palauta suurin mahdollinen polun arvojen summa, kun liikutaan vasemmasta yläkulmasta oikeaan alakulma...
{ "kind": "code.debug.init_change.grid_paths", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 7, "entry": "best_path", "checked_by": "buggy code fails on [[[5]]]...; fix == verified reference (oracle-checked on 17 inputs)", "problem_id": "88866def76ad"...
codedebug-train-000708
[ { "role": "user", "content": "Running `weighted_edit_distance('', '')` 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 weighted_edit_distance('', '')\n ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^\n File \"...
{ "kind": "code.debug.arith_flip.edit_distance", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 3, "entry": "weighted_edit_distance", "checked_by": "buggy code fails on [\"\", \"\"]...; fix == verified reference (oracle-checked on 18 inputs)", "pr...
codedebug-train-000709
[ { "role": "user", "content": "I get an exception for `lcs_length('abc', 'abc')`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 11, in <module>\n lcs_length('abc', 'abc')\n ~~~~~~~~~~^^^^^^^^^^^^^^\n File \"solution.py\", line 6, in lcs_length\n cur[j] = prev[j - 1] + 1 i...
{ "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 [\"abc\", \"abc\"]...; fix == verified reference (oracle-checked on 20 inputs)", "proble...
codedebug-train-000710
[ { "role": "user", "content": "Ratkaisuni antaa väärän vastauksen: `max_square_area([1])` pitäisi olla `1`, saan `0`. Mikä on vialla?\n\nTehtävä: `heights[i]` on histogrammin pylvään `i` korkeus; jokainen pylväs on 1 leveä, ja pylväät ovat vierekkäin. Palauta suurimman pylväiden sisään mahtuvan akselien suun...
{ "kind": "code.debug.minmax_swap.histogram", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 13, "entry": "max_square_area", "checked_by": "buggy code fails on [[1]]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id": "cd7bb6afd...
codedebug-train-000711
[ { "role": "user", "content": "Running `count_components(1, [[0, 0]])` crashes with this traceback. What's going on and how do I fix it?\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 22, in <module>\n count_components(1, [[0, 0]])\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^\n File \"sol...
{ "kind": "code.debug.drop_stmt.union_find", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 13, "entry": "count_components", "checked_by": "buggy code fails on [1, [[0, 0]]]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_id...
codedebug-train-000712
[ { "role": "user", "content": "Running `sliding_max([5], 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 15, in <module>\n sliding_max([5], 1)\n ~~~~~~~~~~~^^^^^^^^\n File \"solution.py\", line 9, in sliding...
{ "kind": "code.debug.drop_stmt.window_extreme", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 8, "entry": "sliding_max", "checked_by": "buggy code fails on [[5], 1]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "c24...
codedebug-train-000713
[ { "role": "user", "content": "This is supposed to solve the task below, but `count_islands(['000'])` returns `3` instead of `0`. Find and fix 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 ...
{ "kind": "code.debug.bool_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": "f54...
codedebug-train-000714
[ { "role": "user", "content": "Here is my solution. Something is wrong but I can't see it. Can you find the bug?\n\nTask: Return how many non-empty substrings of `s` (counted by position) read the same backwards. `s` can be several thousand characters long, so checking every substring separately is too slow....
{ "kind": "code.debug.drop_stmt.palindromes", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 7, "entry": "palindromic_substrings", "checked_by": "buggy code fails on [\"baa\"]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_id"...
codedebug-train-000715
[ { "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 counter-clockwise (down the left column first), ending at the centre.\n\n```pyth...
{ "kind": "code.debug.cmp_flip.spiral", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 6, "entry": "spiral", "checked_by": "buggy code fails on [[[1]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "af4362bd16a8", "pro...
codedebug-train-000716
[ { "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 or touch (sharing only an endpoint counts, so [1, ...
{ "kind": "code.debug.cmp_flip.merge_intervals", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 8, "entry": "merge_ranges", "checked_by": "buggy code fails on [[[1, 3], [3, 5]]]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_i...
codedebug-train-000717
[ { "role": "user", "content": "My solution gives the wrong answer: `min_meeting_rooms([[0, 1]])` should be `1`, I get `0`. What's wrong?\n\nTask: Each meeting is `[start, end)`: it occupies a room from `start` up to, but not including, `end`. Return the minimum number of rooms needed so that no two meetings ...
{ "kind": "code.debug.drop_stmt.meeting_rooms", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 9, "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-000718
[ { "role": "user", "content": "Here is my solution. Something is wrong but I can't see it. Can you find the bug?\n\nTask: A directed graph has `n` nodes (0..n-1) and edges `[u, v, w]` from `u` to `v` with weight `w >= 1`. Return the length of the shortest path from `src` to `dst`, or -1 if `dst` cannot be re...
{ "kind": "code.debug.arith_flip.dijkstra", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 19, "entry": "fastest_route", "checked_by": "buggy code fails on [3, [[0, 1, 5], [1, 2, 5], [0, 2, 20]], 0, 2]...; fix == verified reference (oracle-checked on 2...
codedebug-train-000719
[ { "role": "user", "content": "I get an exception for `islands(['11'])`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 24, in <module>\n islands(['11'])\n ~~~~~~~^^^^^^^^\n File \"solution.py\", line 17, in islands\n ny, nx = y + dy, x + dx\n ^\nNameError: nam...
{ "kind": "code.debug.drop_stmt.count_islands", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 16, "entry": "islands", "checked_by": "buggy code fails on [[\"11\"]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "49595...
codedebug-train-000720
[ { "role": "user", "content": "Please review this solution: there is a bug somewhere. Find it, show an input that fails, and fix it.\n\nTask: Given a list `nums` and a window size `k` (1 <= k <= len(nums)), return the smallest value in every window of `k` consecutive elements, from left to right. The list ca...
{ "kind": "code.debug.cmp_flip.window_extreme", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 13, "entry": "window_minima", "checked_by": "buggy code fails on [[5], 1]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "8880...
codedebug-train-000721
[ { "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.arith_flip.expr_eval", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 50, "entry": "calc", "checked_by": "buggy code fails on [\"2 - 3 - 4\"]...; fix == verified reference (oracle-checked on 22 inputs)", "problem_id": "2918dd17e...
codedebug-train-000722
[ { "role": "user", "content": "My solution gives the wrong answer: `coin_combinations([5, 8], 16)` should be `1`, I get `0`. What's wrong?\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...
{ "kind": "code.debug.off_by_one.coin_change", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 5, "entry": "coin_combinations", "checked_by": "buggy code fails on [[5, 8], 16]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "...
codedebug-train-000723
[ { "role": "user", "content": "This is supposed to solve the task below, but `spiral([[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 counter-clockwise (down the left column fir...
{ "kind": "code.debug.off_by_one.spiral", "lang": "en", "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-000724
[ { "role": "user", "content": "Tässä ratkaisuni. Jokin on vialla, mutta en näe mikä. Löydätkö virheen?\n\nTehtävä: Palauta `rows × cols` -matriisin kaikki alkiot spiraalijärjestyksessä alkaen vasemmasta yläkulmasta ja kulkien vastapäivään (ensin alas vasenta saraketta) keskustaan asti.\n\n```python\ndef spir...
{ "kind": "code.debug.off_by_one.spiral", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 12, "entry": "spiral", "checked_by": "buggy code fails on [[[1, 9], [7, 7], [1, 1]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": ...
codedebug-train-000725
[ { "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 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```python\ndef count...
{ "kind": "code.debug.cmp_flip.inversions", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 3, "entry": "count_big_inversions", "checked_by": "buggy code fails on [[1]]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id": "ee315...
codedebug-train-000726
[ { "role": "user", "content": "My solution gives the wrong answer: `merge([[1, 3], [3, 5]])` should be `[[1, 5]]`, I get `[[1, 3], [3, 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 or touch...
{ "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": "7ce5...
codedebug-train-000727
[ { "role": "user", "content": "Here is my solution. Something is wrong but I can't see it. Can you find the bug?\n\nTask: Return the length of the longest substring of `s` that contains at most `k` distinct characters (`k >= 0`). `s` can be hundreds of thousands of characters long.\n\n```python\nfrom collect...
{ "kind": "code.debug.cmp_flip.longest_window", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 12, "entry": "longest_with_k_kinds", "checked_by": "buggy code fails on [\"a\", 0]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_i...
codedebug-train-000728
[ { "role": "user", "content": "Saan poikkeuksen kutsulla `merge([[4, 5], [5, 7]])`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 12, in <module>\n merge([[4, 5], [5, 7]])\n ~~~~~^^^^^^^^^^^^^^^^^^\n File \"solution.py\", line 5, in merge\n if merged or start <= merged[-1...
{ "kind": "code.debug.bool_flip.merge_intervals", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 5, "entry": "merge", "checked_by": "buggy code fails on [[[4, 5], [5, 7]]]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id":...
codedebug-train-000729
[ { "role": "user", "content": "My solution gives the wrong answer: `sliding_max([5], 1)` should be `[5]`, 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 can ...
{ "kind": "code.debug.cmp_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": "13c182de...
codedebug-train-000730
[ { "role": "user", "content": "My solution gives the wrong answer: `max_square_area([2, 0])` 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": 9, "entry": "max_square_area", "checked_by": "buggy code fails on [[2, 0]]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id": "cd7bb6afd...
codedebug-train-000731
[ { "role": "user", "content": "I get an exception for `inversion_count([3, 2, 1])`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 25, in <module>\n inversion_count([3, 2, 1])\n ~~~~~~~~~~~~~~~^^^^^^^^^^^\n File \"solution.py\", line 22, in inversion_count\n return sort_co...
{ "kind": "code.debug.cmp_flip.inversions", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 11, "entry": "inversion_count", "checked_by": "buggy code fails on [[3, 2, 1]]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id": "...
codedebug-train-000732
[ { "role": "user", "content": "My solution gives the wrong answer: `weighted_edit_distance('bc', 'd')` should be `5`, I get `2`. What's wrong?\n\nTask: Turn string `a` into string `b`. Inserting a character costs 1, deleting one costs 3, and replacing one character with a different one costs 2. Return the mi...
{ "kind": "code.debug.off_by_one.edit_distance", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 4, "entry": "weighted_edit_distance", "checked_by": "buggy code fails on [\"bc\", \"d\"]...; fix == verified reference (oracle-checked on 18 inputs)", "prob...
codedebug-train-000733
[ { "role": "user", "content": "This is supposed to solve the task below, but `evaluate('9')` raises `IndexError: list index out of range` instead of returning `9`. 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 [\"9\"]...; fix == verified reference (oracle-checked on 22 inputs)", "problem_id": "2918dd17ef27", ...
codedebug-train-000734
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `weighted_edit_distance('a', 'b')` palauttaa `0` eikä `4`. Etsi ja korjaa virhe.\n\nTehtävä: Muuta merkkijono `a` merkkijonoksi `b`. Merkin lisääminen maksaa 3, poistaminen 2 ja merkin korvaaminen eri merkillä 4. Palauta pienin ...
{ "kind": "code.debug.cmp_flip.edit_distance", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 7, "entry": "weighted_edit_distance", "checked_by": "buggy code fails on [\"a\", \"b\"]...; fix == verified reference (oracle-checked on 18 inputs)", "problem...
codedebug-train-000735
[ { "role": "user", "content": "This is supposed to solve the task below, but `sliding_max([1, 9, 8, 4], 2)` returns `[9, 9, 9]` instead of `[9, 9, 8]`. 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 e...
{ "kind": "code.debug.cmp_flip.window_extreme", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 11, "entry": "sliding_max", "checked_by": "buggy code fails on [[1, 9, 8, 4], 2]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": ...
codedebug-train-000736
[ { "role": "user", "content": "Kun ajan `count_inversions([1, 2, 3])`, ohjelma kaatuu tällä virheilmoituksella. Mistä on kyse ja miten korjaan sen?\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 25, in <module>\n count_inversions([1, 2, 3])\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^\n Fil...
{ "kind": "code.debug.bool_flip.inversions", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 11, "entry": "count_inversions", "checked_by": "buggy code fails on [[1, 2, 3]]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id":...
codedebug-train-000737
[ { "role": "user", "content": "My solution gives the wrong answer: `merge_ranges([[1, 4], [1, 2], [1, 3]])` should be `[[1, 4]]`, I get `[[1, 2]]`. 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 b...
{ "kind": "code.debug.minmax_swap.merge_intervals", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 9, "entry": "merge_ranges", "checked_by": "buggy code fails on [[[1, 4], [1, 2], [1, 3]]]...; fix == verified reference (oracle-checked on 19 inputs)", "...
codedebug-train-000738
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `min_coins([2], 3)` palauttaa `2` eikä `-1`. Etsi ja korjaa virhe.\n\nTehtävä: Annettuna erisuuruiset positiiviset kolikkoarvot (jokaista rajattomasti) ja summa, palauta pienin määrä kolikoita, joiden summa on täsmälleen annettu...
{ "kind": "code.debug.arith_flip.coin_change", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 2, "entry": "min_coins", "checked_by": "buggy code fails on [[2], 3]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "9d7f7ca67fff...
codedebug-train-000739
[ { "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 lowercase letters. Replace each run of equal letters with the letter and the run length (a run of length 1 is written as just the letter). Example: 'aaab' becomes a3b.\n...
{ "kind": "code.debug.cmp_flip.rle", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 3, "entry": "run_length", "checked_by": "buggy code fails on [\"\"]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "29749195abb7", "pro...
codedebug-train-000740
[ { "role": "user", "content": "I get an exception for `obj = PointUpdateSums([5]); obj.query(0, 0); obj.update(0, -3); obj.query(0, 0)`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 29, in <module>\n obj = PointUpdateSums([5])\n File \"solution.py\", line 7, in __init__\n s...
{ "kind": "code.debug.arith_flip.range_sum", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 5, "entry": "PointUpdateSums", "checked_by": "buggy code fails on {\"init\": [[5]], \"ops\": [[\"query\", 0, 0], [\"update\", 0, -3], ...; fix == verified re...
codedebug-train-000741
[ { "role": "user", "content": "Please review this solution: there is a bug somewhere. Find it, show an input that fails, and fix it.\n\nTask: Return the length of the longest substring of `s` that contains at most `k` distinct characters (`k >= 0`). `s` can be hundreds of thousands of characters long.\n\n```...
{ "kind": "code.debug.arith_flip.longest_window", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 15, "entry": "longest_k_distinct", "checked_by": "buggy code fails on [\"b\", 2]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_i...
codedebug-train-000742
[ { "role": "user", "content": "I get an exception for `lcs_length('ca', 'cb')`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 11, in <module>\n lcs_length('ca', 'cb')\n ~~~~~~~~~~^^^^^^^^^^^^\n File \"solution.py\", line 6, in lcs_length\n cur[j] = prev[j - 1] + 1 if ca =...
{ "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 [\"ca\", \"cb\"]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_...
codedebug-train-000743
[ { "role": "user", "content": "My solution gives the wrong answer: `eval_expression('7 / -2')` should be `-3`, I get `5`. 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.cmp_flip.expr_eval", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 15, "entry": "eval_expression", "checked_by": "buggy code fails on [\"7 / -2\"]...; fix == verified reference (oracle-checked on 22 inputs)", "problem_id": "ba1b3...
codedebug-train-000744
[ { "role": "user", "content": "I get an exception for `count_inversions([1])`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 25, in <module>\n count_inversions([1])\n ~~~~~~~~~~~~~~~~^^^^^\n File \"solution.py\", line 22, in count_inversions\n return sort_count(list(a))[1...
{ "kind": "code.debug.cmp_flip.inversions", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 3, "entry": "count_inversions", "checked_by": "buggy code fails on [[1]]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id": "ee7e58...
codedebug-train-000745
[ { "role": "user", "content": "My solution gives the wrong answer: `max_square_area([])` should be `0`, I get `1`. 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 inside ...
{ "kind": "code.debug.init_change.histogram", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 3, "entry": "max_square_area", "checked_by": "buggy code fails on [[]]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id": "d87fffcb5cc...
codedebug-train-000746
[ { "role": "user", "content": "Ratkaisuni antaa väärän vastauksen: `num_islands(['10111'])` pitäisi olla `2`, saan `0`. Mikä on vialla?\n\nTehtävä: Ruudukko on lista yhtä pitkiä merkkijonoja, joissa '1' on maata ja '0' vettä. Kaksi maaruutua kuuluu samaan saareen, kun ne ovat vierekkäin vaaka- tai pystysuunn...
{ "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 [[\"10111\"]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "f54...
codedebug-train-000747
[ { "role": "user", "content": "Running `transform_cost('d', 'dc')` 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('d', 'dc')\n ~~~~~~~~~~~~~~^^^^^^^^^^^\n File \"solution.py\", ...
{ "kind": "code.debug.arith_flip.edit_distance", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 7, "entry": "transform_cost", "checked_by": "buggy code fails on [\"d\", \"dc\"]...; fix == verified reference (oracle-checked on 18 inputs)", "problem...
codedebug-train-000748
[ { "role": "user", "content": "Here is my solution. Something is wrong but I can't see it. Can you find the bug?\n\nTask: Return True if `s` can be split into a sequence of one or more words from `words` (each word can be used any number of times), and False otherwise. The empty string counts as splittable. ...
{ "kind": "code.debug.arith_flip.word_break", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 9, "entry": "can_segment", "checked_by": "buggy code fails on [\"cccc\", [\"cc\"]]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_id"...
codedebug-train-000749
[ { "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 True if `s` can be split into a sequence of one or more words from `words` (each word can be used any number of times), and False otherwise. The empty string co...
{ "kind": "code.debug.off_by_one.word_break", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 8, "entry": "word_break", "checked_by": "buggy code fails on [\"aaaa\", [\"a\", \"aa\"]]...; fix == verified reference (oracle-checked on 20 inputs)", "probl...
codedebug-train-000750
[ { "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 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 the values on the pat...
{ "kind": "code.debug.arith_flip.grid_paths", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 14, "entry": "max_path_sum", "checked_by": "buggy code fails on [[[5]]]...; fix == verified reference (oracle-checked on 17 inputs)", "problem_id": "88866def...
codedebug-train-000751
[ { "role": "user", "content": "Here is my solution. Something is wrong but I can't see it. Can you find the bug?\n\nTask: Given distinct positive coin values (unlimited supply of each) and an amount, return the fewest coins that add up to exactly the amount, or -1 if it cannot be made. An amount of 0 needs 0...
{ "kind": "code.debug.arith_flip.coin_change", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 4, "entry": "min_coins", "checked_by": "buggy code fails on [[5, 9], 14]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "9d7f7c...
codedebug-train-000752
[ { "role": "user", "content": "My solution gives the wrong answer: `min_word_split('a', [])` should be `-1`, I get `0`. 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 str...
{ "kind": "code.debug.index_swap.word_break", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 7, "entry": "min_word_split", "checked_by": "buggy code fails on [\"a\", []]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_id": "80e4a...
codedebug-train-000753
[ { "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.bool_flip.rle", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 5, "entry": "compress", "checked_by": "buggy code fails on [\"a\"]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "29749195abb7", "pro...
codedebug-train-000754
[ { "role": "user", "content": "I get an exception for `rooms_needed([[0, 1]])`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 14, in <module>\n rooms_needed([[0, 1]])\n ~~~~~~~~~~~~^^^^^^^^^^\n File \"solution.py\", line 7, in rooms_needed\n if ends or ends[0] <= start:\n...
{ "kind": "code.debug.bool_flip.meeting_rooms", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 7, "entry": "rooms_needed", "checked_by": "buggy code fails on [[[0, 1]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "a...
codedebug-train-000755
[ { "role": "user", "content": "Ratkaisuni antaa väärän vastauksen: `best_load([5], [10], 5)` pitäisi olla `10`, saan `0`. Mikä on vialla?\n\nTehtävä: Esine i painaa `weights[i]` ja on arvoltaan `values[i]` (kaikki positiivisia kokonaislukuja). Palauta suurin kokonaisarvo, jonka kokonaispaino on enintään `cap...
{ "kind": "code.debug.cmp_flip.knapsack", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 5, "entry": "best_load", "checked_by": "buggy code fails on [[5], [10], 5]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "bbd68164927...
codedebug-train-000756
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `weighted_edit_distance('ba', 'b')` palauttaa `0` eikä `3`. Etsi ja korjaa virhe.\n\nTehtävä: Muuta merkkijono `a` merkkijonoksi `b`. Merkin lisääminen maksaa 1, poistaminen 3 ja merkin korvaaminen eri merkillä 4. Palauta pienin...
{ "kind": "code.debug.drop_stmt.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 [\"ba\", \"b\"]...; fix == verified reference (oracle-checked on 18 inputs)", "probl...
codedebug-train-000757
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `max_value([5], [10], 5)` palauttaa `0` eikä `10`. Etsi ja korjaa virhe.\n\nTehtävä: Esine i painaa `weights[i]` ja on arvoltaan `values[i]` (kaikki positiivisia kokonaislukuja). Palauta suurin kokonaisarvo, jonka kokonaispaino ...
{ "kind": "code.debug.cmp_flip.knapsack", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 5, "entry": "max_value", "checked_by": "buggy code fails on [[5], [10], 5]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "bbd68164927...
codedebug-train-000758
[ { "role": "user", "content": "This is supposed to solve the task below, but `count_primes(59, 80)` raises `ValueError: attempt to assign bytes of size 38 to extended slice of size 39` instead of returning `6`. Find and fix the bug.\n\nTask: Return how many prime numbers `p` satisfy `lo <= p <= hi`. `lo` can...
{ "kind": "code.debug.off_by_one.primes_range", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 9, "entry": "count_primes", "checked_by": "buggy code fails on [59, 80]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "fcfb2ec4...
codedebug-train-000759
[ { "role": "user", "content": "My solution gives the wrong answer: `count_inversions([-5, 0, -6, -3])` should be `3`, I get `5`. What's wrong?\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 pair is too slo...
{ "kind": "code.debug.arith_flip.inversions", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 17, "entry": "count_inversions", "checked_by": "buggy code fails on [[-5, 0, -6, -3]]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id...
codedebug-train-000760
[ { "role": "user", "content": "This is supposed to solve the task below, but `spiral_order([[5, 9, 4], [9, 5, 5]])` returns `[5, 9, 4, 5, 5]` instead of `[5, 9, 4, 5, 5, 9]`. 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 go...
{ "kind": "code.debug.off_by_one.spiral", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 10, "entry": "spiral_order", "checked_by": "buggy code fails on [[[5, 9, 4], [9, 5, 5]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id"...
codedebug-train-000761
[ { "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 3 ja merkin korvaaminen eri merkillä 1. Palauta pienin kokonaiskustannus.\n\n```pyth...
{ "kind": "code.debug.arith_flip.edit_distance", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 8, "entry": "transform_cost", "checked_by": "buggy code fails on [\"c\", \"cbdbb\"]...; fix == verified reference (oracle-checked on 18 inputs)", "problem...
codedebug-train-000762
[ { "role": "user", "content": "My solution gives the wrong answer: `weighted_edit_distance('bd', '')` should be `4`, I get `0`. 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 min...
{ "kind": "code.debug.drop_stmt.edit_distance", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 9, "entry": "weighted_edit_distance", "checked_by": "buggy code fails on [\"bd\", \"\"]...; fix == verified reference (oracle-checked on 18 inputs)", "proble...
codedebug-train-000763
[ { "role": "user", "content": "This is supposed to solve the task below, but `max_square_area([4])` returns `0` instead of `1`. Find and fix the bug.\n\nTask: `heights[i]` is the height of bar `i` in a histogram; every bar is 1 wide and bars stand side by side. Return the area of the largest axis-aligned squ...
{ "kind": "code.debug.drop_stmt.histogram", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 10, "entry": "max_square_area", "checked_by": "buggy code fails on [[4]]...; fix == verified reference (oracle-checked on 21 inputs)", "problem_id": "d87fffcb5cc...
codedebug-train-000764
[ { "role": "user", "content": "Tässä ratkaisuni. Jokin on vialla, mutta en näe mikä. Löydätkö virheen?\n\nTehtävä: Palauta montako merkkijonon `s` epätyhjää osajonoa (paikan mukaan laskettuna) on sama takaperin luettuna. `s` voi olla tuhansia merkkejä pitkä, joten jokaisen osajonon tarkistaminen erikseen on ...
{ "kind": "code.debug.drop_stmt.palindromes", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 6, "entry": "count_palindromes", "checked_by": "buggy code fails on [\"a\"]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_id": "d8eb...
codedebug-train-000765
[ { "role": "user", "content": "My solution gives the wrong answer: `weighted_edit_distance('a', 'abdd')` should be `3`, I get `0`. What's wrong?\n\nTask: Turn string `a` into string `b`. Inserting a character costs 1, deleting one costs 1, and replacing one character with a different one costs 2. Return the ...
{ "kind": "code.debug.arith_flip.edit_distance", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 6, "entry": "weighted_edit_distance", "checked_by": "buggy code fails on [\"a\", \"abdd\"]...; fix == verified reference (oracle-checked on 18 inputs)", "pr...
codedebug-train-000766
[ { "role": "user", "content": "This is supposed to solve the task below, but `word_break('b', ['b'])` returns `False` instead of `True`. Find and fix the bug.\n\nTask: Return True if `s` can be split into a sequence of one or more words from `words` (each word can be used any number of times), and False othe...
{ "kind": "code.debug.off_by_one.word_break", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 7, "entry": "word_break", "checked_by": "buggy code fails on [\"b\", [\"b\"]]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_id": "b1a7...
codedebug-train-000767
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `count_segmentations('aaaa', ['a', 'aa'])` palauttaa `1000000006` eikä `5`. Etsi ja korjaa virhe.\n\nTehtävä: Palauta, kuinka monella eri tavalla `s` voidaan jakaa listan `words` sanoiksi (jokaista sanaa saa käyttää kuinka mones...
{ "kind": "code.debug.arith_flip.word_break", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 12, "entry": "count_segmentations", "checked_by": "buggy code fails on [\"aaaa\", [\"a\", \"aa\"]]...; fix == verified reference (oracle-checked on 20 inputs)", ...
codedebug-train-000768
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `min_coins([3, 5], 15)` palauttaa `-1` eikä `3`. Etsi ja korjaa virhe.\n\nTehtävä: Annettuna erisuuruiset positiiviset kolikkoarvot (jokaista rajattomasti) ja summa, palauta pienin määrä kolikoita, joiden summa on täsmälleen ann...
{ "kind": "code.debug.arith_flip.coin_change", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 4, "entry": "min_coins", "checked_by": "buggy code fails on [[3, 5], 15]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "9d7f7ca6...
codedebug-train-000769
[ { "role": "user", "content": "This is supposed to solve the task below, but `min_ship_capacity([9, 2], 2)` returns `10` instead of `9`. Find and fix the bug.\n\nTask: Packages with weights `weights` must be shipped in the given order within `days` days (1 <= days <= len(weights)). Each day the ship takes a ...
{ "kind": "code.debug.cmp_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 [[9, 2], 2]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "a...
codedebug-train-000770
[ { "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.arith_flip.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 [[10], 10]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "...
codedebug-train-000771
[ { "role": "user", "content": "Ratkaisuni antaa väärän vastauksen: `longest_palindrome_len('a')` pitäisi olla `1`, saan `0`. Mikä on vialla?\n\nTehtävä: Palauta merkkijonon `s` pisimmän sellaisen osajonon pituus, joka on sama takaperin luettuna. `s` voi olla tuhansia merkkejä pitkä, joten jokaisen osajonon t...
{ "kind": "code.debug.arith_flip.palindromes", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 8, "entry": "longest_palindrome_len", "checked_by": "buggy code fails on [\"a\"]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_id": "...
codedebug-train-000772
[ { "role": "user", "content": "This is supposed to solve the task below, but `num_islands(['1', '1'])` returns `2` instead of `1`. Find and fix 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...
{ "kind": "code.debug.bool_flip.count_islands", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 6, "entry": "num_islands", "checked_by": "buggy code fails on [[\"1\", \"1\"]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "7...
codedebug-train-000773
[ { "role": "user", "content": "This is supposed to solve the task below, but `rooms_needed([[3, 4], [18, 23]])` returns `2` instead of `1`. Find and fix the bug.\n\nTask: Each meeting is `[start, end)`: it occupies a room from `start` up to, but not including, `end`. Return the minimum number of rooms needed...
{ "kind": "code.debug.drop_stmt.meeting_rooms", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 5, "entry": "rooms_needed", "checked_by": "buggy code fails on [[[3, 4], [18, 23]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id...
codedebug-train-000774
[ { "role": "user", "content": "Please review this solution: there is a bug somewhere. Find it, show an input that fails, and fix it.\n\nTask: Return the length of the longest substring of `s` that reads the same backwards. `s` can be several thousand characters long, so checking every substring separately is...
{ "kind": "code.debug.cmp_flip.palindromes", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 5, "entry": "longest_palindrome_len", "checked_by": "buggy code fails on [\"a\"]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_id": "...
codedebug-train-000775
[ { "role": "user", "content": "Here is my solution. Something is wrong but I can't see it. Can you find the bug?\n\nTask: A robot starts at (0, 0) facing north. Commands: `-2` turns left 90°, `-1` turns right 90°, and `k` (1-9) moves forward k unit steps. If the next square is an obstacle, the robot stays wh...
{ "kind": "code.debug.arith_flip.robot_walk", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 13, "entry": "robot_max_distance", "checked_by": "buggy code fails on [[-1, -1, -2, -2, 1, -2, 4], [[-3, 1]]]...; fix == verified reference (oracle-checked on ...
codedebug-train-000776
[ { "role": "user", "content": "This is supposed to solve the task below, but `count_islands(['01110'])` returns `3` instead of `1`. Find and fix 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 othe...
{ "kind": "code.debug.bool_flip.count_islands", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 6, "entry": "count_islands", "checked_by": "buggy code fails on [[\"01110\"]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "75...
codedebug-train-000777
[ { "role": "user", "content": "Ratkaisuni kaatuu: `sliding_min([3], 1)` pitäisi palauttaa `[3]`, 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 ikkunan pieni...
{ "kind": "code.debug.arith_flip.window_extreme", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 10, "entry": "sliding_min", "checked_by": "buggy code fails on [[3], 1]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "3d3c27...
codedebug-train-000778
[ { "role": "user", "content": "My solution gives the wrong answer: `can_segment('caa', ['ca', 'a'])` should be `True`, I get `False`. What's wrong?\n\nTask: Return True if `s` can be split into a sequence of one or more words from `words` (each word can be used any number of times), and False otherwise. The ...
{ "kind": "code.debug.off_by_one.word_break", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 8, "entry": "can_segment", "checked_by": "buggy code fails on [\"caa\", [\"ca\", \"a\"]]...; fix == verified reference (oracle-checked on 20 inputs)", "problem...
codedebug-train-000779
[ { "role": "user", "content": "My solution gives the wrong answer: `segment_ways('', [])` should be `1`, I get `0`. What's wrong?\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 o...
{ "kind": "code.debug.init_change.word_break", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 7, "entry": "segment_ways", "checked_by": "buggy code fails on [\"\", []]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_id": "661c665...
codedebug-train-000780
[ { "role": "user", "content": "Running `evaluate('9 * 9')` 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 55, in <module>\n evaluate('9 * 9')\n ~~~~~~~~^^^^^^^^^\n File \"solution.py\", line 52, in evaluate\n ...
{ "kind": "code.debug.drop_stmt.expr_eval", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 38, "entry": "evaluate", "checked_by": "buggy code fails on [\"9 * 9\"]...; fix == verified reference (oracle-checked on 22 inputs)", "problem_id": "2918dd1...
codedebug-train-000781
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `best_path([[1, 2, 3]])` palauttaa `3` eikä `6`. Etsi ja korjaa virhe.\n\nTehtävä: Ruudukossa on kokonaislukuja (myös negatiivisia). Palauta suurin mahdollinen polun arvojen summa, kun liikutaan vasemmasta yläkulmasta oikeaan al...
{ "kind": "code.debug.cmp_flip.grid_paths", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 6, "entry": "best_path", "checked_by": "buggy code fails on [[[1, 2, 3]]]...; fix == verified reference (oracle-checked on 17 inputs)", "problem_id": "88866def76...
codedebug-train-000782
[ { "role": "user", "content": "This is supposed to solve the task below, but `primes_between(2, 2)` returns `0` instead of `1`. Find and fix the bug.\n\nTask: Return how many prime numbers `p` satisfy `lo <= p <= hi`. `lo` can be negative and `lo > hi` means an empty range. `hi` can be up to 8,000,000.\n\n``...
{ "kind": "code.debug.index_swap.primes_range", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 5, "entry": "primes_between", "checked_by": "buggy code fails on [2, 2]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "fcfb2ec4...
codedebug-train-000783
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `max_profit_with_fee([2], 1)` 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, mutta voit omistaa enintään yhden osakkeen kerrall...
{ "kind": "code.debug.minmax_swap.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 [[2], 1]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "...
codedebug-train-000784
[ { "role": "user", "content": "Ratkaisuni antaa väärän vastauksen: `window_minima([-6, -3, -8], 2)` pitäisi olla `[-6, -8]`, saan `[-3, -8]`. 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 vasemmalta oike...
{ "kind": "code.debug.index_swap.window_extreme", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 14, "entry": "window_minima", "checked_by": "buggy code fails on [[-6, -3, -8], 2]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_i...
codedebug-train-000785
[ { "role": "user", "content": "Please review this solution: there is a bug somewhere. Find it, show an input that fails, and fix it.\n\nTask: A robot starts at (0, 0) facing north. Commands: `-2` turns left 90°, `-1` turns right 90°, and `k` (1-9) moves forward k unit steps. If the next square is an obstacle...
{ "kind": "code.debug.arith_flip.robot_walk", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 13, "entry": "robot_max_distance", "checked_by": "buggy code fails on [[4], [[0, 2]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_...
codedebug-train-000786
[ { "role": "user", "content": "Ratkaisuni antaa väärän vastauksen: `spiral([[8]])` pitäisi olla `[8]`, 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 [[[8]]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "38f2502ba7af", "prog...
codedebug-train-000787
[ { "role": "user", "content": "Tämän pitäisi ratkaista alla oleva tehtävä, mutta `can_segment('a', [])` palauttaa `True` eikä `False`. Etsi ja korjaa virhe.\n\nTehtävä: Palauta True, jos `s` voidaan jakaa yhden tai useamman listan `words` sanan jonoksi (jokaista sanaa saa käyttää kuinka monesti tahansa), ja ...
{ "kind": "code.debug.index_swap.word_break", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 6, "entry": "can_segment", "checked_by": "buggy code fails on [\"a\", []]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_id": "b1a741a9...
codedebug-train-000788
[ { "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.index_swap.word_break", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 7, "entry": "count_segmentations", "checked_by": "buggy code fails on [\"a\", []]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_id":...
codedebug-train-000789
[ { "role": "user", "content": "Please review this solution: there is a bug somewhere. Find it, show an input that fails, and fix it.\n\nTask: Return the number of different ways to split `s` into words from `words` (each word can be used any number of times), modulo 1,000,000,007. The empty string has exactl...
{ "kind": "code.debug.arith_flip.word_break", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 9, "entry": "count_segmentations", "checked_by": "buggy code fails on [\"babababa\", [\"ba\"]]...; fix == verified reference (oracle-checked on 20 inputs)", ...
codedebug-train-000790
[ { "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 coun...
{ "kind": "code.debug.cmp_flip.primes_range", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 2, "entry": "count_primes", "checked_by": "buggy code fails on [2, 2]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": "fcfb2ec4ac...
codedebug-train-000791
[ { "role": "user", "content": "I get an exception for `weighted_edit_distance('cbda', 'c')`:\n\n```\nTraceback (most recent call last):\n File \"solution.py\", line 13, in <module>\n weighted_edit_distance('cbda', 'c')\n ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^\n File \"solution.py\", line 7, in weighted_...
{ "kind": "code.debug.arith_flip.edit_distance", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "traceback", "bug_line": 7, "entry": "weighted_edit_distance", "checked_by": "buggy code fails on [\"cbda\", \"c\"]...; fix == verified reference (oracle-checked on 18 inputs)", ...
codedebug-train-000792
[ { "role": "user", "content": "Here is my solution. Something is wrong but I can't see it. Can you find the bug?\n\nTask: Implement `WordIndex()` with three methods: `insert(word)` adds a word (duplicates count again), `count(word)` returns how many times exactly `word` was inserted, and `starts_with(prefix)...
{ "kind": "code.debug.drop_stmt.prefix_counter", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 10, "entry": "WordIndex", "checked_by": "buggy code fails on {\"init\": [], \"ops\": [[\"insert\", \"abc\"], [\"starts_with\", \"abc...; fix == verified ref...
codedebug-train-000793
[ { "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 or vertically. Return the ...
{ "kind": "code.debug.drop_stmt.count_islands", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 16, "entry": "count_islands", "checked_by": "buggy code fails on [[\"010\"]]...; fix == verified reference (oracle-checked on 18 inputs)", "problem_id": "f...
codedebug-train-000794
[ { "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 pienin arvo vasemmalta oikealle. Listassa voi olla s...
{ "kind": "code.debug.cmp_flip.window_extreme", "lang": "fi", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "nohint", "bug_line": 11, "entry": "sliding_min", "checked_by": "buggy code fails on [[2, -1, 2, -1], 1]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_i...
codedebug-train-000795
[ { "role": "user", "content": "This is supposed to solve the task below, but `segment_ways('cacacaca', ['ca'])` returns `0` instead of `1`. Find and fix 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...
{ "kind": "code.debug.off_by_one.word_break", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 8, "entry": "segment_ways", "checked_by": "buggy code fails on [\"cacacaca\", [\"ca\"]]...; fix == verified reference (oracle-checked on 20 inputs)", "problem_...
codedebug-train-000796
[ { "role": "user", "content": "This is supposed to solve the task below, but `robot_max_distance([4], [[0, 2]])` returns `9` instead of `1`. Find and fix the bug.\n\nTask: A robot starts at (0, 0) facing north. Commands: `-2` turns left 90°, `-1` turns right 90°, and `k` (1-9) moves forward k unit steps. If ...
{ "kind": "code.debug.arith_flip.robot_walk", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 13, "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-000797
[ { "role": "user", "content": "My solution gives the wrong answer: `min_word_split('aaaa', ['a', 'aa'])` should be `2`, 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. T...
{ "kind": "code.debug.off_by_one.word_break", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 8, "entry": "min_word_split", "checked_by": "buggy code fails on [\"aaaa\", [\"a\", \"aa\"]]...; fix == verified reference (oracle-checked on 20 inputs)", "pro...
codedebug-train-000798
[ { "role": "user", "content": "This is supposed to solve the task below, but `min_cost_path(2, [], 0, 1, 3)` raises `NameError: name 'nxt' is not defined` instead of returning `-1`. Find and fix the bug.\n\nTask: There are `n` cities `0..n-1` and one-way flights `[u, v, price]`. Return the cheapest total pri...
{ "kind": "code.debug.drop_stmt.cheapest_path", "lang": "en", "generator": "kreatix-code-debug", "version": "0.1.0", "mode": "fail", "bug_line": 6, "entry": "min_cost_path", "checked_by": "buggy code fails on [2, [], 0, 1, 3]...; fix == verified reference (oracle-checked on 19 inputs)", "problem_id": ...
codedebug-train-000799
[ { "role": "user", "content": "This is supposed to solve the task below, but `weighted_edit_distance('dcaa', 'd')` returns `-6` instead of `6`. Find and fix the bug.\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...
{ "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 [\"dcaa\", \"d\"]...; fix == verified reference (oracle-checked on 18 inputs)", "pr...