task_id
stringlengths
3
77
prompt
listlengths
2
2
entry_point
stringlengths
14
56
test
stringlengths
59
925
completion
stringlengths
83
3.41k
examples
listlengths
1
5
src
stringlengths
199
2.12k
meta
dict
data_source
stringclasses
1 value
ability
stringclasses
1 value
reward_model
dict
extra_info
dict
token_count
int64
158
1.02k
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"functional\": \"_inputs = [['a'], ['aa'], ['baa'], ['aab'], ['baabcd'], ['baablkj12345432133d'], ['I like racecars that go fast'], ['abcdefghba'], [''], ['FourscoreandsevenyearsagoourfaathersbroughtforthonthiscontainentanewnationconceivedinzLibertyanddedicatedtothepropositionthatallmenarecreated...
{ "dataset": "likaixin/TACO-verified", "index": 9619, "prompt": "Solve the programming task below in a Python markdown code block.\n### Longest Palindrome\n\nFind the length of the longest substring in the given string `s` that is the same in reverse. \n\nAs an example, if the input was “I like racecars th...
264
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"3\\n2 -2 2\\n2 0 2\\n150000 48 48\\n\"], \"outputs\": [\"1 0 2 0 1\\n2 0 1\\n122830846\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 2277, "prompt": "Solve the programming task below in a Python markdown code block.\nInitially, there is a magical stone of mass 2^{N} lying at the origin of the number line. For the next N seconds, the following event happens: \n\nLet us define the *decomposition* o...
796
count-of-smaller-numbers-after-self
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
Solution().countSmaller
def check(candidate): assert candidate(nums = [5,2,6,1]) == [2,1,1,0] assert candidate(nums = [-1]) == [0] assert candidate(nums = [-1,-1]) == [0,0]
class BinaryIndexedTree: def __init__(self, n): self.n = n self.c = [0] * (n + 1) @staticmethod def lowbit(x): return x & -x def update(self, x, delta): while x <= self.n: self.c[x] += delta x += BinaryIndexedTree.lowbit(x) def query(self, x...
[ { "input": "nums = [5,2,6,1]", "output": "[2,1,1,0] " }, { "input": "nums = [-1]", "output": "[0]" }, { "input": "nums = [-1,-1]", "output": "[0,0]" } ]
Given an integer array nums, return an integer array counts where counts[i] is the number of smaller elements to the right of nums[i].   Please complete the following python code precisely: ```python class Solution: def countSmaller(self, nums: List[int]) -> List[int]: ```
{ "question_id": 315, "difficulty": "Hard", "lang_code": "class Solution:\n def countSmaller(self, nums: List[int]) -> List[int]:", "question_title": "Given an integer array nums, return an integer array counts where counts[i] is the number of smaller elements to the right of nums[i].\n \nExample 1:\n\nInput...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(nums = [5,2,6,1]) == [2,1,1,0] \\n assert candidate(nums = [-1]) == [0]\\n assert candidate(nums = [-1,-1]) == [0,0]\\n\\n\\ncheck(Solution().countSmaller)\"}", "style": "rule" }
{ "dataset": "LeetCodeDataset", "index": 1573, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nGiven an integer array nums, return an integer array counts where counts[i] is the number of smaller elements to the right of nums[i].\n \nPlease compl...
180
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"ABCDCDC\\nCDC\\n\"], \"outputs\": [\"2\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 200, "prompt": "Solve the programming task below in a Python markdown code block.\nIn this challenge, the user enters a string and a substring. You have to print the number of times that the substring occurs in the given string. String traversal will take place from...
431
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"functional\": \"_inputs = [[[]]]\\n_outputs = [[[]]]\\nimport math\\ndef _deep_eq(a, b, tol=1e-5):\\n if isinstance(a, float) or isinstance(b, float):\\n return math.isclose(a, b, rel_tol=tol, abs_tol=tol)\\n if isinstance(a, (list, tuple)):\\n if len(a) != len(b): return Fal...
{ "dataset": "likaixin/TACO-verified", "index": 7797, "prompt": "Solve the programming task below in a Python markdown code block.\nIn some ranking people collects points. The challenge is sort by points and calulate position for every person. But remember if two or more persons have same number of points, they s...
193
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"2 1 1\\n0\\n\", \"4 100 60\\n0 0 0\\n\", \"5 10 7\\n8 10 3 6\\n\", \"5 20 10\\n7 7 8 8\\n\", \"5 20 10\\n7 7 7 8\\n\", \"5 20 10\\n12 12 12 13\\n\", \"5 20 10\\n12 12 13 13\\n\", \"4 100 60\\n100 100 100\\n\"], \"outputs\": [\"-1\\n\", \"-1\\n\", \"8\\n\", \"20\\n\", \"-1\\n\", \"1\...
{ "dataset": "likaixin/TACO-verified", "index": 5092, "prompt": "Solve the programming task below in a Python markdown code block.\nTakahashi is taking exams on N subjects. The score on each subject will be an integer between 0 and K (inclusive).\nHe has already taken exams on N-1 subjects and scored A_i points o...
408
where-will-the-ball-fall
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
Solution().findBall
def check(candidate): assert candidate(grid = [[1,1,1,-1,-1],[1,1,1,-1,-1],[-1,-1,-1,1,1],[1,1,1,1,-1],[-1,-1,-1,-1,-1]]) == [1,-1,-1,-1,-1] assert candidate(grid = [[-1]]) == [-1] assert candidate(grid = [[1,1,1,1,1,1],[-1,-1,-1,-1,-1,-1],[1,1,1,1,1,1],[-1,-1,-1,-1,-1,-1]]) == [0,1,2,3,4,-1]
class Solution: def findBall(self, grid: List[List[int]]) -> List[int]: def dfs(i: int, j: int) -> int: if i == m: return j if j == 0 and grid[i][j] == -1: return -1 if j == n - 1 and grid[i][j] == 1: return -1 i...
[ { "input": "grid = [[1,1,1,-1,-1],[1,1,1,-1,-1],[-1,-1,-1,1,1],[1,1,1,1,-1],[-1,-1,-1,-1,-1]]", "output": "[1,-1,-1,-1,-1]" }, { "input": "grid = [[-1]]", "output": "[-1]" }, { "input": "grid = [[1,1,1,1,1,1],[-1,-1,-1,-1,-1,-1],[1,1,1,1,1,1],[-1,-1,-1,-1,-1,-1]]", "output": "[0,1,2,...
You have a 2-D grid of size m x n representing a box, and you have n balls. The box is open on the top and bottom sides. Each cell in the box has a diagonal board spanning two corners of the cell that can redirect a ball to the right or to the left. A board that redirects the ball to the right spans the top-left corne...
{ "question_id": 1324, "difficulty": "Medium", "lang_code": "class Solution:\n def findBall(self, grid: List[List[int]]) -> List[int]:", "question_title": "You have a 2-D grid of size m x n representing a box, and you have n balls. The box is open on the top and bottom sides.\nEach cell in the box has a diag...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(grid = [[1,1,1,-1,-1],[1,1,1,-1,-1],[-1,-1,-1,1,1],[1,1,1,1,-1],[-1,-1,-1,-1,-1]]) == [1,-1,-1,-1,-1]\\n assert candidate(grid = [[-1]]) == [-1]\\n assert candidate(grid = [[1,1,1,1,1,1],[-1,-1,-1,-1,-1,-1],[1,1,1,1,1,1],[-1,-1,-...
{ "dataset": "LeetCodeDataset", "index": 1112, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nYou have a 2-D grid of size m x n representing a box, and you have n balls. The box is open on the top and bottom sides.\nEach cell in the box has a di...
383
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"15\\n100\\n1000000000\\n1\\n0\", \"15\\n110\\n1000000000\\n1\\n0\", \"15\\n101\\n1000000000\\n3\\n0\", \"15\\n110\\n1000000000\\n0\\n0\", \"15\\n101\\n1001000000\\n3\\n0\", \"15\\n100\\n1000000000\\n0\\n0\", \"15\\n111\\n1001000000\\n3\\n0\", \"15\\n000\\n1000000000\\n0\\n0\"], \"ou...
{ "dataset": "likaixin/TACO-verified", "index": 11983, "prompt": "Solve the programming task below in a Python markdown code block.\nAn architect, Devunky, who lives in Water Deven, has been asked to renovate an old large hospital.\n\nIn some countries, people don't want to use numbers that are disliked as numero...
634
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"1\\n1\\n2\"], \"outputs\": [\"2\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 1040, "prompt": "Solve the programming task below in a Python markdown code block.\n$Gogi$, $Tapu$ and $Sonu$ are the elite members of $Tapu$ $Sena$. $Gogi$ is always stoned and asks absurd questions, But this time he asked a question which seems to be very serious ...
477
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"2\\n1 2 3\\n3\\n3 1 5 2 6 4 7\\n0\", \"2\\n1 2 3\\n3\\n3 1 1 2 6 4 7\\n0\", \"2\\n1 2 3\\n3\\n3 1 1 2 6 1 8\\n0\", \"2\\n1 2 1\\n3\\n3 1 1 2 3 1 8\\n0\", \"2\\n1 2 3\\n3\\n3 2 1 2 6 1 7\\n0\", \"2\\n1 2 1\\n3\\n4 1 1 2 3 1 8\\n0\", \"2\\n1 2 3\\n3\\n1 2 1 2 6 1 7\\n0\", \"2\\n2 2 3\...
{ "dataset": "likaixin/TACO-verified", "index": 8113, "prompt": "Solve the programming task below in a Python markdown code block.\nGiven a complete binary tree with the height of H, we index the nodes respectively top-down and left-right from 1. The i-th node stores a positive integer V_{i}. Define P_{i} as foll...
461
maximum-sum-of-an-hourglass
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
Solution().maxSum
def check(candidate): assert candidate(grid = [[6,2,1,3],[4,2,1,5],[9,2,8,7],[4,1,2,9]]) == 30 assert candidate(grid = [[1,2,3],[4,5,6],[7,8,9]]) == 35
class Solution: def maxSum(self, grid: List[List[int]]) -> int: m, n = len(grid), len(grid[0]) ans = 0 for i in range(1, m - 1): for j in range(1, n - 1): s = -grid[i][j - 1] - grid[i][j + 1] s += sum( grid[x][y] for x in range(...
[ { "input": "grid = [[6,2,1,3],[4,2,1,5],[9,2,8,7],[4,1,2,9]]", "output": "30" }, { "input": "grid = [[1,2,3],[4,5,6],[7,8,9]]", "output": "35" } ]
You are given an m x n integer matrix grid. We define an hourglass as a part of the matrix with the following form: Return the maximum sum of the elements of an hourglass. Note that an hourglass cannot be rotated and must be entirely contained within the matrix.   Please complete the following python code precisely: `...
{ "question_id": 2508, "difficulty": "Medium", "lang_code": "class Solution:\n def maxSum(self, grid: List[List[int]]) -> int:", "question_title": "You are given an m x n integer matrix grid.\nWe define an hourglass as a part of the matrix with the following form:\n\nReturn the maximum sum of the elements of...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(grid = [[6,2,1,3],[4,2,1,5],[9,2,8,7],[4,1,2,9]]) == 30\\n assert candidate(grid = [[1,2,3],[4,5,6],[7,8,9]]) == 35\\n\\n\\ncheck(Solution().maxSum)\"}", "style": "rule" }
{ "dataset": "LeetCodeDataset", "index": 1221, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nYou are given an m x n integer matrix grid.\nWe define an hourglass as a part of the matrix with the following form:\n\nReturn the maximum sum of the e...
209
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"5\\n1 3 3 4 5\\n4\\n2 3 5 7\\n0\", \"5\\n1 2 3 4 5\\n4\\n2 1 0 7\\n0\", \"5\\n1 2 3 5 5\\n4\\n2 1 0 7\\n0\", \"5\\n1 2 3 5 5\\n4\\n2 1 0 6\\n0\", \"5\\n0 1 3 8 1\\n4\\n5 4 8 7\\n0\", \"5\\n0 1 2 8 1\\n4\\n5 4 8 7\\n0\", \"5\\n0 1 2 8 1\\n4\\n5 4 5 7\\n0\", \"5\\n0 1 2 8 0\\n4\\n5 4 ...
{ "dataset": "likaixin/TACO-verified", "index": 9510, "prompt": "Solve the programming task below in a Python markdown code block.\nBrave Ponta and his best friend, Brave Gonta, have come to Luida's bar in search of friends to embark on an epic adventure. There are many warriors, monks and wizards in the tavern w...
496
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"1\\n2\\nab\\ncd\\n\", \"1\\n2\\nab\\ncc\\n\", \"1\\n2\\nab\\ncc\\n\", \"1\\n2\\nab\\ncd\\n\", \"1\\n2\\nba\\ncc\\n\", \"1\\n2\\nba\\ncb\\n\", \"1\\n2\\nab\\ncb\\n\", \"1\\n2\\naa\\ncb\\n\"], \"outputs\": [\"No\\n\", \"No\\n\", \"No\\n\", \"No\\n\", \"No\\n\", \"No\\n\", \"No\\n\", \...
{ "dataset": "likaixin/TACO-verified", "index": 11484, "prompt": "Solve the programming task below in a Python markdown code block.\nThis problem is different from the hard version. In this version Ujan makes exactly one exchange. You can hack this problem only if you solve both problems.\n\nAfter struggling and ...
588
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"1 0\\n\", \"1 1\\n1\\n\", \"2 2\\n1\\n2\\n\", \"6 3\\n1\\n4\\n5\\n\", \"3 3\\n1\\n2\\n3\\n\", \"4 4\\n1\\n2\\n3\\n4\\n\", \"1000000000 0\\n\", \"5 5\\n1\\n2\\n3\\n4\\n5\\n\"], \"outputs\": [\"1\\n\", \"1\\n1\\n\", \"3\\n1\\n2\\n\", \"17\\n1\\n3\\n4\\n\", \"6\\n1\\n2\\n3\\n\", \"9\\n...
{ "dataset": "likaixin/TACO-verified", "index": 9884, "prompt": "Solve the programming task below in a Python markdown code block.\nLet's say Pak Chanek has an array $A$ consisting of $N$ positive integers. Pak Chanek will do a number of operations. In each operation, Pak Chanek will do the following:\n\nChoose a...
978
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"functional\": \"_inputs = [[[5, 2, -3, -9, -4, 8]], [[5, -42, 2, -3, -4, 8, 9]], [[5, -42, 8, 2, -3, -4, 9]], [[5, -42, -8, 2, -3, -4, -9]], [[5, 2, 3, 4, 8, 9]], [[-5, -2, -3, -4, -8, -9]], [[-5, -2, 3, 4, -8, 0, -9]], [[-5, -2, 3, 9, 4, -2, -8, 0, 9, -9]]]\\n_outputs = [[[-3, 2, -4, 5, -9, 8]]...
{ "dataset": "likaixin/TACO-verified", "index": 8043, "prompt": "Solve the programming task below in a Python markdown code block.\nWrite a function\n```python\nalternate_sort(l)\n```\nthat combines the elements of an array by sorting the elements ascending by their **absolute value** and outputs negative and non...
369
make-k-subarray-sums-equal
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
Solution().makeSubKSumEqual
def check(candidate): assert candidate(arr = [1,4,1,3], k = 2) == 1 assert candidate(arr = [2,5,5,7], k = 3) == 5
class Solution: def makeSubKSumEqual(self, arr: List[int], k: int) -> int: n = len(arr) g = gcd(n, k) ans = 0 for i in range(g): t = sorted(arr[i:n:g]) mid = t[len(t) >> 1] ans += sum(abs(x - mid) for x in t) return ans
[ { "input": "arr = [1,4,1,3], k = 2", "output": "1" }, { "input": "arr = [2,5,5,7], k = 3", "output": "5" } ]
You are given a 0-indexed integer array arr and an integer k. The array arr is circular. In other words, the first element of the array is the next element of the last element, and the last element of the array is the previous element of the first element. You can do the following operation any number of times: Pick a...
{ "question_id": 2670, "difficulty": "Medium", "lang_code": "class Solution:\n def makeSubKSumEqual(self, arr: List[int], k: int) -> int:", "question_title": "You are given a 0-indexed integer array arr and an integer k. The array arr is circular. In other words, the first element of the array is the next el...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(arr = [1,4,1,3], k = 2) == 1\\n assert candidate(arr = [2,5,5,7], k = 3) == 5\\n\\n\\ncheck(Solution().makeSubKSumEqual)\"}", "style": "rule" }
{ "dataset": "LeetCodeDataset", "index": 792, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nYou are given a 0-indexed integer array arr and an integer k. The array arr is circular. In other words, the first element of the array is the next elem...
274
amount-of-new-area-painted-each-day
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
Solution().amountPainted
def check(candidate): assert candidate(paint = [[1,4],[4,7],[5,8]]) == [3,3,1] assert candidate(paint = [[1,4],[5,8],[4,7]]) == [3,3,1] assert candidate(paint = [[1,5],[2,4]]) == [4,0]
class Node: def __init__(self, l, r): self.left = None self.right = None self.l = l self.r = r self.mid = (l + r) >> 1 self.v = 0 self.add = 0 class SegmentTree: def __init__(self): self.root = Node(1, 10**5 + 10) def modify(self, l, r, v, n...
[ { "input": "paint = [[1,4],[4,7],[5,8]]", "output": "[3,3,1]" }, { "input": "paint = [[1,4],[5,8],[4,7]]", "output": "[3,3,1]" }, { "input": "paint = [[1,5],[2,4]]", "output": "[4,0]" } ]
There is a long and thin painting that can be represented by a number line. You are given a 0-indexed 2D integer array paint of length n, where paint[i] = [starti, endi]. This means that on the ith day you need to paint the area between starti and endi. Painting the same area multiple times will create an uneven painti...
{ "question_id": 2297, "difficulty": "Hard", "lang_code": "class Solution:\n def amountPainted(self, paint: List[List[int]]) -> List[int]:", "question_title": "There is a long and thin painting that can be represented by a number line. You are given a 0-indexed 2D integer array paint of length n, where paint...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(paint = [[1,4],[4,7],[5,8]]) == [3,3,1]\\n assert candidate(paint = [[1,4],[5,8],[4,7]]) == [3,3,1]\\n assert candidate(paint = [[1,5],[2,4]]) == [4,0]\\n\\n\\ncheck(Solution().amountPainted)\"}", "style": "rule" }
{ "dataset": "LeetCodeDataset", "index": 1651, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nThere is a long and thin painting that can be represented by a number line. You are given a 0-indexed 2D integer array paint of length n, where paint[i...
276
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"8 3\\n3 0 6\", \"8 3\\n3 1 6\", \"8 4\\n3 1 6\", \"8 4\\n4 1 6\", \"10 3\\n4 4 6\", \"20 3\\n3 5 6\", \"10 3\\n4 0 6\", \"20 3\\n3 3 6\"], \"outputs\": [\"Yes\\n\", \"Yes\\n\", \"Yes\\n\", \"Yes\\n\", \"Yes\\n\", \"No\\n\", \"Yes\\n\", \"No\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 6661, "prompt": "Solve the programming task below in a Python markdown code block.\nRaccoon is fighting with a monster.\nThe health of the monster is H.\nRaccoon can use N kinds of special moves. Using the i-th move decreases the monster's health by A_i.\nThere is n...
376
cousins-in-binary-tree
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
Solution().isCousins
def check(candidate): assert candidate(root = tree_node([1,2,3,4]), x = 4, y = 3) == False assert candidate(root = tree_node([1,2,3,None,4,None,5]), x = 5, y = 4) == True assert candidate(root = tree_node([1,2,3,None,4]), x = 2, y = 3) == False
# Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution: def isCousins(self, root: Optional[TreeNode], x: int, y: int) -> bool: q = deque([(root, None)]) ...
[ { "input": "root = [1,2,3,4], x = 4, y = 3", "output": "false" }, { "input": "root = [1,2,3,null,4,null,5], x = 5, y = 4", "output": "true" }, { "input": "root = [1,2,3,null,4], x = 2, y = 3", "output": "false" } ]
Given the root of a binary tree with unique values and the values of two different nodes of the tree x and y, return true if the nodes corresponding to the values x and y in the tree are cousins, or false otherwise. Two nodes of a binary tree are cousins if they have the same depth with different parents. Note that in ...
{ "question_id": 1035, "difficulty": "Easy", "lang_code": "# Definition for a binary tree node.\n# class TreeNode:\n# def __init__(self, val=0, left=None, right=None):\n# self.val = val\n# self.left = left\n# self.right = right\nclass Solution:\n def isCousins(self, root: Optional[T...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(root = tree_node([1,2,3,4]), x = 4, y = 3) == False\\n assert candidate(root = tree_node([1,2,3,None,4,None,5]), x = 5, y = 4) == True\\n assert candidate(root = tree_node([1,2,3,None,4]), x = 2, y = 3) == False\\n\\n\\ncheck(Sol...
{ "dataset": "LeetCodeDataset", "index": 1648, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nGiven the root of a binary tree with unique values and the values of two different nodes of the tree x and y, return true if the nodes corresponding to...
312
find-right-interval
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
Solution().findRightInterval
def check(candidate): assert candidate(intervals = [[1,2]]) == [-1] assert candidate(intervals = [[3,4],[2,3],[1,2]]) == [-1,0,1] assert candidate(intervals = [[1,4],[2,3],[3,4]]) == [-1,2,-1]
class Solution: def findRightInterval(self, intervals: List[List[int]]) -> List[int]: for i, v in enumerate(intervals): v.append(i) intervals.sort() n = len(intervals) ans = [-1] * n for _, e, i in intervals: j = bisect_left(intervals, [e]) ...
[ { "input": "intervals = [[1,2]]", "output": "[-1]" }, { "input": "intervals = [[3,4],[2,3],[1,2]]", "output": "[-1,0,1]" }, { "input": "intervals = [[1,4],[2,3],[3,4]]", "output": "[-1,2,-1]" } ]
You are given an array of intervals, where intervals[i] = [starti, endi] and each starti is unique. The right interval for an interval i is an interval j such that startj >= endi and startj is minimized. Note that i may equal j. Return an array of right interval indices for each interval i. If no right interval exists ...
{ "question_id": 436, "difficulty": "Medium", "lang_code": "class Solution:\n def findRightInterval(self, intervals: List[List[int]]) -> List[int]:", "question_title": "You are given an array of intervals, where intervals[i] = [starti, endi] and each starti is unique.\nThe right interval for an interval i is...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(intervals = [[1,2]]) == [-1]\\n assert candidate(intervals = [[3,4],[2,3],[1,2]]) == [-1,0,1]\\n assert candidate(intervals = [[1,4],[2,3],[3,4]]) == [-1,2,-1]\\n\\n\\ncheck(Solution().findRightInterval)\"}", "style": "rule" }
{ "dataset": "LeetCodeDataset", "index": 924, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nYou are given an array of intervals, where intervals[i] = [starti, endi] and each starti is unique.\nThe right interval for an interval i is an interval...
240
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"1\\n2 L 2 R 2 L 1\"], \"outputs\": [\"5.0NW\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 8640, "prompt": "Solve the programming task below in a Python markdown code block.\nMr. X stays in a mansion whose door opens in the North. He travels every morning to meet his friend Ms. Y walking a predefined path.\n\nTo cut the distance short, one day he decides ...
421
unique-paths
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
Solution().uniquePaths
def check(candidate): assert candidate(m = 3, n = 7) == 28 assert candidate(m = 3, n = 2) == 3 assert candidate(m = 7, n = 3) == 28 assert candidate(m = 3, n = 3) == 6
class Solution: def uniquePaths(self, m: int, n: int) -> int: f = [[0] * n for _ in range(m)] f[0][0] = 1 for i in range(m): for j in range(n): if i: f[i][j] += f[i - 1][j] if j: f[i][j] += f[i][j - 1] ...
[ { "input": "m = 3, n = 7", "output": "28" }, { "input": "m = 3, n = 2", "output": "3" }, { "input": "m = 7, n = 3", "output": "28" }, { "input": "m = 3, n = 3", "output": "6" } ]
There is a robot on an m x n grid. The robot is initially located at the top-left corner (i.e., grid[0][0]). The robot tries to move to the bottom-right corner (i.e., grid[m - 1][n - 1]). The robot can only move either down or right at any point in time. Given the two integers m and n, return the number of possible uni...
{ "question_id": 62, "difficulty": "Medium", "lang_code": "class Solution:\n def uniquePaths(self, m: int, n: int) -> int:", "question_title": "There is a robot on an m x n grid. The robot is initially located at the top-left corner (i.e., grid[0][0]). The robot tries to move to the bottom-right corner (i.e....
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(m = 3, n = 7) == 28\\n assert candidate(m = 3, n = 2) == 3\\n assert candidate(m = 7, n = 3) == 28\\n assert candidate(m = 3, n = 3) == 6\\n\\n\\ncheck(Solution().uniquePaths)\"}", "style": "rule" }
{ "dataset": "LeetCodeDataset", "index": 759, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nThere is a robot on an m x n grid. The robot is initially located at the top-left corner (i.e., grid[0][0]). The robot tries to move to the bottom-right...
274
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"oh\\n\", \"oh\\n\", \"nh\\n\", \"rhh\\n\", \"rhh\\n\", \"hhr\\n\", \"pezu\\n\", \"kmsk\\n\"], \"outputs\": [\"CHAT WITH HER!\\n\", \"CHAT WITH HER!\\n\", \"CHAT WITH HER!\\n\", \"CHAT WITH HER!\\n\", \"CHAT WITH HER!\\n\", \"CHAT WITH HER!\\n\", \"CHAT WITH HER!\\n\", \"IGNORE HIM!\...
{ "dataset": "likaixin/TACO-verified", "index": 716, "prompt": "Solve the programming task below in a Python markdown code block.\nThose days, many boys use beautiful girls' photos as avatars in forums. So it is pretty hard to tell the gender of a user at the first glance. Last year, our hero went to a forum and ...
500
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"3\\n3\\n100\\n25\\n\", \"3\\n5\\n100\\n25\\n\", \"3\\n5\\n100\\n26\\n\", \"3\\n3\\n100\\n25\\n\", \"100\\n7\\n3\\n7\\n3\\n7\\n3\\n7\\n3\\n7\\n3\\n7\\n3\\n7\\n3\\n7\\n3\\n7\\n3\\n7\\n3\\n7\\n3\\n7\\n3\\n7\\n3\\n7\\n3\\n7\\n3\\n7\\n3\\n7\\n3\\n7\\n3\\n7\\n3\\n7\\n3\\n7\\n3\\n7\\n3\\n7...
{ "dataset": "likaixin/TACO-verified", "index": 455, "prompt": "Solve the programming task below in a Python markdown code block.\nYou have an initially empty cauldron, and you want to brew a potion in it. The potion consists of two ingredients: magic essence and water. The potion you want to brew should contain ...
586
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"XW\", \"XV\", \"VX\", \"YW\", \"WY\", \"VY\", \"YV\", \"YU\"], \"outputs\": [\"No\\n\", \"No\\n\", \"No\\n\", \"No\\n\", \"No\\n\", \"No\\n\", \"No\\n\", \"No\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 10976, "prompt": "Solve the programming task below in a Python markdown code block.\nSnuke built an online judge to hold a programming contest.\n\nWhen a program is submitted to the judge, the judge returns a verdict, which is a two-character string that appears in ...
348
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"1 100\\n79\\n\", \"2 2\\n50 100\\n\", \"2 2\\n49 100\\n\", \"4 1\\n32 100 33 1\\n\", \"4 2\\n32 100 33 1\\n\", \"5 2\\n6 3 33 45 27\\n\", \"5 2\\n3 13 33 45 53\\n\", \"5 2\\n3 13 33 45 27\\n\"], \"outputs\": [\"0\\n\", \"0\\n\", \"1\\n\", \"1\\n\", \"2\\n\", \"0\\n\", \"0\\n\", \"0\...
{ "dataset": "likaixin/TACO-verified", "index": 12050, "prompt": "Solve the programming task below in a Python markdown code block.\nVasya likes taking part in Codeforces contests. When a round is over, Vasya follows all submissions in the system testing tab.\n\nThere are n solutions, the i-th of them should be t...
997
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"2\\n9 1 2\\n123456 123456 123456\"], \"outputs\": [\"45\\n131351258112\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 5406, "prompt": "Solve the programming task below in a Python markdown code block.\nJem is famous for his laziness at school. He always leaves things to last minute. Now Jem has N problems in the assignment of \"Advanced topics in algorithm\" class to solved. The as...
745
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"4\\n3\\n1 2\\n2 3\\n2 4\\n3\\n1 5\\n1 5\\n1 5\\n4\\n1 10\\n1 3\\n4 6\\n7 10\\n4\\n1 10\\n1 3\\n3 6\\n7 10\\n\"], \"outputs\": [\"2\\n2\\n4\\n3\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 951, "prompt": "Solve the programming task below in a Python markdown code block.\nGiven a set of $n$ intervals, find the size of its largest possible subset of intervals such that no three intervals in the subset share a common point.\n\nInput Format\n\nThe first l...
727
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"1 0\\nz\\n\", \"1 1\\ng\\n\", \"1 0\\na\\n\", \"1 1\\nz\\n\", \"1 0\\ng\\n\", \"1 0\\ny\\n\", \"1 1\\nf\\n\", \"1 2\\nf\\n\"], \"outputs\": [\"z\\n\", \"a\\n\", \"a\\n\", \"a\\n\", \"g\\n\", \"y\", \"a\", \"a\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 12421, "prompt": "Solve the programming task below in a Python markdown code block.\nYou are given a matrix of size n × n filled with lowercase English letters. You can change no more than k letters in this matrix.\n\nConsider all paths from the upper left corner to...
584
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"1\\n4 5\\n1 2 3 4\\n2 3 4 5 6\"], \"outputs\": [\"1 5 6\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 3855, "prompt": "Solve the programming task below in a Python markdown code block.\nChef has three baskets and two of them have multiple balls(Natural numbers written on them). The first basket has N balls, the second basket has M balls and the third basket is empty...
376
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"2\\n1 2\\n12\\n4 2\\n4 6 8 2\\n\", \"2\\n1 2\\n12\\n4 2\\n4 6 4 2\\n\", \"2\\n1 2\\n12\\n4 2\\n7 6 4 2\\n\", \"2\\n1 2\\n12\\n4 2\\n7 6 5 2\\n\", \"2\\n1 2\\n12\\n4 2\\n7 6 3 2\\n\", \"2\\n1 2\\n12\\n4 2\\n7 6 6 2\\n\", \"2\\n1 2\\n1\\n4 2\\n2 11 8 2\\n\", \"2\\n1 2\\n12\\n4 4\\n7 6...
{ "dataset": "likaixin/TACO-verified", "index": 3144, "prompt": "Solve the programming task below in a Python markdown code block.\nYou have given an array $a$ of length $n$ and an integer $x$ to a brand new robot. What the robot does is the following: it iterates over the elements of the array, let the current e...
752
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"functional\": \"_inputs = [[2, 1200], [1176, 1200], [2, 100000], [2, 1000000], [100000, 1000000]]\\n_outputs = [[1], [1], [247], [2549], [2302]]\\nimport math\\ndef _deep_eq(a, b, tol=1e-5):\\n if isinstance(a, float) or isinstance(b, float):\\n return math.isclose(a, b, rel_tol=tol, a...
{ "dataset": "likaixin/TACO-verified", "index": 7048, "prompt": "Solve the programming task below in a Python markdown code block.\nConsider the number `1176` and its square (`1176 * 1176) = 1382976`. Notice that:\n\n* the first two digits of `1176` form a prime.\n* the first two digits of the square `1382976` al...
479
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"2\\n1 2 1\\n1 1 1\"], \"outputs\": [\"yes\\nno\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 1727, "prompt": "Solve the programming task below in a Python markdown code block.\nRead problems statements [Mandarin] , [Bengali] , [Hindi] , [Russian] and [Vietnamese] as well.\n\nThere are three friends; let's call them A, B, C. They made the following statement...
639
longest-subsequence-with-limited-sum
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
Solution().answerQueries
def check(candidate): assert candidate(nums = [4,5,2,1], queries = [3,10,21]) == [2,3,4] assert candidate(nums = [2,3,4,5], queries = [1]) == [0]
class Solution: def answerQueries(self, nums: List[int], queries: List[int]) -> List[int]: nums.sort() s = list(accumulate(nums)) return [bisect_right(s, q) for q in queries]
[ { "input": "nums = [4,5,2,1], queries = [3,10,21]", "output": "[2,3,4]" }, { "input": "nums = [2,3,4,5], queries = [1]", "output": "[0]" } ]
You are given an integer array nums of length n, and an integer array queries of length m. Return an array answer of length m where answer[i] is the maximum size of a subsequence that you can take from nums such that the sum of its elements is less than or equal to queries[i]. A subsequence is an array that can be deri...
{ "question_id": 2469, "difficulty": "Easy", "lang_code": "class Solution:\n def answerQueries(self, nums: List[int], queries: List[int]) -> List[int]:", "question_title": "You are given an integer array nums of length n, and an integer array queries of length m.\nReturn an array answer of length m where ans...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(nums = [4,5,2,1], queries = [3,10,21]) == [2,3,4]\\n assert candidate(nums = [2,3,4,5], queries = [1]) == [0]\\n\\n\\ncheck(Solution().answerQueries)\"}", "style": "rule" }
{ "dataset": "LeetCodeDataset", "index": 1260, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nYou are given an integer array nums of length n, and an integer array queries of length m.\nReturn an array answer of length m where answer[i] is the m...
247
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"functional\": \"_inputs = [[0], [1], [2], [5], [100], [200], [1000], [10000]]\\n_outputs = [[0], [0], [1], [12], [7496], [36190], [837722], [82590002]]\\nimport math\\ndef _deep_eq(a, b, tol=1e-5):\\n if isinstance(a, float) or isinstance(b, float):\\n return math.isclose(a, b, rel_tol...
{ "dataset": "likaixin/TACO-verified", "index": 3751, "prompt": "Solve the programming task below in a Python markdown code block.\n## Task\n\nFind the sum of the first `n` elements in the Recamán Sequence.\n\nInput range:\n\n```python\n1000 tests\n0 <= n <= 2,500,000\n```\n\n___\n\n## Sequence\n\nThe sequence is...
508
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"2\\n3 2\\n1 2\\n2 3\\n3 3\\n1 2\\n2 3\\n1 3\", \"2\\n3 2\\n1 2\\n2 3\\n3 3\\n1 2\\n2 3\\n2 3\", \"2\\n4 2\\n1 2\\n4 3\\n3 3\\n1 2\\n3 3\\n2 2\", \"2\\n3 2\\n1 2\\n2 5\\n3 2\\n1 2\\n2 3\\n1 1\", \"2\\n7 4\\n1 2\\n2 3\\n4 3\\n1 2\\n2 0\\n2 4\", \"2\\n4 2\\n1 2\\n2 3\\n3 3\\n1 2\\n2 3\...
{ "dataset": "likaixin/TACO-verified", "index": 10195, "prompt": "Solve the programming task below in a Python markdown code block.\nRead problems statements in Mandarin Chinese and Russian. \n\nThe following is an easy game that the setter of this problem played when he was 8:\n\nA boatman, a wolf, a sheep, and...
736
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"4\\nabc\\nabcba\\nabcd\\ncba\\n\"], \"outputs\": [\"2\\n0\\n4\\n2\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 10492, "prompt": "Solve the programming task below in a Python markdown code block.\nJames found a love letter that his friend Harry has written to his girlfriend. James is a prankster, so he decides to meddle with the letter. He changes all the words in the letter ...
569
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"100\\n846930886 1804289383\\n1681692777 1714636915\\n424238335 1957747793\\n719885386 1649760492\\n596516649 1189641421\\n1025202362 1350490027\\n783368690 1102520059\\n1967513926 2044897763\\n1365180540 1540383426\\n304089172 1303455736\\n35005211 521595368\\n294702567 1726956429\\...
{ "dataset": "likaixin/TACO-verified", "index": 672, "prompt": "Solve the programming task below in a Python markdown code block.\nIt is vacation time and Panda is in his hometown Pandaland. Panda is very bored so he started studying some interesting properties of natural numbers. Some days later he meet his frie...
394
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"1\\no\\n\", \"1\\no\\n\", \"2\\nox\\n.o\\n\", \"2\\nox\\n.o\\n\", \"2\\nox\\no.\\n\", \"3\\no.x\\noxx\\no.x\\n\", \"3\\no.x\\noxx\\no.x\\n\", \"5\\noxxxx\\nx...x\\nx...x\\nx...x\\nxxxxo\\n\"], \"outputs\": [\"YES\\no\\n\", \"YES\\no\\n\", \"YES\\nxxx\\n.ox\\nx.x\\n\", \"YES\\nxxx\\n...
{ "dataset": "likaixin/TACO-verified", "index": 6533, "prompt": "Solve the programming task below in a Python markdown code block.\nIgor has been into chess for a long time and now he is sick of the game by the ordinary rules. He is going to think of new rules of the game and become world famous.\n\nIgor's chessb...
995
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"functional\": \"_inputs = [[[-6, -3, -2, -1, 0, 1, 3, 4, 5, 7, 8, 9, 10, 11, 14, 15, 17, 18, 19, 20]], [[-3, -2, -1, 2, 10, 15, 16, 18, 19, 20]], [[1, 2, 3, 4, 5]]]\\n_outputs = [['-6,-3-1,3-5,7-11,14,15,17-20'], ['-3--1,2,10,15,16,18-20'], ['1-5']]\\nimport math\\ndef _deep_eq(a, b, tol=1e-5):\...
{ "dataset": "likaixin/TACO-verified", "index": 5033, "prompt": "Solve the programming task below in a Python markdown code block.\nA format for expressing an ordered list of integers is to use a comma separated list of either\n\n* individual integers\n* or a range of integers denoted by the starting integer sepa...
494
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"functional\": \"_inputs = [[[1, 5, 10, 25], 37], [[1, 3, 4], 6], [[25, 5, 10, 1, 21], 63], [[1, 4, 5, 10], 8], [[1, 2, 5, 10, 20, 50, 100, 200], 93]]\\n_outputs = [[4], [2], [3], [2], [5]]\\nimport math\\ndef _deep_eq(a, b, tol=1e-5):\\n if isinstance(a, float) or isinstance(b, float):\\n ...
{ "dataset": "likaixin/TACO-verified", "index": 7768, "prompt": "Solve the programming task below in a Python markdown code block.\nA country has coins with denominations\n```python\ncoins_list = d1 < d2 < · · · < dn.\n```\nYou want to make change for n cents, using the smallest number of coins.\n\n```python\n# E...
320
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"functional\": \"_inputs = [[1, 0], [1, 10], [1, 11], [0, 11], [1, 20], [21, 30]]\\n_outputs = [[0], [0], [2], [0], [4], [448]]\\nimport math\\ndef _deep_eq(a, b, tol=1e-5):\\n if isinstance(a, float) or isinstance(b, float):\\n return math.isclose(a, b, rel_tol=tol, abs_tol=tol)\\n ...
{ "dataset": "likaixin/TACO-verified", "index": 5126, "prompt": "Solve the programming task below in a Python markdown code block.\nFollowing from the previous kata and taking into account how cool psionic powers are compare to the Vance spell system (really, the idea of slots to dumb down the game sucks, not to ...
712
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"4\\n1\\n2\\n3\\n4\"], \"outputs\": [\"1\\n12\\n3\\n123\\n45\\n6\\n1234\\n567\\n89\\n10\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 12269, "prompt": "Solve the programming task below in a Python markdown code block.\nThe chef is trying to decode some pattern problems, Chef wants your help to code it. Chef has one number K to form a new pattern. Help the chef to code this pattern problem.\n\n----...
321
island-perimeter
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
Solution().islandPerimeter
def check(candidate): assert candidate(grid = [[0,1,0,0],[1,1,1,0],[0,1,0,0],[1,1,0,0]]) == 16 assert candidate(grid = [[1]]) == 4 assert candidate(grid = [[1,0]]) == 4
class Solution: def islandPerimeter(self, grid: List[List[int]]) -> int: m, n = len(grid), len(grid[0]) ans = 0 for i in range(m): for j in range(n): if grid[i][j] == 1: ans += 4 if i < m - 1 and grid[i + 1][j] == 1: ...
[ { "input": "grid = [[0,1,0,0],[1,1,1,0],[0,1,0,0],[1,1,0,0]]", "output": "16" }, { "input": "grid = [[1]]", "output": "4" }, { "input": "grid = [[1,0]]", "output": "4" } ]
You are given row x col grid representing a map where grid[i][j] = 1 represents land and grid[i][j] = 0 represents water. Grid cells are connected horizontally/vertically (not diagonally). The grid is completely surrounded by water, and there is exactly one island (i.e., one or more connected land cells). The island do...
{ "question_id": 463, "difficulty": "Easy", "lang_code": "class Solution:\n def islandPerimeter(self, grid: List[List[int]]) -> int:", "question_title": "You are given row x col grid representing a map where grid[i][j] = 1 represents land and grid[i][j] = 0 represents water.\nGrid cells are connected horizon...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(grid = [[0,1,0,0],[1,1,1,0],[0,1,0,0],[1,1,0,0]]) == 16\\n assert candidate(grid = [[1]]) == 4\\n assert candidate(grid = [[1,0]]) == 4\\n\\n\\ncheck(Solution().islandPerimeter)\"}", "style": "rule" }
{ "dataset": "LeetCodeDataset", "index": 1075, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nYou are given row x col grid representing a map where grid[i][j] = 1 represents land and grid[i][j] = 0 represents water.\nGrid cells are connected hor...
284
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"CODEFESTIVAM\", \"CPDEFESTIVAM\", \"BPDEFDSTIVBM\", \"MBVITSDFEDPB\", \"MBWITSDFEDPB\", \"BPCEFDSTIWBM\", \"CPCEFDSTJWBM\", \"WPCEFDSTJCAM\"], \"outputs\": [\"CODE\\n\", \"CPDE\\n\", \"BPDE\\n\", \"MBVI\\n\", \"MBWI\\n\", \"BPCE\\n\", \"CPCE\\n\", \"WPCE\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 11391, "prompt": "Solve the programming task below in a Python markdown code block.\nRng is going to a festival.\n\nThe name of the festival is given to you as a string S, which ends with `FESTIVAL`, from input. Answer the question: \"Rng is going to a festival of w...
359
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"5\\n1 3\\n1 4\\n4 4\\n25 11\\n25 12\\n\"], \"outputs\": [\"impossible\\npossible\\npossible\\nimpossible\\npossible\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 5935, "prompt": "Solve the programming task below in a Python markdown code block.\nRoy lives in a city that is circular in shape on a $2{D}$ plane that has radius ${r}$. The city center is located at origin $(0,0)$ and it has suburbs lying on the lattice points (po...
806
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"functional\": \"_inputs = [[['John', 'Smith'], 'Phoenix', 'Arizona'], [['Franklin', 'Delano', 'Roosevelt'], 'Chicago', 'Illinois'], [['Wallace', 'Russel', 'Osbourne'], 'Albany', 'New York'], [['Lupin', 'the', 'Third'], 'Los Angeles', 'California'], [['Marlo', 'Stanfield'], 'Baltimore', 'Maryland...
{ "dataset": "likaixin/TACO-verified", "index": 2263, "prompt": "Solve the programming task below in a Python markdown code block.\nCreate a method `sayHello`/`say_hello`/`SayHello` that takes as input a name, city, and state to welcome a person. Note that `name` will be an array consisting of one or more values ...
255
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"2\\n1 1\\n\", \"2\\n1 1\\n\", \"3\\n4 3 6\\n\", \"3\\n2 5 3\\n\", \"3\\n2 5 3\\n\", \"3\\n3 5 3\\n\", \"3\\n3 9 5\\n\", \"3\\n4 1 2\\n\"], \"outputs\": [\"-1 -1\\n\", \"-1 -1 \", \"-1 -1 -1\\n\", \"3 2 4\\n\", \"3 2 4 \\n\", \"-1 -1 -1\\n\", \"3 2 4\\n\", \"1 3 2\\n\"]}", "style":...
{ "dataset": "likaixin/TACO-verified", "index": 4765, "prompt": "Solve the programming task below in a Python markdown code block.\nYour favorite music streaming platform has formed a perfectly balanced playlist exclusively for you. The playlist consists of $n$ tracks numbered from $1$ to $n$. The playlist is aut...
876
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"2\\n3 7\\n1 1023\"], \"outputs\": [\"5\\n2177\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 12256, "prompt": "Solve the programming task below in a Python markdown code block.\nBabidi has summoned Majin Vegeta. He orders him to kill Supreme Kai. But Vegeta wants to get out of his control.\n\nBabidi has laid out a trap. Vegeta is standing at the $nth$ level...
538
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"b\\n\", \"w\\n\", \"b\\n\", \"w\\n\", \"bw\\n\", \"bw\\n\", \"wb\\n\", \"bwb\\n\"], \"outputs\": [\"1\\n\", \"1\\n\", \"1\\n\", \"1\\n\", \"2\\n\", \"2\\n\", \"2\\n\", \"3\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 1925, "prompt": "Solve the programming task below in a Python markdown code block.\nIs there anything better than going to the zoo after a tiresome week at work? No wonder Grisha feels the same while spending the entire weekend accompanied by pretty striped zebras. ...
539
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"5\\n2 0 1 8 7\", \"5\\n2 2 3 5 5\", \"5\\n2 2 3 5 10\", \"5\\n2 0 1 8 10\", \"5\\n2 2 2 5 10\", \"5\\n2 2 2 8 10\", \"5\\n2 0 2 8 10\", \"6\\n6 0 4 3 2 1\"], \"outputs\": [\"10\\n\", \"2\", \"6\\n\", \"13\\n\", \"7\\n\", \"10\\n\", \"12\\n\", \"15\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 7810, "prompt": "Solve the programming task below in a Python markdown code block.\nSnuke has an integer sequence A of length N.\n\nHe will freely choose an integer b. Here, he will get sad if A_i and b+i are far from each other. More specifically, the sadness of Sn...
436
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"[\\n\", \"|\\n\", \"]\\n\", \":\\n\", \"b\\n\", \"c\\n\", \"s\\n\", \"z\\n\"], \"outputs\": [\"-1\\n\", \"-1\\n\", \"-1\\n\", \"-1\\n\", \"-1\\n\", \"-1\\n\", \"-1\\n\", \"-1\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 6157, "prompt": "Solve the programming task below in a Python markdown code block.\nAn accordion is a string (yes, in the real world accordions are musical instruments, but let's forget about it for a while) which can be represented as a concatenation of: an opening...
461
cells-with-odd-values-in-a-matrix
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
Solution().oddCells
def check(candidate): assert candidate(m = 2, n = 3, indices = [[0,1],[1,1]]) == 6 assert candidate(m = 2, n = 2, indices = [[1,1],[0,0]]) == 0
class Solution: def oddCells(self, m: int, n: int, indices: List[List[int]]) -> int: g = [[0] * n for _ in range(m)] for r, c in indices: for i in range(m): g[i][c] += 1 for j in range(n): g[r][j] += 1 return sum(v % 2 for row in g for ...
[ { "input": "m = 2, n = 3, indices = [[0,1],[1,1]]", "output": "6" }, { "input": "m = 2, n = 2, indices = [[1,1],[0,0]]", "output": "0" } ]
There is an m x n matrix that is initialized to all 0's. There is also a 2D array indices where each indices[i] = [ri, ci] represents a 0-indexed location to perform some increment operations on the matrix. For each location indices[i], do both of the following: Increment all the cells on row ri. Increment all the cel...
{ "question_id": 1378, "difficulty": "Easy", "lang_code": "class Solution:\n def oddCells(self, m: int, n: int, indices: List[List[int]]) -> int:", "question_title": "There is an m x n matrix that is initialized to all 0's. There is also a 2D array indices where each indices[i] = [ri, ci] represents a 0-inde...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(m = 2, n = 3, indices = [[0,1],[1,1]]) == 6\\n assert candidate(m = 2, n = 2, indices = [[1,1],[0,0]]) == 0\\n\\n\\ncheck(Solution().oddCells)\"}", "style": "rule" }
{ "dataset": "LeetCodeDataset", "index": 115, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nThere is an m x n matrix that is initialized to all 0's. There is also a 2D array indices where each indices[i] = [ri, ci] represents a 0-indexed locati...
272
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"2\\n3\\n6\"], \"outputs\": [\"0\\n1\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 11223, "prompt": "Solve the programming task below in a Python markdown code block.\nRead problems statements in [Hindi], [Mandarin Chinese], [Russian], [Vietnamese], and [Bengali] as well.\n\nA tuple $(a, b, c)$ is considered good if it consists of three prime numb...
467
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"3\\n6\\n5\\n4\\n\", \"3\\n6\\n6\\n4\\n\", \"3\\n6\\n6\\n6\\n\", \"3\\n6\\n3\\n6\\n\", \"3\\n6\\n3\\n8\\n\", \"3\\n6\\n4\\n8\\n\", \"3\\n4\\n4\\n75\\n\", \"3\\n4\\n6\\n75\\n\"], \"outputs\": [\"6\\n5\\n4\\n\", \"6\\n6\\n4\\n\", \"6\\n6\\n6\\n\", \"6\\n3\\n6\\n\", \"6\\n3\\n8\\n\", \"...
{ "dataset": "likaixin/TACO-verified", "index": 3225, "prompt": "Solve the programming task below in a Python markdown code block.\nThe $\\text{$gcdSum$}$ of a positive integer is the $gcd$ of that integer with its sum of digits. Formally, $\\text{$gcdSum$}(x) = gcd(x, \\text{ sum of digits of } x)$ for a positiv...
841
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"3\\n1\\n2\\n3\"], \"outputs\": [\"1\\n1\\n2\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 11090, "prompt": "Solve the programming task below in a Python markdown code block.\nWe have found a new chess character — pook. It has the qualities of both a rook and a pawn. Specifically, treating the chessboard to be an N\\times N grid where (i, j) denotes the i...
554
find-and-replace-in-string
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
Solution().findReplaceString
def check(candidate): assert candidate(s = "abcd", indices = [0,2], sources = ["a","cd"], targets = ["eee","ffff"]) == "eeebffff" assert candidate(s = "abcd", indices = [0,2], sources = ["ab","ec"], targets = ["eee","ffff"]) == "eeecd"
class Solution: def findReplaceString( self, s: str, indices: List[int], sources: List[str], targets: List[str] ) -> str: n = len(s) d = [-1] * n for k, (i, src) in enumerate(zip(indices, sources)): if s.startswith(src, i): d[i] = k ans = [] ...
[ { "input": "s = \"abcd\", indices = [0,2], sources = [\"a\",\"cd\"], targets = [\"eee\",\"ffff\"]", "output": "\"eeebffff\"" }, { "input": "s = \"abcd\", indices = [0,2], sources = [\"ab\",\"ec\"], targets = [\"eee\",\"ffff\"]", "output": "\"eeecd\"" } ]
You are given a 0-indexed string s that you must perform k replacement operations on. The replacement operations are given as three 0-indexed parallel arrays, indices, sources, and targets, all of length k. To complete the ith replacement operation: Check if the substring sources[i] occurs at index indices[i] in the o...
{ "question_id": 862, "difficulty": "Medium", "lang_code": "class Solution:\n def findReplaceString(self, s: str, indices: List[int], sources: List[str], targets: List[str]) -> str:", "question_title": "You are given a 0-indexed string s that you must perform k replacement operations on. The replacement oper...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(s = \\\"abcd\\\", indices = [0,2], sources = [\\\"a\\\",\\\"cd\\\"], targets = [\\\"eee\\\",\\\"ffff\\\"]) == \\\"eeebffff\\\"\\n assert candidate(s = \\\"abcd\\\", indices = [0,2], sources = [\\\"ab\\\",\\\"ec\\\"], targets = [\\\"...
{ "dataset": "LeetCodeDataset", "index": 588, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nYou are given a 0-indexed string s that you must perform k replacement operations on. The replacement operations are given as three 0-indexed parallel a...
415
flipping-an-image
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
Solution().flipAndInvertImage
def check(candidate): assert candidate(image = [[1,1,0],[1,0,1],[0,0,0]]) == [[1,0,0],[0,1,0],[1,1,1]] assert candidate(image = [[1,1,0,0],[1,0,0,1],[0,1,1,1],[1,0,1,0]]) == [[1,1,0,0],[0,1,1,0],[0,0,0,1],[1,0,1,0]]
class Solution: def flipAndInvertImage(self, image: List[List[int]]) -> List[List[int]]: n = len(image) for row in image: i, j = 0, n - 1 while i < j: if row[i] == row[j]: row[i] ^= 1 row[j] ^= 1 i, j = i...
[ { "input": "image = [[1,1,0],[1,0,1],[0,0,0]]", "output": "[[1,0,0],[0,1,0],[1,1,1]]" }, { "input": "image = [[1,1,0,0],[1,0,0,1],[0,1,1,1],[1,0,1,0]]", "output": "[[1,1,0,0],[0,1,1,0],[0,0,0,1],[1,0,1,0]]" } ]
Given an n x n binary matrix image, flip the image horizontally, then invert it, and return the resulting image. To flip an image horizontally means that each row of the image is reversed. For example, flipping [1,1,0] horizontally results in [0,1,1]. To invert an image means that each 0 is replaced by 1, and each 1 ...
{ "question_id": 861, "difficulty": "Easy", "lang_code": "class Solution:\n def flipAndInvertImage(self, image: List[List[int]]) -> List[List[int]]:", "question_title": "Given an n x n binary matrix image, flip the image horizontally, then invert it, and return the resulting image.\nTo flip an image horizont...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(image = [[1,1,0],[1,0,1],[0,0,0]]) == [[1,0,0],[0,1,0],[1,1,1]]\\n assert candidate(image = [[1,1,0,0],[1,0,0,1],[0,1,1,1],[1,0,1,0]]) == [[1,1,0,0],[0,1,1,0],[0,0,0,1],[1,0,1,0]]\\n\\n\\ncheck(Solution().flipAndInvertImage)\"}", ...
{ "dataset": "LeetCodeDataset", "index": 1255, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nGiven an n x n binary matrix image, flip the image horizontally, then invert it, and return the resulting image.\nTo flip an image horizontally means t...
271
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"1 2 1\\n0 0\\nc 1 2\\n\", \"1 2 3\\n1 2\\nc 1 2\\ng 1 1\\ng 1 2\\n\", \"2 1 3\\n1\\n2\\nr 1 2\\ng 1 1\\ng 2 1\\n\", \"1 2 3\\n1 2\\nc 1 2\\ng 1 1\\ng 1 1\\n\", \"1 2 3\\n0 2\\nc 1 2\\ng 1 1\\ng 1 2\\n\", \"1 2 3\\n1 2\\nc 1 2\\ng 1 2\\ng 1 2\\n\", \"2 3 3\\n1 0 4\\n3 1 5\\nc 2 1\\nr...
{ "dataset": "likaixin/TACO-verified", "index": 8386, "prompt": "Solve the programming task below in a Python markdown code block.\nThe Free Meteor Association (FMA) has got a problem: as meteors are moving, the Universal Cosmic Descriptive Humorous Program (UCDHP) needs to add a special module that would analyze...
840
check-distances-between-same-letters
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
Solution().checkDistances
def check(candidate): assert candidate(s = "abaccb", distance = [1,3,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]) == True assert candidate(s = "aa", distance = [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]) == False
class Solution: def checkDistances(self, s: str, distance: List[int]) -> bool: d = defaultdict(int) for i, c in enumerate(s, 1): if d[c] and i - d[c] - 1 != distance[ord(c) - ord('a')]: return False d[c] = i return True
[ { "input": "s = \"abaccb\", distance = [1,3,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]", "output": "true" }, { "input": "s = \"aa\", distance = [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]", "output": "false" } ]
You are given a 0-indexed string s consisting of only lowercase English letters, where each letter in s appears exactly twice. You are also given a 0-indexed integer array distance of length 26. Each letter in the alphabet is numbered from 0 to 25 (i.e. 'a' -> 0, 'b' -> 1, 'c' -> 2, ... , 'z' -> 25). In a well-spaced s...
{ "question_id": 2476, "difficulty": "Easy", "lang_code": "class Solution:\n def checkDistances(self, s: str, distance: List[int]) -> bool:", "question_title": "You are given a 0-indexed string s consisting of only lowercase English letters, where each letter in s appears exactly twice. You are also given a ...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(s = \\\"abaccb\\\", distance = [1,3,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]) == True\\n assert candidate(s = \\\"aa\\\", distance = [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]) == False\\n\\n\\ncheck(Solution().ch...
{ "dataset": "LeetCodeDataset", "index": 1645, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nYou are given a 0-indexed string s consisting of only lowercase English letters, where each letter in s appears exactly twice. You are also given a 0-i...
305
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"functional\": \"_inputs = [['AD', 'BC'], ['AD', 'DD'], ['gf', 'FG'], ['Ad', 'DD'], ['zz1', ''], ['ZzZz', 'ffPFF'], ['kl', 'lz'], [None, ''], ['!!', '7476'], ['##', '1176']]\\n_outputs = [[True], [False], [True], [False], [True], [True], [False], [True], [True], [True]]\\nimport math\\ndef _deep_...
{ "dataset": "likaixin/TACO-verified", "index": 3176, "prompt": "Solve the programming task below in a Python markdown code block.\nCompare two strings by comparing the sum of their values (ASCII character code).\n\n* For comparing treat all letters as UpperCase\n* `null/NULL/Nil/None` should be treated as empty ...
307
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"aaa\\na\\nb\\n\", \"cumurcumur\\num\\ncur\\n\", \"cumurcumur\\nul\\ncur\\n\", \"abbbaaccca\\nba\\naca\\n\", \"cunurcumur\\nul\\ncur\\n\", \"abbbaaccca\\nab\\naca\\n\", \"xxxbbbcccoca\\nca\\ncb\\n\", \"xxxbbbcccoca\\nca\\nca\\n\"], \"outputs\": [\"aaa\\n\", \"umumcurcur\\n\", \"curcu...
{ "dataset": "likaixin/TACO-verified", "index": 12781, "prompt": "Solve the programming task below in a Python markdown code block.\nProfessor GukiZ doesn't accept string as they are. He likes to swap some letters in string to obtain a new one.\n\nGukiZ has strings a, b, and c. He wants to obtain string k by swap...
515
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"5 5\\n5 4 3 2 1\\n1 5 3\\n1 3 1\\n2 4 3\\n4 4 4\\n2 5 3\\n\", \"5 5\\n5 4 3 2 1\\n1 5 3\\n1 5 1\\n2 4 3\\n4 4 4\\n2 5 3\\n\", \"5 5\\n5 4 3 2 1\\n1 5 4\\n1 3 1\\n2 4 3\\n4 4 4\\n2 5 3\\n\", \"5 5\\n5 4 3 2 1\\n1 5 3\\n1 3 1\\n2 4 3\\n3 4 4\\n2 5 3\\n\", \"5 5\\n5 4 6 2 1\\n1 5 4\\n1...
{ "dataset": "likaixin/TACO-verified", "index": 8338, "prompt": "Solve the programming task below in a Python markdown code block.\nVladik had started reading a complicated book about algorithms containing n pages. To improve understanding of what is written, his friends advised him to read pages in some order gi...
821
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"functional\": \"_inputs = [[1], [5], [8], [9], [13], [15], [134], [289]]\\n_outputs = [[True], [False], [False], [False], [True], [False], [False], [True]]\\nimport math\\ndef _deep_eq(a, b, tol=1e-5):\\n if isinstance(a, float) or isinstance(b, float):\\n return math.isclose(a, b, rel...
{ "dataset": "likaixin/TACO-verified", "index": 3096, "prompt": "Solve the programming task below in a Python markdown code block.\n# Task\n Changu and Mangu are great buddies. Once they found an infinite paper which had 1,2,3,4,5,6,7,8,......... till infinity, written on it.\n\n Both of them did not like the seq...
450
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"12\\n13 19 9 5 12 8 7 4 13 0 6 3\", \"12\\n13 19 9 5 12 8 7 4 21 0 2 18\", \"12\\n13 19 9 5 12 8 7 4 13 0 6 18\", \"12\\n8 19 9 5 12 8 7 4 21 4 10 18\", \"12\\n13 19 9 5 12 8 7 4 40 0 10 1\", \"12\\n40 19 9 1 12 8 8 6 21 0 10 1\", \"12\\n40 19 6 1 12 8 0 2 21 2 4 22\", \"12\\n13 19 ...
{ "dataset": "likaixin/TACO-verified", "index": 4908, "prompt": "Solve the programming task below in a Python markdown code block.\nQuick sort is based on the Divide-and-conquer approach. In QuickSort(A, p, r), first, a procedure Partition(A, p, r) divides an array A[p..r] into two subarrays A[p..q-1] and A[q+1.....
609
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"4 1\\n3 0 0 1\\n\", \"4 1\\n3 -1 6 0\\n\", \"4 1\\n3 -2 6 0\\n\", \"4 1\\n3 -2 1 0\\n\", \"4 1\\n2 -2 1 0\\n\", \"4 1\\n3 -2 2 0\\n\", \"4 1\\n0 -2 1 0\\n\", \"4 1\\n6 -2 1 0\\n\"], \"outputs\": [\"4\\n\", \"8\\n\", \"7\\n\", \"2\\n\", \"1\\n\", \"3\\n\", \"-1\\n\", \"5\\n\"]}", "...
{ "dataset": "likaixin/TACO-verified", "index": 6829, "prompt": "Solve the programming task below in a Python markdown code block.\nYou are given an array $a_1, a_2, \\dots, a_n$ and an integer $k$.\n\nYou are asked to divide this array into $k$ non-empty consecutive subarrays. Every element in the array should b...
587
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"3\\n3\\n1 1\\n10 15 5\\n5\\n1 1 3 3\\n50 10 20 40 30\\n9\\n1 1 2 2 2 2 7 7\\n1 2 3 4 5 6 7 8 9\"], \"outputs\": [\"3\\n8\\n28\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 2406, "prompt": "Solve the programming task below in a Python markdown code block.\nRead problem statements in [Mandarin], [Bengali], [Russian], and [Vietnamese] as well.\n\nBugs Bunny is very smart, but he keeps constantly worrying about the future and is always an...
993
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"1\\n\", \",\\n\", \"0\\n\", \",,\\n\", \"1,\\n\", \",1\\n\", \"2,\\n\", \",2\\n\"], \"outputs\": [\"1\\n\", \",\\n\", \"0\\n\", \", ,\\n\", \"1,\\n\", \", 1\\n\", \"2,\\n\", \", 2\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 553, "prompt": "Solve the programming task below in a Python markdown code block.\nPolycarp is very careful. He even types numeric sequences carefully, unlike his classmates. If he sees a sequence without a space after the comma, with two spaces in a row, or when so...
639
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"2\\n3\\n2 4 2\\n3\\n0 2 3\"], \"outputs\": [\"1\\n0\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 105, "prompt": "Solve the programming task below in a Python markdown code block.\nRead problem statements in [Hindi], [Bengali], [Mandarin Chinese], [Russian], and [Vietnamese] as well.\n\nChef has a sequence $A_{1}, A_{2}, \\ldots, A_{N}$. He needs to find the num...
504
binary-tree-level-order-traversal
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
Solution().levelOrder
def check(candidate): assert candidate(root = tree_node([3,9,20,None,None,15,7])) == [[3],[9,20],[15,7]] assert candidate(root = tree_node([1])) == [[1]] assert candidate(root = tree_node([])) == []
# Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution: def levelOrder(self, root: Optional[TreeNode]) -> List[List[int]]: ans = [] if root is None:...
[ { "input": "root = [3,9,20,null,null,15,7]", "output": "[[3],[9,20],[15,7]]" }, { "input": "root = [1]", "output": "[[1]]" }, { "input": "root = []", "output": "[]" } ]
Given the root of a binary tree, return the level order traversal of its nodes' values. (i.e., from left to right, level by level).   Please complete the following python code precisely: ```python # Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # se...
{ "question_id": 102, "difficulty": "Medium", "lang_code": "# Definition for a binary tree node.\n# class TreeNode:\n# def __init__(self, val=0, left=None, right=None):\n# self.val = val\n# self.left = left\n# self.right = right\nclass Solution:\n def levelOrder(self, root: Optional...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(root = tree_node([3,9,20,None,None,15,7])) == [[3],[9,20],[15,7]]\\n assert candidate(root = tree_node([1])) == [[1]]\\n assert candidate(root = tree_node([])) == []\\n\\n\\ncheck(Solution().levelOrder)\"}", "style": "rule" }
{ "dataset": "LeetCodeDataset", "index": 754, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nGiven the root of a binary tree, return the level order traversal of its nodes' values. (i.e., from left to right, level by level).\n \nPlease complete ...
238
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"1 1\\n4\\n9\\n\", \"1 1\\n2\\n4\\n\", \"1 1\\n4\\n9\\n\", \"1 1\\n2\\n4\\n\", \"1 1\\n8\\n9\\n\", \"1 1\\n1\\n9\\n\", \"1 1\\n1\\n0\\n\", \"1 1\\n0\\n0\\n\"], \"outputs\": [\"8\", \"-1\\n\", \"8\\n\", \"-1\\n\", \"-1\\n\", \"2\\n\", \"-1\\n\", \"-1\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 8537, "prompt": "Solve the programming task below in a Python markdown code block.\nValera wanted to prepare a Codesecrof round. He's already got one problem and he wants to set a time limit (TL) on it.\n\nValera has written n correct solutions. For each correct sol...
585
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"7 1\\n1 0 1 0 1 0 1 \\n1 2\\n1 3\\n2 4\\n2 5\\n3 6\\n3 7\"], \"outputs\": [\"5\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 489, "prompt": "Solve the programming task below in a Python markdown code block.\nRead problem statements in [Hindi], [Bengali], [Mandarin Chinese], [Russian], and [Vietnamese] as well.\n\nChef has a tree with $N$ nodes (numbered $1$ through $N$) and a non-negative...
820
form-largest-integer-with-digits-that-add-up-to-target
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
Solution().largestNumber
def check(candidate): assert candidate(cost = [4,3,2,5,6,7,2,5,5], target = 9) == "7772" assert candidate(cost = [7,6,5,5,5,6,8,7,8], target = 12) == "85" assert candidate(cost = [2,4,6,2,4,6,4,4,4], target = 5) == "0" assert candidate(cost = [6,10,15,40,40,40,40,40,40], target = 47) == "32211"
class Solution: def largestNumber(self, cost: List[int], target: int) -> str: f = [[-inf] * (target + 1) for _ in range(10)] f[0][0] = 0 g = [[0] * (target + 1) for _ in range(10)] for i, c in enumerate(cost, 1): for j in range(target + 1): if j < c or f[i...
[ { "input": "cost = [4,3,2,5,6,7,2,5,5], target = 9", "output": "\"7772\"" }, { "input": "cost = [7,6,5,5,5,6,8,7,8], target = 12", "output": "\"85\"" }, { "input": "cost = [2,4,6,2,4,6,4,4,4], target = 5", "output": "\"0\"" }, { "input": "cost = [6,10,15,40,40,40,40,40,40], t...
Given an array of integers cost and an integer target, return the maximum integer you can paint under the following rules: The cost of painting a digit (i + 1) is given by cost[i] (0-indexed). The total cost used must be equal to target. The integer does not have 0 digits. Since the answer may be very large, return i...
{ "question_id": 1545, "difficulty": "Hard", "lang_code": "class Solution:\n def largestNumber(self, cost: List[int], target: int) -> str:", "question_title": "Given an array of integers cost and an integer target, return the maximum integer you can paint under the following rules:\n\nThe cost of painting a ...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(cost = [4,3,2,5,6,7,2,5,5], target = 9) == \\\"7772\\\"\\n assert candidate(cost = [7,6,5,5,5,6,8,7,8], target = 12) == \\\"85\\\"\\n assert candidate(cost = [2,4,6,2,4,6,4,4,4], target = 5) == \\\"0\\\"\\n assert candidate(co...
{ "dataset": "LeetCodeDataset", "index": 1465, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nGiven an array of integers cost and an integer target, return the maximum integer you can paint under the following rules:\n\nThe cost of painting a di...
253
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"3\\n5 3\\n4 2 3 1 4\\n3 2 5 5 1\\n4 2\\n1 2 3 4\\n4 3 2 1\\n6 3\\n8 10 3 6 7 2\\n4 8 4 1 1 6\\n\"], \"outputs\": [\"9\\n5\\n18\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 8633, "prompt": "Solve the programming task below in a Python markdown code block.\nYou are given two arrays A and B, both of length N.\n\nYou would like to choose exactly K distinct indices i_{1},i_{2}, \\ldots, i_{K} such that \\min(A_{i_{1}}+A_{i_{2}}+ \\ldots + ...
678
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"2 2\\n3\\n1 1 0\\n1 2 10\\n2 1 22\", \"2 2\\n3\\n2 1 20\\n1 2 10\\n2 1 0\", \"2 2\\n3\\n1 1 0\\n1 2 10\\n2 1 14\", \"2 4\\n3\\n1 1 0\\n1 2 10\\n2 1 22\", \"2 2\\n3\\n1 1 0\\n1 2 10\\n1 1 14\", \"2 4\\n3\\n1 1 1\\n1 2 10\\n2 1 22\", \"2 2\\n3\\n1 1 0\\n2 2 10\\n2 1 22\", \"2 2\\n3\\n...
{ "dataset": "likaixin/TACO-verified", "index": 5320, "prompt": "Solve the programming task below in a Python markdown code block.\nThere is a grid with R rows and C columns. We call the cell in the r-th row and c-th column (r,c).\n\nMr. Takahashi wrote non-negative integers into N of the cells, that is, he wrote...
705
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"3\\n3 4 3\", \"3\\n3 7 3\", \"3\\n4 6 5\", \"3\\n4 6 7\", \"3\\n4 4 7\", \"3\\n5 4 7\", \"3\\n9 4 3\", \"3\\n9 2 6\"], \"outputs\": [\"12\\n\", \"21\\n\", \"60\\n\", \"84\\n\", \"28\\n\", \"140\\n\", \"36\\n\", \"18\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 584, "prompt": "Solve the programming task below in a Python markdown code block.\nFind the least common multiple (LCM) of given n integers.\n\nConstraints\n\n* 2 ≤ n ≤ 10\n* 1 ≤ ai ≤ 1000\n* Product of given integers ai(i = 1, 2, ... n) does not exceed 231-1\n\nInp...
272
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"4\\nabc\\nabcdef\\naA\\nabAZ\\naaa\\na\\nwhat\\nnone\"], \"outputs\": [\"3\\n2\\n1\\n0\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 6092, "prompt": "Solve the programming task below in a Python markdown code block.\nSoma is a fashionable girl. She absolutely loves shiny stones that she can put on as jewellery accessories. She has been collecting stones since her childhood - now she has become re...
421
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"10\\nbeabeefeab\\n\"], \"outputs\": [\"5\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 4471, "prompt": "Solve the programming task below in a Python markdown code block.\nGiven a string, remove characters until the string is made up of any two alternating characters. When you choose a character to remove, all instances of that character must be remov...
661
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"4\\n4 1 1\\n2 10 7\\n8 5 4\\n9 7 0\"], \"outputs\": [\"0\\n6\\n8\\n63\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 12777, "prompt": "Solve the programming task below in a Python markdown code block.\nOn a certain train, Chef-the ticket collector, collects a fine of Rs. X if a passenger is travelling without a ticket. It is known that a passenger carries either a single ticket or...
583
cells-in-a-range-on-an-excel-sheet
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
Solution().cellsInRange
def check(candidate): assert candidate(s = "K1:L2") == ["K1","K2","L1","L2"] assert candidate(s = "A1:F1") == ["A1","B1","C1","D1","E1","F1"]
class Solution: def cellsInRange(self, s: str) -> List[str]: return [ chr(i) + str(j) for i in range(ord(s[0]), ord(s[-2]) + 1) for j in range(int(s[1]), int(s[-1]) + 1) ]
[ { "input": "s = \"K1:L2\"", "output": "[\"K1\",\"K2\",\"L1\",\"L2\"]" }, { "input": "s = \"A1:F1\"", "output": "[\"A1\",\"B1\",\"C1\",\"D1\",\"E1\",\"F1\"]" } ]
A cell (r, c) of an excel sheet is represented as a string "<col><row>" where: <col> denotes the column number c of the cell. It is represented by alphabetical letters. For example, the 1st column is denoted by 'A', the 2nd by 'B', the 3rd by 'C', and so on. <row> is the row number r of the cell. The rth row is r...
{ "question_id": 2304, "difficulty": "Easy", "lang_code": "class Solution:\n def cellsInRange(self, s: str) -> List[str]:", "question_title": "A cell (r, c) of an excel sheet is represented as a string \"<col><row>\" where:\n\n<col> denotes the column number c of the cell. It is represented by alphabetical l...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(s = \\\"K1:L2\\\") == [\\\"K1\\\",\\\"K2\\\",\\\"L1\\\",\\\"L2\\\"]\\n assert candidate(s = \\\"A1:F1\\\") == [\\\"A1\\\",\\\"B1\\\",\\\"C1\\\",\\\"D1\\\",\\\"E1\\\",\\\"F1\\\"]\\n\\n\\ncheck(Solution().cellsInRange)\"}", "style":...
{ "dataset": "LeetCodeDataset", "index": 369, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nA cell (r, c) of an excel sheet is represented as a string \"<col><row>\" where:\n\n<col> denotes the column number c of the cell. It is represented by ...
402
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"3 6\", \"1 0\", \"1 2\", \"6 6\", \"0 2\", \"5 6\", \"7 6\", \"0 1\"], \"outputs\": [\"-1\\n\", \"0 1 2\\n\", \"-1\\n\", \"-1\\n\", \"-1\\n\", \"-1\\n\", \"-1\\n\", \"-1\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 788, "prompt": "Solve the programming task below in a Python markdown code block.\nGiven are positive integers N and K.\n\nDetermine if the 3N integers K, K+1, ..., K+3N-1 can be partitioned into N triples (a_1,b_1,c_1), ..., (a_N,b_N,c_N) so that the condition belo...
442
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"7\\n\", \"8\\n\", \"9\\n\", \"1\\n\", \"2\\n\", \"3\\n\", \"1\\n\", \"3\\n\"], \"outputs\": [\"4\\n\", \"5\\n\", \"5\\n\", \"1\\n\", \"2\\n\", \"2\\n\", \"1\\n\", \"2\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 5349, "prompt": "Solve the programming task below in a Python markdown code block.\nLet's define a split of $n$ as a nonincreasing sequence of positive integers, the sum of which is $n$. \n\nFor example, the following sequences are splits of $8$: $[4, 4]$, $[3, 3, 2...
604
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"3 4\\n3 8\\n5 100\\n0 0\", \"3 5\\n3 7\\n7 101\\n0 0\", \"3 8\\n3 8\\n5 100\\n0 0\", \"6 8\\n3 8\\n5 100\\n0 0\", \"3 2\\n3 7\\n7 101\\n0 0\", \"3 3\\n3 7\\n7 100\\n0 0\", \"2 6\\n3 5\\n5 100\\n0 0\", \"3 2\\n3 8\\n5 100\\n0 0\"], \"outputs\": [\"2/1 3/2\\n7/4 5/3\\n85/38 38/17\\n\"...
{ "dataset": "likaixin/TACO-verified", "index": 9055, "prompt": "Solve the programming task below in a Python markdown code block.\nRational numbers are numbers represented by ratios of two integers. For a prime number p, one of the elementary theorems in the number theory is that there is no rational number equa...
663
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"2 2 2\\n\", \"5 6 7\\n\", \"1 5 1\\n\", \"1 5 1\\n\", \"2 1 2\\n\", \"2 2 2\\n\", \"5 6 7\\n\", \"71 2 1\\n\"], \"outputs\": [\"20\\n\", \"1520\\n\", \"10\\n\", \"10\\n\", \"8\\n\", \"20\\n\", \"1520\\n\", \"811\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 12182, "prompt": "Solve the programming task below in a Python markdown code block.\nLet's denote d(n) as the number of divisors of a positive integer n. You are given three integers a, b and c. Your task is to calculate the following sum:\n\n$\\sum_{i = 1}^{a} \\su...
516
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"functional\": \"_inputs = [[[1, 2], [2, 1]], [[1, -2], [2, 1]], [[7, 8], [7, -6]], [[-13, -26], [-8, 4]], [[1, 2, 3], [0, -3, 2]], [[3, 4, 5], [6, 7, -8]], [[3, -4, -5], [-4, -3, 0]], [[1, -2, 3, -4], [-4, 3, 2, -1]], [[2, 4, 5, 6, 7], [-14, -12, 0, 8, 4]], [[5, 10, 1, 20, 2], [-2, -20, -1, 10, ...
{ "dataset": "likaixin/TACO-verified", "index": 991, "prompt": "Solve the programming task below in a Python markdown code block.\nSuppose I have two vectors: `(a1, a2, a3, ..., aN)` and `(b1, b2, b3, ..., bN)`. The dot product between these two vectors is defined as:\n\n```\na1*b1 + a2*b2 + a3*b3 + ... + aN*bN\n...
340
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"3\\n1 3\\n2 3\\n\", \"3\\n1 3\\n2 3\\n\", \"3\\n1 2\\n2 3\\n\", \"4\\n1 2\\n2 3\\n3 4\\n\", \"4\\n1 2\\n2 4\\n3 4\\n\", \"4\\n1 3\\n2 4\\n3 4\\n\", \"4\\n1 2\\n1 4\\n3 4\\n\", \"4\\n1 4\\n2 4\\n3 4\\n\"], \"outputs\": [\"2\\n\", \"2\\n\", \"2\\n\", \"2\\n\", \"2\\n\", \"2\\n\", \"2\...
{ "dataset": "likaixin/TACO-verified", "index": 471, "prompt": "Solve the programming task below in a Python markdown code block.\nYou have a tree of $n$ vertices. You are going to convert this tree into $n$ rubber bands on infinitely large plane. Conversion rule follows:\n\nFor every pair of vertices $a$ and $b$...
693
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"#\\n\", \"(#(\\n\", \")#)\\n\", \"*#)\\n\", \")#*\\n\", \")*#\\n\", \"#*)\\n\", \"(#)\\n\"], \"outputs\": [\"-1\\n\", \"-1\\n\", \"-1\\n\", \"-1\\n\", \"-1\\n\", \"-1\\n\", \"-1\\n\", \"-1\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 10077, "prompt": "Solve the programming task below in a Python markdown code block.\nMalek has recently found a treasure map. While he was looking for a treasure he found a locked door. There was a string s written on the door consisting of characters '(', ')' and '...
495
count-the-repetitions
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
Solution().getMaxRepetitions
def check(candidate): assert candidate(s1 = "acb", n1 = 4, s2 = "ab", n2 = 2) == 2 assert candidate(s1 = "acb", n1 = 1, s2 = "acb", n2 = 1) == 1
class Solution: def getMaxRepetitions(self, s1: str, n1: int, s2: str, n2: int) -> int: n = len(s2) d = {} for i in range(n): cnt = 0 j = i for c in s1: if c == s2[j]: j += 1 if j == n: ...
[ { "input": "s1 = \"acb\", n1 = 4, s2 = \"ab\", n2 = 2", "output": "2" }, { "input": "s1 = \"acb\", n1 = 1, s2 = \"acb\", n2 = 1", "output": "1" } ]
We define str = [s, n] as the string str which consists of the string s concatenated n times. For example, str == ["abc", 3] =="abcabcabc". We define that string s1 can be obtained from string s2 if we can remove some characters from s2 such that it becomes s1. For example, s1 = "abc" can be obtained from s2 = "abdb...
{ "question_id": 466, "difficulty": "Hard", "lang_code": "class Solution:\n def getMaxRepetitions(self, s1: str, n1: int, s2: str, n2: int) -> int:", "question_title": "We define str = [s, n] as the string str which consists of the string s concatenated n times.\n\nFor example, str == [\"abc\", 3] ==\"abcabc...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(s1 = \\\"acb\\\", n1 = 4, s2 = \\\"ab\\\", n2 = 2) == 2\\n assert candidate(s1 = \\\"acb\\\", n1 = 1, s2 = \\\"acb\\\", n2 = 1) == 1\\n\\n\\ncheck(Solution().getMaxRepetitions)\"}", "style": "rule" }
{ "dataset": "LeetCodeDataset", "index": 1853, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nWe define str = [s, n] as the string str which consists of the string s concatenated n times.\n\nFor example, str == [\"abc\", 3] ==\"abcabcabc\".\n\nW...
345
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"2\\n17\\n10\"], \"outputs\": [\"2111\\n0\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 777, "prompt": "Solve the programming task below in a Python markdown code block.\nIn a bizarre game of chess ,knight was so drunk, that instead of his usual move he started walking straight. In every move Knight jumps on 2n steps forward (n is number of block that ...
456
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"4\\n5 8\\n6 3\\n2 2\\n1 2\\n\"], \"outputs\": [\"YES\\nNO\\nNO\\nYES\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 708, "prompt": "Solve the programming task below in a Python markdown code block.\nThere is a fair going on in Chefland. Chef wants to visit the fair along with his N friends. Chef manages to collect K passes for the fair. Will Chef be able to enter the fair with al...
568
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"4\\n3 3 2 2\", \"4\\n4 3 2 2\", \"4\\n3 5 3 2\", \"4\\n1 1 2 2\", \"4\\n3 4 2 2\", \"4\\n3 6 2 2\", \"4\\n3 6 4 2\", \"4\\n3 4 3 2\"], \"outputs\": [\"3 5\\n\", \"4 7\\n\", \"6 11\\n\", \"2 3\\n\", \"-1\\n\", \"-1\\n\", \"-1\\n\", \"6 8\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 2574, "prompt": "Solve the programming task below in a Python markdown code block.\nAn adult game master and N children are playing a game on an ice rink. The game consists of K rounds. In the i-th round, the game master announces:\n\n* Form groups consisting of A_i...
507
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"88\", \"73\", \"19\", \"31\", \"799\", \"836\", \"138\", \"774\"], \"outputs\": [\"0\\n\", \"4\\n\", \"8\\n\", \"2\\n\", \"2\\n\", \"5\\n\", \"5\\n\", \"3\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 1, "prompt": "Solve the programming task below in a Python markdown code block.\nIf you visit Aizu Akabeko shrine, you will find a unique paper fortune on which a number with more than one digit is written.\n\nEach digit ranges from 1 to 9 (zero is avoided because i...
513
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"3 4 2\", \"1 4 4\", \"0 0 3\", \"1 1 4\", \"6 8 3\", \"3 6 2\", \"0 8 3\", \"1 4 1\"], \"outputs\": [\"3\\n4\\n\", \"1\\n2\\n3\\n4\\n\", \"0\\n\", \"1\\n\", \"6\\n7\\n8\\n\", \"3\\n4\\n5\\n6\\n\", \"0\\n1\\n2\\n6\\n7\\n8\\n\", \"1\\n4\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 212, "prompt": "Solve the programming task below in a Python markdown code block.\nPrint all the integers that satisfies the following in ascending order:\n - Among the integers between A and B (inclusive), it is either within the K smallest integers or within the K...
340
find-a-peak-element-ii
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
Solution().findPeakGrid
def check(candidate): assert candidate(mat = [[1,4],[3,2]]) == [0,1] assert candidate(mat = [[10,20,15],[21,30,14],[7,16,32]]) == [1,1]
class Solution: def findPeakGrid(self, mat: List[List[int]]) -> List[int]: l, r = 0, len(mat) - 1 while l < r: mid = (l + r) >> 1 j = mat[mid].index(max(mat[mid])) if mat[mid][j] > mat[mid + 1][j]: r = mid else: l = mid ...
[ { "input": "mat = [[1,4],[3,2]]", "output": "[0,1]" }, { "input": "mat = [[10,20,15],[21,30,14],[7,16,32]]", "output": "[1,1]" } ]
A peak element in a 2D grid is an element that is strictly greater than all of its adjacent neighbors to the left, right, top, and bottom. Given a 0-indexed m x n matrix mat where no two adjacent cells are equal, find any peak element mat[i][j] and return the length 2 array [i,j]. You may assume that the entire matrix ...
{ "question_id": 2047, "difficulty": "Medium", "lang_code": "class Solution:\n def findPeakGrid(self, mat: List[List[int]]) -> List[int]:", "question_title": "A peak element in a 2D grid is an element that is strictly greater than all of its adjacent neighbors to the left, right, top, and bottom.\nGiven a 0-...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(mat = [[1,4],[3,2]]) == [0,1]\\n assert candidate(mat = [[10,20,15],[21,30,14],[7,16,32]]) == [1,1]\\n\\n\\ncheck(Solution().findPeakGrid)\"}", "style": "rule" }
{ "dataset": "LeetCodeDataset", "index": 421, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nA peak element in a 2D grid is an element that is strictly greater than all of its adjacent neighbors to the left, right, top, and bottom.\nGiven a 0-in...
271
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"4\\n1 3\\n4 5\\n1031 93714\\n1000000000123 1000000123456\"], \"outputs\": [\"3\\n5\\n131071\\n1000000192511\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 4892, "prompt": "Solve the programming task below in a Python markdown code block.\nRead problems statements in [Hindi], [Mandarin Chinese], [Russian], and [Vietnamese] as well.\n\nDr.D got so famous thanks to his first problem that he decided to commemorate it by m...
415
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"functional\": \"_inputs = [['zero'], ['one'], ['two'], ['three'], ['four'], ['five'], ['six'], ['seven'], ['eight'], ['nine'], ['ten'], ['twenty'], ['twenty-one'], ['thirty-seven'], ['forty-six'], ['fifty-nine'], ['sixty-eight'], ['seventy-two'], ['eighty-three'], ['ninety-four'], ['one hundred'...
{ "dataset": "likaixin/TACO-verified", "index": 10086, "prompt": "Solve the programming task below in a Python markdown code block.\nIn this kata we want to convert a string into an integer. The strings simply represent the numbers in words.\n\nExamples:\n\n* \"one\" => 1\n* \"twenty\" => 20\n* \"two hundred fort...
296
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"2\\n3 4\\n\", \"2\\n3 4\\n\", \"2\\n3 3\\n\", \"2\\n2 3\\n\", \"3\\n1 2 7\\n\", \"3\\n1 2 7\\n\", \"3\\n1 2 11\\n\", \"3\\n2 2 11\\n\"], \"outputs\": [\"1\", \"1\\n\", \"1\\n\", \"1\\n\", \"1\", \"1\\n\", \"1\\n\", \"1\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 2095, "prompt": "Solve the programming task below in a Python markdown code block.\nA sequence $a_1, a_2, \\dots, a_k$ is called an arithmetic progression if for each $i$ from $1$ to $k$ elements satisfy the condition $a_i = a_1 + c \\cdot (i - 1)$ for some fixed $c...
734
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"10:00\\n11:00\\n\", \"11:10\\n11:12\\n\", \"01:02\\n03:02\\n\", \"00:00\\n23:58\\n\", \"00:01\\n23:59\\n\", \"00:00\\n00:02\\n\", \"23:57\\n23:59\\n\", \"11:40\\n12:22\\n\"], \"outputs\": [\"10:30\\n\", \"11:11\\n\", \"02:02\\n\", \"11:59\\n\", \"12:00\\n\", \"00:01\\n\", \"23:58\\n...
{ "dataset": "likaixin/TACO-verified", "index": 3460, "prompt": "Solve the programming task below in a Python markdown code block.\nPolycarp is going to participate in the contest. It starts at $h_1:m_1$ and ends at $h_2:m_2$. It is guaranteed that the contest lasts an even number of minutes (i.e. $m_1 \\% 2 = m_...
650
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"1\\n1\\n372\\n200\\n\", \"1\\n2\\n1456 5324\\n1455 5323\\n\", \"1\\n4\\n372 372 1 8\\n372 372 1 8\\n\", \"1\\n4\\n8293 8293 1 8\\n8293 8293 1 8\\n\", \"6\\n4\\n3 5 4 1\\n1 3 2 0\\n3\\n1 2 1\\n0 1 0\\n4\\n5 3 7 2\\n1 1 1 1\\n5\\n1 2 3 4 5\\n1 2 3 4 6\\n1\\n8\\n0\\n1\\n4\\n6\\n\"], \"...
{ "dataset": "likaixin/TACO-verified", "index": 10742, "prompt": "Solve the programming task below in a Python markdown code block.\nKristina has two arrays $a$ and $b$, each containing $n$ non-negative integers. She can perform the following operation on array $a$ any number of times:\n\napply a decrement to eac...
880
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"1\\nwdi\\n\", \"1\\nwdi\\n\", \"1\\nwci\\n\", \"1\\nwcj\\n\", \"1\\nwjc\\n\", \"1\\ncjw\\n\", \"2\\naa\\na\\n\", \"2\\naa\\na\\n\"], \"outputs\": [\"wdi\\n\", \"wdi\\n\", \"wci\\n\", \"wcj\\n\", \"wjc\\n\", \"cjw\\n\", \"a\\naa\\n\", \"a\\naa\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 2666, "prompt": "Solve the programming task below in a Python markdown code block.\nPolycarp is a big lover of killing time in social networks. A page with a chatlist in his favourite network is made so that when a message is sent to some friend, his friend's chat r...
569