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
895
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], [1, 3], [1, 4]]], [[[1, 3], [5, 3]]], [[[12, 3], [15, 3]]], [[[2, 7], [1, 3], [1, 12]]], [[[69, 130], [87, 1310], [3, 4]]], [[[77, 130], [84, 131], [60, 80]]], [[[6, 13], [187, 1310], [31, 41]]], [[[8, 15], [7, 111], [4, 25]]], [[]], [[[81345, 15786], [87546,...
{ "dataset": "likaixin/TACO-verified", "index": 4810, "prompt": "Solve the programming task below in a Python markdown code block.\nYou will have a list of rationals in the form\n\n```\nlst = [ [numer_1, denom_1] , ... , [numer_n, denom_n] ]\n```\nor\n```\nlst = [ (numer_1, denom_1) , ... , (numer_n, denom_n) ]\n...
719
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\": [\"0 0 2 4\\n1 2\\n1 2\\n\", \"0 0 2 3\\n1 1\\n1 3\\n\", \"0 0 2 4\\n1 1\\n1 2\\n\", \"0 0 2 3\\n1 1\\n1 2\\n\", \"-140 -140 2 200\\n1 0\\n0 1\\n\", \"-12 -34 5 200\\n1 0\\n2 0\\n3 1\\n10 3\\n11 4\\n\", \"0 0 5 101\\n21 38\\n43 42\\n5 29\\n69 3\\n84 52\\n\", \"0 0 5 100\\n12 105\\n15 5...
{ "dataset": "likaixin/TACO-verified", "index": 4513, "prompt": "Solve the programming task below in a Python markdown code block.\nAnton and Dasha like to play different games during breaks on checkered paper. By the 11th grade they managed to play all the games of this type and asked Vova the programmer to come...
619
reachable-nodes-with-restrictions
[ { "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().reachableNodes
def check(candidate): assert candidate(n = 7, edges = [[0,1],[1,2],[3,1],[4,0],[0,5],[5,6]], restricted = [4,5]) == 4 assert candidate(n = 7, edges = [[0,1],[0,2],[0,5],[0,4],[3,2],[6,5]], restricted = [4,2,1]) == 3
class Solution: def reachableNodes( self, n: int, edges: List[List[int]], restricted: List[int] ) -> int: def dfs(i: int) -> int: vis.add(i) return 1 + sum(j not in vis and dfs(j) for j in g[i]) g = defaultdict(list) for a, b in edges: g[a].ap...
[ { "input": "n = 7, edges = [[0,1],[1,2],[3,1],[4,0],[0,5],[5,6]], restricted = [4,5]", "output": "4" }, { "input": "n = 7, edges = [[0,1],[0,2],[0,5],[0,4],[3,2],[6,5]], restricted = [4,2,1]", "output": "3" } ]
There is an undirected tree with n nodes labeled from 0 to n - 1 and n - 1 edges. You are given a 2D integer array edges of length n - 1 where edges[i] = [ai, bi] indicates that there is an edge between nodes ai and bi in the tree. You are also given an integer array restricted which represents restricted nodes. Return...
{ "question_id": 2445, "difficulty": "Medium", "lang_code": "class Solution:\n def reachableNodes(self, n: int, edges: List[List[int]], restricted: List[int]) -> int:", "question_title": "There is an undirected tree with n nodes labeled from 0 to n - 1 and n - 1 edges.\nYou are given a 2D integer array edges...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(n = 7, edges = [[0,1],[1,2],[3,1],[4,0],[0,5],[5,6]], restricted = [4,5]) == 4\\n assert candidate(n = 7, edges = [[0,1],[0,2],[0,5],[0,4],[3,2],[6,5]], restricted = [4,2,1]) == 3\\n\\n\\ncheck(Solution().reachableNodes)\"}", "sty...
{ "dataset": "LeetCodeDataset", "index": 1098, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nThere is an undirected tree with n nodes labeled from 0 to n - 1 and n - 1 edges.\nYou are given a 2D integer array edges of length n - 1 where edges[i...
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\": [\"9 1 8 2\\n4 1 5 9\\n4 6 8 2\\n4 6 3 0\", \"9 1 8 2\\n6 1 5 9\\n4 6 8 2\\n2 6 3 0\", \"9 1 8 2\\n4 1 5 9\\n2 6 8 2\\n4 6 3 0\", \"9 1 8 2\\n6 2 5 9\\n4 6 8 2\\n4 6 3 0\", \"9 1 8 2\\n6 2 5 9\\n4 6 8 2\\n4 9 3 0\", \"9 1 8 2\\n6 0 5 9\\n4 6 5 2\\n4 6 3 0\", \"9 1 8 2\\n6 2 8 9\\n4 6 8...
{ "dataset": "likaixin/TACO-verified", "index": 12706, "prompt": "Solve the programming task below in a Python markdown code block.\nLet's play Hit and Blow game. A imagines four numbers and B guesses the numbers. After B picks out four numbers, A answers:\n\n* The number of numbers which have the same place with...
453
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\\n21\", \"4\\n32\", \"4\\n13\", \"4\\n21\", \"4\\n44\", \"4\\n12\", \"4\\n11\", \"4\\n22\"], \"outputs\": [\"1\\n\", \"1\\n\", \"2\\n\", \"1\\n\", \"0\\n\", \"1\\n\", \"0\\n\", \"0\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 4400, "prompt": "Solve the programming task below in a Python markdown code block.\nGiven is a sequence of N digits a_1a_2\\ldots a_N, where each element is 1, 2, or 3. Let x_{i,j} defined as follows:\n\n* x_{1,j} := a_j \\quad (1 \\leq j \\leq N)\n* x_{i,j} := | x_...
373
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 2\"], \"outputs\": [\"8\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 1539, "prompt": "Solve the programming task below in a Python markdown code block.\nRead problems statements in Mandarin Chinese, Russian and Vietnamese as well. \n\nXenny reverse-engineered all the binaries released by the International Security Agency (ISA)\ndurin...
651
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\": [\"46 4 4 5\", \"64 4 4 5\", \"64 8 4 5\", \"5 9 3 10\", \"54 8 4 5\", \"54 8 2 5\", \"54 6 2 5\", \"54 6 0 5\"], \"outputs\": [\"Yes\\n\", \"Yes\\n\", \"Yes\\n\", \"Yes\\n\", \"Yes\\n\", \"Yes\\n\", \"Yes\\n\", \"Yes\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 117, "prompt": "Solve the programming task below in a Python markdown code block.\nTakahashi and Aoki will have a battle using their monsters.\nThe health and strength of Takahashi's monster are A and B, respectively, and those of Aoki's monster are C and D, respect...
439
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\", \"8\", \"1\", \"7\", \"0\", \"1\\n\", \"16\"], \"outputs\": [\"3\\n\", \"7\\n\", \"22\\n\", \"1\\n\", \"14\\n\", \"0\\n\", \"1\\n\", \"76\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 516, "prompt": "Solve the programming task below in a Python markdown code block.\nLet us define the FizzBuzz sequence a_1,a_2,... as follows:\n - If both 3 and 5 divides i, a_i=\\mbox{FizzBuzz}.\n - If the above does not hold but 3 divides i, a_i=\\mbox{Fizz}.\n - ...
427
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 2\\n6 7\\n-1 1\\n0 1\\n5 2\\n7 3\\n\"], \"outputs\": [\"13\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 7840, "prompt": "Solve the programming task below in a Python markdown code block.\nThere are $n$ pairs of hard disk drives (HDDs) in a cluster. Each HDD is located at an integer coordinate on an infinite straight line, and each pair consists of one primary HDD and ...
853
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\\nnxx\", \"3\\nnwx\", \"3\\nxxo\", \"3\\nxwn\", \"3\\nowx\", \"3\\npxx\", \"3\\npyx\", \"3\\npzx\"], \"outputs\": [\"2\\n\", \"3\\n\", \"1\\n\", \"3\\n\", \"3\\n\", \"2\\n\", \"3\\n\", \"3\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 5523, "prompt": "Solve the programming task below in a Python markdown code block.\nproblem\n\nAOR Ika is studying to pass the test.\n\nAOR Ika-chan solved the $ N $ question. After that, round the solved problem according to the following procedure.\n\n1. Check the...
426
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\\n5\\n1 2 3 4 5\\n8\\n6 6 6 6 6 6 8 8\\n8\\n1 2 2 1 2 1 1 2\\n3\\n1 3 3\\n6\\n1 1 3 4 2 2\\n\", \"5\\n5\\n1 2 3 4 5\\n8\\n6 6 6 6 6 6 8 8\\n8\\n1 2 2 1 2 1 1 2\\n3\\n1 3 3\\n6\\n1 1 3 4 2 2\\n\", \"4\\n14\\n2 6 5 9 5 8 13 14 8 5 6 14 5 2\\n36\\n15 22 27 7 23 36 1 17 33 21 18 7 3 4...
{ "dataset": "likaixin/TACO-verified", "index": 6056, "prompt": "Solve the programming task below in a Python markdown code block.\nThere are $n$ people who want to participate in a boat competition. The weight of the $i$-th participant is $w_i$. Only teams consisting of two people can participate in this competi...
859
minimum-time-to-make-array-sum-at-most-x
[ { "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().minimumTime
def check(candidate): assert candidate(nums1 = [1,2,3], nums2 = [1,2,3], x = 4) == 3 assert candidate(nums1 = [1,2,3], nums2 = [3,3,3], x = 4) == -1
class Solution: def minimumTime(self, nums1: List[int], nums2: List[int], x: int) -> int: n = len(nums1) f = [[0] * (n + 1) for _ in range(n + 1)] for i, (a, b) in enumerate(sorted(zip(nums1, nums2), key=lambda z: z[1]), 1): for j in range(n + 1): f[i][j] = f[i - ...
[ { "input": "nums1 = [1,2,3], nums2 = [1,2,3], x = 4", "output": "3" }, { "input": "nums1 = [1,2,3], nums2 = [3,3,3], x = 4", "output": "-1" } ]
You are given two 0-indexed integer arrays nums1 and nums2 of equal length. Every second, for all indices 0 <= i < nums1.length, value of nums1[i] is incremented by nums2[i]. After this is done, you can do the following operation: Choose an index 0 <= i < nums1.length and make nums1[i] = 0. You are also given an inte...
{ "question_id": 2952, "difficulty": "Hard", "lang_code": "class Solution:\n def minimumTime(self, nums1: List[int], nums2: List[int], x: int) -> int:", "question_title": "You are given two 0-indexed integer arrays nums1 and nums2 of equal length. Every second, for all indices 0 <= i < nums1.length, value of...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(nums1 = [1,2,3], nums2 = [1,2,3], x = 4) == 3\\n assert candidate(nums1 = [1,2,3], nums2 = [3,3,3], x = 4) == -1\\n\\n\\ncheck(Solution().minimumTime)\"}", "style": "rule" }
{ "dataset": "LeetCodeDataset", "index": 1232, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nYou are given two 0-indexed integer arrays nums1 and nums2 of equal length. Every second, for all indices 0 <= i < nums1.length, value of nums1[i] is i...
287
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 1\\n2 2\\n2 3\"], \"outputs\": [\"2\\n25\\n273\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 8744, "prompt": "Solve the programming task below in a Python markdown code block.\nLet's consider a rectangular table R consisting of N rows and M columns. Rows are enumerated from 1 to N from top to bottom. Columns are enumerated from 1 to M from left to right. E...
518
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 0\\n2 1\\n\", \"2 5\\n5 4\\n\", \"2 0\\n2 1\\n\", \"2 5\\n5 4\\n\", \"2 2\\n7 0\\n\", \"2 5\\n5 5\\n\", \"2 5\\n7 5\\n\", \"2 2\\n7 5\\n\"], \"outputs\": [\"1\\n\", \"0\\n\", \"1\\n\", \"0\\n\", \"5\\n\", \"0\\n\", \"0\\n\", \"0\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 5777, "prompt": "Solve the programming task below in a Python markdown code block.\nThe bear decided to store some raspberry for the winter. He cunningly found out the price for a barrel of honey in kilos of raspberry for each of the following n days. According to t...
735
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, 3, 4, 5, 6, 7, 8, 9, 10], 1], [[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 2], [['C', 'o', 'd', 'e', 'W', 'a', 'r', 's'], 4], [['C', 0, 'd', 3, 'W', 4, 'r', 5], 4], [[1, 2, 3, 4, 5, 6, 7], 3], [[], 3], [[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2...
{ "dataset": "likaixin/TACO-verified", "index": 7483, "prompt": "Solve the programming task below in a Python markdown code block.\nThis problem takes its name by arguably the most important event in the life of the ancient historian Josephus: according to his tale, he and his 40 soldiers were trapped in a cave b...
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": "{\"functional\": \"_inputs = [[['Small', 'frame'], '~'], [['Create', 'this', 'kata'], '+'], [['This is a very long single frame'], '-']]\\n_outputs = [['~~~~~~~~~\\\\n~ Small ~\\\\n~ frame ~\\\\n~~~~~~~~~'], ['++++++++++\\\\n+ Create +\\\\n+ this +\\\\n+ kata +\\\\n++++++++++'], ['-------------...
{ "dataset": "likaixin/TACO-verified", "index": 11611, "prompt": "Solve the programming task below in a Python markdown code block.\n```\n*************************\n* Create a frame! *\n* __ __ *\n* / \\~~~/ \\ *\n* ,----( .. ) *\n* / \\__ __/ *\n* /| ...
360
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 = [['key1', 'key22', 'key333'], ['coding', 'sorting', 'tryruby'], ['small keyword', 'how to coding?', 'very nice kata', 'a lot of keys', 'I like Ruby!!!'], ['pippi']]\\n_outputs = [[\\\"'key333'\\\"], [\\\"'sorting', 'tryruby'\\\"], [\\\"'I like Ruby!!!', 'how to coding?'...
{ "dataset": "likaixin/TACO-verified", "index": 11533, "prompt": "Solve the programming task below in a Python markdown code block.\nYou're a programmer in a SEO company. The SEO specialist of your company gets the list of all project keywords everyday, then he looks for the longest keys to analyze them.\n\nYou w...
282
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 = [[[25, 30, 35, 40, 45, 50], [78, 70, 65, 58, 48, 42]], [[56, 42, 72, 36, 63, 47, 55, 49, 38, 42, 68, 60], [147, 125, 160, 118, 149, 128, 150, 145, 115, 140, 152, 155]], [[0, 10, 20, 30, 40], [0.51, 0.55, 0.57, 0.59, 0.63]]]\\n_outputs = [[[114.381, -1.4457]], [[80.7777,...
{ "dataset": "likaixin/TACO-verified", "index": 2229, "prompt": "Solve the programming task below in a Python markdown code block.\n#### Background: \n \n\nA linear regression line has an equation in the form `$Y = a + bX$`, where `$X$` is the explanatory variable and `$Y$` is the dependent variable. The paramete...
708
assign-cookies
[ { "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().findContentChildren
def check(candidate): assert candidate(g = [1,2,3], s = [1,1]) == 1 assert candidate(g = [1,2], s = [1,2,3]) == 2
class Solution: def findContentChildren(self, g: List[int], s: List[int]) -> int: g.sort() s.sort() j = 0 for i, x in enumerate(g): while j < len(s) and s[j] < g[i]: j += 1 if j >= len(s): return i j += 1 ret...
[ { "input": "g = [1,2,3], s = [1,1]", "output": "1" }, { "input": "g = [1,2], s = [1,2,3]", "output": "2" } ]
Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i has a greed factor g[i], which is the minimum size of a cookie that the child will be content with; and each cookie j has a size s[j]. If s[j] >= g[i], we can assign the cookie ...
{ "question_id": 455, "difficulty": "Easy", "lang_code": "class Solution:\n def findContentChildren(self, g: List[int], s: List[int]) -> int:", "question_title": "Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie.\nEach child i ha...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(g = [1,2,3], s = [1,1]) == 1\\n assert candidate(g = [1,2], s = [1,2,3]) == 2\\n\\n\\ncheck(Solution().findContentChildren)\"}", "style": "rule" }
{ "dataset": "LeetCodeDataset", "index": 127, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nAssume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie.\nEach child i has a gr...
263
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\\n1 1 1 1 0\\n3\\n0 1 0\\n4\\n0 0 0 0\\n\"], \"outputs\": [\"1\\n0\\n0\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 6516, "prompt": "Solve the programming task below in a Python markdown code block.\nAlice and Bob are ready to play a new game. Both the players take alternate turns. Alice starts first. \n\nThere are N binary numbers written on a blackboard. \nAlice, in her turn,...
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\": [\"9 6 1\", \"3 3 1\", \"3 3 2\", \"2 1 8\", \"3 5 1\", \"3 6 2\", \"1 3 4\", \"5 1 1\"], \"outputs\": [\"6\\n\", \"1\\n\", \"2\\n\", \"16\\n\", \"15\\n\", \"4\\n\", \"12\\n\", \"5\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 4667, "prompt": "Solve the programming task below in a Python markdown code block.\nIn Aizu prefecture, we decided to create a new town to increase the population. To that end, we decided to cultivate a new rectangular land and divide this land into squares of the s...
374
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\", \"3\\n2 2 1\", \"3\\n2 1 2\", \"3\\n2 1 2\\n\", \"4\\n1 3 1 3\", \"4\\n1 3 3 2\", \"4\\n2 3 2 2\", \"4\\n2 3 4 1\"], \"outputs\": [\"3\\n0\\n0\\n\", \"3\\n1\\n0\\n\", \"3\\n1\\n0\", \"3\\n1\\n0\\n\", \"4\\n2\\n0\\n0\\n\", \"4\\n2\\n1\\n0\\n\", \"4\\n1\\n0\\n0\\n\", \"4\...
{ "dataset": "likaixin/TACO-verified", "index": 9919, "prompt": "Solve the programming task below in a Python markdown code block.\nTakahashi has N cards. The i-th of these cards has an integer A_i written on it.\nTakahashi will choose an integer K, and then repeat the following operation some number of times:\n ...
448
first-missing-positive
[ { "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().firstMissingPositive
def check(candidate): assert candidate(nums = [1,2,0]) == 3 assert candidate(nums = [3,4,-1,1]) == 2 assert candidate(nums = [7,8,9,11,12]) == 1
class Solution: def firstMissingPositive(self, nums: List[int]) -> int: def swap(i, j): nums[i], nums[j] = nums[j], nums[i] n = len(nums) for i in range(n): while 1 <= nums[i] <= n and nums[i] != nums[nums[i] - 1]: swap(i, nums[i] - 1) for i i...
[ { "input": "nums = [1,2,0]", "output": "3" }, { "input": "nums = [3,4,-1,1]", "output": "2" }, { "input": "nums = [7,8,9,11,12]", "output": "1" } ]
Given an unsorted integer array nums. Return the smallest positive integer that is not present in nums. You must implement an algorithm that runs in O(n) time and uses O(1) auxiliary space.   Please complete the following python code precisely: ```python class Solution: def firstMissingPositive(self, nums: List[int...
{ "question_id": 41, "difficulty": "Hard", "lang_code": "class Solution:\n def firstMissingPositive(self, nums: List[int]) -> int:", "question_title": "Given an unsorted integer array nums. Return the smallest positive integer that is not present in nums.\nYou must implement an algorithm that runs in O(n) ti...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(nums = [1,2,0]) == 3\\n assert candidate(nums = [3,4,-1,1]) == 2\\n assert candidate(nums = [7,8,9,11,12]) == 1\\n\\n\\ncheck(Solution().firstMissingPositive)\"}", "style": "rule" }
{ "dataset": "LeetCodeDataset", "index": 518, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nGiven an unsorted integer array nums. Return the smallest positive integer that is not present in nums.\nYou must implement an algorithm that runs in O(...
191
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\": [\"aba\\naaaab\", \"aba\\naa`ab\", \"`ba\\naa`ab\", \"`ab\\naa`ab\", \"ab`\\naa`ab\", \"ab`\\naa`ac\", \"ac`\\naa`ac\", \"`ca\\naa`ac\"], \"outputs\": [\"0\", \"0\", \"0\", \"0\", \"0\", \"0\", \"0\", \"0\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 2359, "prompt": "Solve the programming task below in a Python markdown code block.\nGiven are two strings s and t consisting of lowercase English letters. Determine if the number of non-negative integers i satisfying the following condition is finite, and find the m...
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\": [\"1\\n0 1\\n\", \"1\\n0 1\\n\", \"1\\n1 1\\n\", \"1\\n0 2\\n\", \"1\\n1 2\\n\", \"1\\n0 4\\n\", \"1\\n1 3\\n\", \"1\\n0 3\\n\"], \"outputs\": [\"0\\n\", \"0\", \"0\\n\", \"0\\n\", \"0\\n\", \"0\\n\", \"0\\n\", \"0\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 12487, "prompt": "Solve the programming task below in a Python markdown code block.\nThere are n beacons located at distinct positions on a number line. The i-th beacon has position a_{i} and power level b_{i}. When the i-th beacon is activated, it destroys all beac...
611
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\": [\"9\\n1 2 3 4 5 6 7 8 9\\n9\\n10 1 2 3 11 21 55 6 8\\n\"], \"outputs\": [\"8\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 858, "prompt": "Solve the programming task below in a Python markdown code block.\n.symmetric_difference()\n \nThe .symmetric_difference() operator returns a set with all the elements that are in the set and the iterable but not both.\n\nSometimes, a ^ operator is ...
818
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 3\\n1 2\\n2 3\\n3 1\", \"5 3\\n1 2\\n2 3\\n5 1\", \"3 3\\n2 2\\n2 3\\n3 1\", \"5 3\\n1 2\\n2 3\\n2 1\", \"5 3\\n1 2\\n3 3\\n5 1\", \"5 1\\n1 2\\n3 3\\n5 1\", \"3 3\\n1 2\\n2 3\\n3 1\", \"7 9\\n1 2\\n1 3\\n2 3\\n1 4\\n1 5\\n4 5\\n1 5\\n1 7\\n6 7\"], \"outputs\": [\"No\\n\", \"No\\n...
{ "dataset": "likaixin/TACO-verified", "index": 4657, "prompt": "Solve the programming task below in a Python markdown code block.\nYou are given a simple connected undirected graph consisting of N vertices and M edges. The vertices are numbered 1 to N, and the edges are numbered 1 to M.\n\nEdge i connects Vertex...
534
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 2 3\\n1 2 3\\n1 2\\n2 3\\n\", \"3 2 2\\n1 1 2\\n1 2\\n2 1\\n\", \"3 2 3\\n1 2 3\\n1 2\\n2 3\\n\", \"3 2 2\\n1 1 2\\n1 2\\n2 1\\n\", \"4 2 4\\n1 2 3 4\\n1 2\\n3 4\\n\", \"4 2 4\\n1 2 3 4\\n1 2\\n3 4\\n\", \"4 2 4\\n1 2 3 4\\n1 3\\n3 4\\n\", \"4 2 4\\n1 2 1 4\\n1 3\\n3 4\\n\"], \"ou...
{ "dataset": "likaixin/TACO-verified", "index": 12678, "prompt": "Solve the programming task below in a Python markdown code block.\nArseniy is already grown-up and independent. His mother decided to leave him alone for m days and left on a vacation. She have prepared a lot of food, left some money and washed all...
849
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 3\\n6\\n1 3 2 6 5 4\\n4\\n4 1 3 2\\n8\\n3 2 1 6 7 8 5 4\\n\", \"4\\n3\\n1 2 3\\n6\\n1 3 2 6 5 4\\n4\\n4 1 3 2\\n8\\n3 0 1 6 7 8 5 4\\n\", \"4\\n3\\n1 2 3\\n6\\n1 3 2 6 5 4\\n4\\n4 1 3 2\\n8\\n3 2 1 6 7 1 5 4\\n\", \"4\\n3\\n1 2 0\\n6\\n1 3 2 6 5 4\\n4\\n4 1 3 2\\n8\\n3 0...
{ "dataset": "likaixin/TACO-verified", "index": 1999, "prompt": "Solve the programming task below in a Python markdown code block.\nYou are given a permutation p consisting of n integers 1, 2, ..., n (a permutation is an array where each element from 1 to n occurs exactly once).\n\nLet's call an array a bipartite...
527
longest-subarray-of-1s-after-deleting-one-element
[ { "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().longestSubarray
def check(candidate): assert candidate(nums = [1,1,0,1]) == 3 assert candidate(nums = [0,1,1,1,0,1,1,0,1]) == 5 assert candidate(nums = [1,1,1]) == 2
class Solution: def longestSubarray(self, nums: List[int]) -> int: n = len(nums) left = [0] * (n + 1) right = [0] * (n + 1) for i, x in enumerate(nums, 1): if x: left[i] = left[i - 1] + 1 for i in range(n - 1, -1, -1): if nums[i]: ...
[ { "input": "nums = [1,1,0,1]", "output": "3" }, { "input": "nums = [0,1,1,1,0,1,1,0,1]", "output": "5" }, { "input": "nums = [1,1,1]", "output": "2" } ]
Given a binary array nums, you should delete one element from it. Return the size of the longest non-empty subarray containing only 1's in the resulting array. Return 0 if there is no such subarray.   Please complete the following python code precisely: ```python class Solution: def longestSubarray(self, nums: List...
{ "question_id": 1586, "difficulty": "Medium", "lang_code": "class Solution:\n def longestSubarray(self, nums: List[int]) -> int:", "question_title": "Given a binary array nums, you should delete one element from it.\nReturn the size of the longest non-empty subarray containing only 1's in the resulting arra...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(nums = [1,1,0,1]) == 3\\n assert candidate(nums = [0,1,1,1,0,1,1,0,1]) == 5\\n assert candidate(nums = [1,1,1]) == 2\\n\\n\\ncheck(Solution().longestSubarray)\"}", "style": "rule" }
{ "dataset": "LeetCodeDataset", "index": 653, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nGiven a binary array nums, you should delete one element from it.\nReturn the size of the longest non-empty subarray containing only 1's in the resultin...
195
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\\n7\\n3 2 15 6 8 5 10\"], \"outputs\": [\"5\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 7149, "prompt": "Solve the programming task below in a Python markdown code block.\nTara was completing an Algorithms assignment and got stuck on a question. She thought of who can help her, and got reminded of Kabir who has good problem solving skills. The question...
522
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\\n0010 3716 520\\n14 3661 29\\n1507 2460 80\\n1101 670 2276\\n2\\n0011 100 0\\n954 1100 000\\n2\\n715 245 100\\n883 426 100\\n0\", \"4\\n0010 2000 520\\n14 3661 29\\n1507 375 1160\\n1100 670 2276\\n2\\n0011 100 0\\n954 1100 000\\n2\\n715 245 100\\n50 426 100\\n0\", \"4\\n0110 1753...
{ "dataset": "likaixin/TACO-verified", "index": 7000, "prompt": "Solve the programming task below in a Python markdown code block.\nThere is data on sales of your company. Your task is to write a program which identifies good workers.\n\nThe program should read a list of data where each item includes the employee...
504
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\\n7\\n7 3 2 -11 -13 -17 -23\\n6\\n4 10 25 47 71 96\\n6\\n71 -35 7 -4 -11 -25\\n6\\n-45 9 -48 -67 -55 7\\n\", \"8\\n2\\n-59 -9\\n1\\n11\\n3\\n-41 -26 -2\\n3\\n22 33 54\\n3\\n-56 -6 55\\n5\\n36 15 9 14 -71\\n3\\n-7 40 47\\n5\\n-19 54 -5 7 -29\\n\"], \"outputs\": [\"NO\\nYES\\nYES\\n...
{ "dataset": "likaixin/TACO-verified", "index": 6611, "prompt": "Solve the programming task below in a Python markdown code block.\nOne day Prof. Slim decided to leave the kingdom of the GUC to join the kingdom of the GIU. He was given an easy online assessment to solve before joining the GIU. Citizens of the GUC...
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": "{\"functional\": \"_inputs = [[[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]], [[]], [[1337, 374, 849, 22.5, 19, 16, 0, 0, 16, 32]], [[-16, -32, 20, 21, 41, 42]], [[15397, 12422, 10495, 22729, 23921, 18326, 27955, 24073, 23690, 15002, 11615, 15682, 24346, 16725, 17252, 20467, 20493, 17807, 13041, 25861, 22471, 2...
{ "dataset": "likaixin/TACO-verified", "index": 1000, "prompt": "Solve the programming task below in a Python markdown code block.\n# Task\n\nWrite a function named `sumEvenNumbers`, taking a sequence of numbers as single parameter. Your function must return the sum of **the even values** of this sequence.\n\nOnl...
275
find-a-value-of-a-mysterious-function-closest-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().closestToTarget
def check(candidate): assert candidate(arr = [9,12,3,7,15], target = 5) == 2 assert candidate(arr = [1000000,1000000,1000000], target = 1) == 999999 assert candidate(arr = [1,2,4,8,16], target = 0) == 0
class Solution: def closestToTarget(self, arr: List[int], target: int) -> int: ans = abs(arr[0] - target) s = {arr[0]} for x in arr: s = {x & y for y in s} | {x} ans = min(ans, min(abs(y - target) for y in s)) return ans
[ { "input": "arr = [9,12,3,7,15], target = 5", "output": "2" }, { "input": "arr = [1000000,1000000,1000000], target = 1", "output": "999999" }, { "input": "arr = [1,2,4,8,16], target = 0", "output": "0" } ]
Winston was given the above mysterious function func. He has an integer array arr and an integer target and he wants to find the values l and r that make the value |func(arr, l, r) - target| minimum possible. Return the minimum possible value of |func(arr, l, r) - target|. Notice that func should be called with the va...
{ "question_id": 1645, "difficulty": "Hard", "lang_code": "class Solution:\n def closestToTarget(self, arr: List[int], target: int) -> int:", "question_title": "\nWinston was given the above mysterious function func. He has an integer array arr and an integer target and he wants to find the values l and r th...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(arr = [9,12,3,7,15], target = 5) == 2\\n assert candidate(arr = [1000000,1000000,1000000], target = 1) == 999999\\n assert candidate(arr = [1,2,4,8,16], target = 0) == 0\\n\\n\\ncheck(Solution().closestToTarget)\"}", "style": "...
{ "dataset": "LeetCodeDataset", "index": 377, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nWinston was given the above mysterious function func. He has an integer array arr and an integer target and he wants to find the values l and r that mak...
244
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 3 2\\n5\\n1 2 4 8 16\\n2\\n6 6\\n3\\n3 5 6\\n\"], \"outputs\": [\"3\\n31\\n6\\n7\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 366, "prompt": "Solve the programming task below in a Python markdown code block.\nYou are given an array $a$ of size $n$.\n\nYou can perform the following operation on the array:\n\nChoose two different integers $i, j$ $(1 \\leq i < j \\leq n$), replace $a_i$ with ...
663
check-if-a-number-is-majority-element-in-a-sorted-array
[ { "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().isMajorityElement
def check(candidate): assert candidate(nums = [2,4,5,5,5,5,5,6,6], target = 5) == True assert candidate(nums = [10,100,101,101], target = 101) == False
class Solution: def isMajorityElement(self, nums: List[int], target: int) -> bool: left = bisect_left(nums, target) right = bisect_right(nums, target) return right - left > len(nums) // 2
[ { "input": "nums = [2,4,5,5,5,5,5,6,6], target = 5", "output": "True" }, { "input": "nums = [10,100,101,101], target = 101", "output": "False" } ]
Given an integer array nums sorted in non-decreasing order and an integer target, return true if target is a majority element, or false otherwise. A majority element in an array nums is an element that appears more than nums.length / 2 times in the array.   Please complete the following python code precisely: ```python...
{ "question_id": 1102, "difficulty": "Easy", "lang_code": "class Solution:\n def isMajorityElement(self, nums: List[int], target: int) -> bool:", "question_title": "Given an integer array nums sorted in non-decreasing order and an integer target, return true if target is a majority element, or false otherwis...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(nums = [2,4,5,5,5,5,5,6,6], target = 5) == True\\n assert candidate(nums = [10,100,101,101], target = 101) == False\\n\\n\\ncheck(Solution().isMajorityElement)\"}", "style": "rule" }
{ "dataset": "LeetCodeDataset", "index": 160, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nGiven an integer array nums sorted in non-decreasing order and an integer target, return true if target is a majority element, or false otherwise.\nA ma...
208
maximize-the-minimum-powered-city
[ { "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().maxPower
def check(candidate): assert candidate(stations = [1,2,4,5,0], r = 1, k = 2) == 5 assert candidate(stations = [4,4,4,4], r = 0, k = 3) == 4
class Solution: def maxPower(self, stations: List[int], r: int, k: int) -> int: def check(x, k): d = [0] * (n + 1) t = 0 for i in range(n): t += d[i] dist = x - (s[i] + t) if dist > 0: if k < dist: ...
[ { "input": "stations = [1,2,4,5,0], r = 1, k = 2", "output": "5" }, { "input": "stations = [4,4,4,4], r = 0, k = 3", "output": "4" } ]
You are given a 0-indexed integer array stations of length n, where stations[i] represents the number of power stations in the ith city. Each power station can provide power to every city in a fixed range. In other words, if the range is denoted by r, then a power station at city i can provide power to all cities j suc...
{ "question_id": 2618, "difficulty": "Hard", "lang_code": "class Solution:\n def maxPower(self, stations: List[int], r: int, k: int) -> int:", "question_title": "You are given a 0-indexed integer array stations of length n, where stations[i] represents the number of power stations in the ith city.\nEach powe...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(stations = [1,2,4,5,0], r = 1, k = 2) == 5\\n assert candidate(stations = [4,4,4,4], r = 0, k = 3) == 4\\n\\n\\ncheck(Solution().maxPower)\"}", "style": "rule" }
{ "dataset": "LeetCodeDataset", "index": 708, "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 stations of length n, where stations[i] represents the number of power stations in the ith city.\nEach power sta...
380
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 = [[['Computer', 'Cell Phones', 'Vacuum Cleaner'], [3, 24, 8], [199, 299, 399]], [['Cell Phones', 'Vacuum Cleaner', 'Computer', 'Autos', 'Gold', 'Fishing Rods', 'Lego', ' Speakers'], [5, 25, 2, 7, 10, 3, 2, 24], [51, 225, 22, 47, 510, 83, 82, 124]], [['Cell Phones', 'Vacu...
{ "dataset": "likaixin/TACO-verified", "index": 606, "prompt": "Solve the programming task below in a Python markdown code block.\nYou work in the best consumer electronics corporation, and your boss wants to find out which three products generate the most revenue.\nGiven 3 lists of the same length like these:\n\...
266
divide-players-into-teams-of-equal-skill
[ { "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().dividePlayers
def check(candidate): assert candidate(skill = [3,2,5,1,3,4]) == 22 assert candidate(skill = [3,4]) == 12 assert candidate(skill = [1,1,2,3]) == -1
class Solution: def dividePlayers(self, skill: List[int]) -> int: skill.sort() t = skill[0] + skill[-1] i, j = 0, len(skill) - 1 ans = 0 while i < j: if skill[i] + skill[j] != t: return -1 ans += skill[i] * skill[j] i, j = i...
[ { "input": "skill = [3,2,5,1,3,4]", "output": "22" }, { "input": "skill = [3,4]", "output": "12" }, { "input": "skill = [1,1,2,3]", "output": "-1" } ]
You are given a positive integer array skill of even length n where skill[i] denotes the skill of the ith player. Divide the players into n / 2 teams of size 2 such that the total skill of each team is equal. The chemistry of a team is equal to the product of the skills of the players on that team. Return the sum of th...
{ "question_id": 2581, "difficulty": "Medium", "lang_code": "class Solution:\n def dividePlayers(self, skill: List[int]) -> int:", "question_title": "You are given a positive integer array skill of even length n where skill[i] denotes the skill of the ith player. Divide the players into n / 2 teams of size 2...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(skill = [3,2,5,1,3,4]) == 22\\n assert candidate(skill = [3,4]) == 12\\n assert candidate(skill = [1,1,2,3]) == -1\\n\\n\\ncheck(Solution().dividePlayers)\"}", "style": "rule" }
{ "dataset": "LeetCodeDataset", "index": 557, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nYou are given a positive integer array skill of even length n where skill[i] denotes the skill of the ith player. Divide the players into n / 2 teams of...
254
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\\ndaBcd\\nABC\\n\"], \"outputs\": [\"YES\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 11224, "prompt": "Solve the programming task below in a Python markdown code block.\nYou can perform the following operations on the string, $a$: \n\nCapitalize zero or more of $a$'s lowercase letters.\nDelete all of the remaining lowercase letters in $a$.\n\nGiven...
713
partition-equal-subset-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().canPartition
def check(candidate): assert candidate(nums = [1,5,11,5]) == True assert candidate(nums = [1,2,3,5]) == False
class Solution: def canPartition(self, nums: List[int]) -> bool: m, mod = divmod(sum(nums), 2) if mod: return False n = len(nums) f = [[False] * (m + 1) for _ in range(n + 1)] f[0][0] = True for i, x in enumerate(nums, 1): for j in range(m + 1)...
[ { "input": "nums = [1,5,11,5]", "output": "true" }, { "input": "nums = [1,2,3,5]", "output": "false" } ]
Given an integer array nums, return true if you can partition the array into two subsets such that the sum of the elements in both subsets is equal or false otherwise.   Please complete the following python code precisely: ```python class Solution: def canPartition(self, nums: List[int]) -> bool: ```
{ "question_id": 416, "difficulty": "Medium", "lang_code": "class Solution:\n def canPartition(self, nums: List[int]) -> bool:", "question_title": "Given an integer array nums, return true if you can partition the array into two subsets such that the sum of the elements in both subsets is equal or false othe...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(nums = [1,5,11,5]) == True\\n assert candidate(nums = [1,2,3,5]) == False\\n\\n\\ncheck(Solution().canPartition)\"}", "style": "rule" }
{ "dataset": "LeetCodeDataset", "index": 938, "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 true if you can partition the array into two subsets such that the sum of the elements in both subsets is equal or f...
181
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\\n\"], \"outputs\": [\"4\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 6376, "prompt": "Solve the programming task below in a Python markdown code block.\nA number, ${x}$, is called irresponsible when adding ${x}$ to $x+1$ requires a carry operation. For example, $5$, $17$, and ${91}$ are irresponsible numbers because adding them to ${...
838
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\\nt j\\n\", \"2\\nip cd\", \"2\\nip dc\", \"2\\npi cd\", \"2\\npi ce\", \"2\\noi ce\", \"2\\nni ce\", \"2\\nni ec\"], \"outputs\": [\"tj\\n\", \"icpd\\n\", \"idpc\\n\", \"pcid\\n\", \"pcie\\n\", \"ocie\\n\", \"ncie\\n\", \"neic\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 5542, "prompt": "Solve the programming task below in a Python markdown code block.\nGiven are strings s and t of length N each, both consisting of lowercase English letters.\nLet us form a new string by alternating the characters of S and the characters of T, as fol...
290
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 = [['Nokia'], ['Valut'], ['toilet'], ['waterheater'], ['birdhouse']]\\n_outputs = [['66542'], ['82588'], ['864538'], ['92837432837'], ['247346873']]\\nimport math\\ndef _deep_eq(a, b, tol=1e-5):\\n if isinstance(a, float) or isinstance(b, float):\\n return math....
{ "dataset": "likaixin/TACO-verified", "index": 10948, "prompt": "Solve the programming task below in a Python markdown code block.\nIntroduction \n\nMr. Safety loves numeric locks and his Nokia 3310. He locked almost everything in his house. He is so smart and he doesn't need to remember the combinations. He has...
341
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\\n2 2\\n3 1\"], \"outputs\": [\"1\\n6\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 5335, "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\nChef likes sequences of integers and in particular, he likes arithmetic pr...
617
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\": [\"`a\\n\", \"a`\\n\", \"aa\\n\", \"aa`\\n\", \"a`a\\n\", \"aaa\\n\", \"aabba\\n\", \"bbaab\\n\"], \"outputs\": [\"1\\n\", \"1\\n\", \"1\\n\", \"4\\n\", \"3\\n\", \"5\\n\", \"18\\n\", \"18\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 4327, "prompt": "Solve the programming task below in a Python markdown code block.\nYou are given a non-empty string s consisting of lowercase letters. Find the number of pairs of non-overlapping palindromic substrings of this string.\n\nIn a more formal way, you ha...
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\\n2\\n1 2\\n3\\n1 2 1\\n4\\n2 6 5 2\"], \"outputs\": [\"2\\n2 1\\n2\\n2 1 1\\n4\\n6 2 2 5\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 108, "prompt": "Solve the programming task below in a Python markdown code block.\nRead problems statements in Vietnamese .\n\nChef likes to work with arrays a lot. Today he has an array A of length N consisting of positive integers. Chef's little brother likes to ...
708
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\": [\"DDTM\"], \"outputs\": [\"17\\n1\\n6\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 1483, "prompt": "Solve the programming task below in a Python markdown code block.\nMark loves eating chocolates and also likes to be fit. Given the calorie count for every chocolate he eats, find what he has to do to burn the calories. \nThe name of the chocolates ...
484
word-ladder-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().findLadders
def check(candidate): assert candidate(beginWord = "hit", endWord = "cog", wordList = ["hot","dot","dog","lot","log","cog"]) == [["hit","hot","dot","dog","cog"],["hit","hot","lot","log","cog"]] assert candidate(beginWord = "hit", endWord = "cog", wordList = ["hot","dot","dog","lot","log"]) == []
class Solution: def findLadders( self, beginWord: str, endWord: str, wordList: List[str] ) -> List[List[str]]: def dfs(path, cur): if cur == beginWord: ans.append(path[::-1]) return for precursor in prev[cur]: path.append(pr...
[ { "input": "beginWord = \"hit\", endWord = \"cog\", wordList = [\"hot\",\"dot\",\"dog\",\"lot\",\"log\",\"cog\"]", "output": "[[\"hit\",\"hot\",\"dot\",\"dog\",\"cog\"],[\"hit\",\"hot\",\"lot\",\"log\",\"cog\"]]" }, { "input": "beginWord = \"hit\", endWord = \"cog\", wordList = [\"hot\",\"dot\",\"do...
A transformation sequence from word beginWord to word endWord using a dictionary wordList is a sequence of words beginWord -> s1 -> s2 -> ... -> sk such that: Every adjacent pair of words differs by a single letter. Every si for 1 <= i <= k is in wordList. Note that beginWord does not need to be in wordList. sk == end...
{ "question_id": 126, "difficulty": "Hard", "lang_code": "class Solution:\n def findLadders(self, beginWord: str, endWord: str, wordList: List[str]) -> List[List[str]]:", "question_title": "A transformation sequence from word beginWord to word endWord using a dictionary wordList is a sequence of words beginW...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(beginWord = \\\"hit\\\", endWord = \\\"cog\\\", wordList = [\\\"hot\\\",\\\"dot\\\",\\\"dog\\\",\\\"lot\\\",\\\"log\\\",\\\"cog\\\"]) == [[\\\"hit\\\",\\\"hot\\\",\\\"dot\\\",\\\"dog\\\",\\\"cog\\\"],[\\\"hit\\\",\\\"hot\\\",\\\"lot\\\...
{ "dataset": "LeetCodeDataset", "index": 1616, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nA transformation sequence from word beginWord to word endWord using a dictionary wordList is a sequence of words beginWord -> s1 -> s2 -> ... -> sk suc...
311
height-of-binary-tree-after-subtree-removal-queries
[ { "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().treeQueries
def check(candidate): assert candidate(root = tree_node([1,3,4,2,None,6,5,None,None,None,None,None,7]), queries = [4]) == [2] assert candidate(root = tree_node([5,8,9,2,1,3,7,4,6]), queries = [3,2,4,8]) == [3,2,3,2]
# 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 treeQueries(self, root: Optional[TreeNode], queries: List[int]) -> List[int]: def f(root): ...
[ { "input": "root = [1,3,4,2,null,6,5,null,null,null,null,null,7], queries = [4]", "output": "[2]" }, { "input": "root = [5,8,9,2,1,3,7,4,6], queries = [3,2,4,8]", "output": "[3,2,3,2]" } ]
You are given the root of a binary tree with n nodes. Each node is assigned a unique value from 1 to n. You are also given an array queries of size m. You have to perform m independent queries on the tree where in the ith query you do the following: Remove the subtree rooted at the node with the value queries[i] from ...
{ "question_id": 2545, "difficulty": "Hard", "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 treeQueries(self, root: Optional...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(root = tree_node([1,3,4,2,None,6,5,None,None,None,None,None,7]), queries = [4]) == [2]\\n assert candidate(root = tree_node([5,8,9,2,1,3,7,4,6]), queries = [3,2,4,8]) == [3,2,3,2]\\n\\n\\ncheck(Solution().treeQueries)\"}", "style"...
{ "dataset": "LeetCodeDataset", "index": 1657, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nYou are given the root of a binary tree with n nodes. Each node is assigned a unique value from 1 to n. You are also given an array queries of size m.\...
378
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\\n1\\n\", \"1 1\\n2\\n\", \"1 1\\n3\\n\", \"2 1\\n2 1\\n\", \"2 1\\n1 1\\n\", \"3 2\\n1 0 4\\n\", \"3 2\\n1 0 3\\n\", \"3 2\\n1 0 2\\n\"], \"outputs\": [\" 2\", \"3\\n\", \"4\\n\", \"5\\n\", \" ...
{ "dataset": "likaixin/TACO-verified", "index": 7146, "prompt": "Solve the programming task below in a Python markdown code block.\nProfessor GukiZ is concerned about making his way to school, because massive piles of boxes are blocking his way. \n\nIn total there are n piles of boxes, arranged in a line, from le...
750
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\": [\"z\\n0\\n\", \"y\\n0\\n\", \"x\\n0\\n\", \"ababa\\n1\\nba\\n\", \"abbba\\n1\\nba\\n\", \"ababa\\n1\\nab\\n\", \"nllnrlrnll\\n1\\nrl\\n\", \"llnrlrnlln\\n1\\nrl\\n\"], \"outputs\": [\"0\\n\", \"0\\n\", \"0\\n\", \"2\\n\", \"2\\n\", \"2\\n\", \"1\\n\", \"1\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 9801, "prompt": "Solve the programming task below in a Python markdown code block.\nSergey attends lessons of the N-ish language. Each lesson he receives a hometask. This time the task is to translate some sentence to the N-ish language. Sentences of the N-ish langu...
686
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\\n2\\n1 2\\n3\\n5 10 25\\n\"], \"outputs\": [\"2\\n5\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 10793, "prompt": "Solve the programming task below in a Python markdown code block.\n\"Everybody! Doremy's Perfect Math Class is about to start! Come and do your best if you want to have as much IQ as me!\" In today's math class, Doremy is teaching everyone subtract...
751
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\\n2 1\\n\", \"1 0\\n1000\", \"1 1\\n1001\", \"0 1\\n1011\", \"1 1\\n1010\", \"1 1\\n1000\", \"1 1\\n1000\\n\", \"-1 1\\n0111\"], \"outputs\": [\"1\\n\", \"0\\n\", \"1001\\n\", \"1011\\n\", \"1010\\n\", \"1000\", \"1000\\n\", \"111\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 3622, "prompt": "Solve the programming task below in a Python markdown code block.\nA shop sells N kinds of fruits, Fruit 1, \\ldots, N, at prices of p_1, \\ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)\nHere, we will choose K kinds of fruit...
414
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 3 4 5 6\\n2 -1 -2 0 -1 -5\", \"1 2 3 4 5 6\\n2 -1 -2 0 -1 -4\", \"1 2 3 4 6 4\\n2 -1 -4 -1 0 -5\", \"1 2 3 3 5 6\\n2 -1 -2 0 -1 -4\", \"1 2 3 4 0 4\\n2 -1 -4 -1 0 -5\", \"2 1 3 5 5 4\\n4 -1 -4 -1 0 -5\", \"1 2 3 3 5 6\\n2 -1 -2 -1 0 -4\", \"2 1 1 5 5 4\\n4 -1 -4 -1 0 -5\"], \"ou...
{ "dataset": "likaixin/TACO-verified", "index": 4593, "prompt": "Solve the programming task below in a Python markdown code block.\nWrite a program which solve a simultaneous equation:\n\nax + by = c\ndx + ey = f\n\nThe program should print x and y for given a, b, c, d, e and f (-1,000 ≤ a, b, c, d, e, f ≤ 1,000)...
398
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\\n10\\n20\\n12\\n5\"], \"outputs\": [\"YES\\nNO\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 1569, "prompt": "Solve the programming task below in a Python markdown code block.\nThere are total N friends went to Chef's Pizza shop. There they bought a pizza. Chef divided the pizza into K equal slices. Now you have to check whether these K pizza slices can be ...
425
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\": [\"456\"], \"outputs\": [\"900\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 1746, "prompt": "Solve the programming task below in a Python markdown code block.\nProgrammer Deepak has created a program which calculates magical number as 2^n * 3^n * 5^n where \"n\" is an integer.\n\nNow he wants to find the magical number which is just greater...
241
max-sum-of-rectangle-no-larger-than-k
[ { "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().maxSumSubmatrix
def check(candidate): assert candidate(matrix = [[1,0,1],[0,-2,3]], k = 2) == 2 assert candidate(matrix = [[2,2,-1]], k = 3) == 3
from sortedcontainers import SortedSet class Solution: def maxSumSubmatrix(self, matrix: List[List[int]], k: int) -> int: m, n = len(matrix), len(matrix[0]) ans = -inf for i in range(m): nums = [0] * n for j in range(i, m): for h in range(n): ...
[ { "input": "matrix = [[1,0,1],[0,-2,3]], k = 2", "output": "2" }, { "input": "matrix = [[2,2,-1]], k = 3", "output": "3" } ]
Given an m x n matrix matrix and an integer k, return the max sum of a rectangle in the matrix such that its sum is no larger than k. It is guaranteed that there will be a rectangle with a sum no larger than k.   Please complete the following python code precisely: ```python class Solution: def maxSumSubmatrix(self...
{ "question_id": 363, "difficulty": "Hard", "lang_code": "class Solution:\n def maxSumSubmatrix(self, matrix: List[List[int]], k: int) -> int:", "question_title": "Given an m x n matrix matrix and an integer k, return the max sum of a rectangle in the matrix such that its sum is no larger than k.\nIt is guar...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(matrix = [[1,0,1],[0,-2,3]], k = 2) == 2\\n assert candidate(matrix = [[2,2,-1]], k = 3) == 3\\n\\n\\ncheck(Solution().maxSumSubmatrix)\"}", "style": "rule" }
{ "dataset": "LeetCodeDataset", "index": 774, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nGiven an m x n matrix matrix and an integer k, return the max sum of a rectangle in the matrix such that its sum is no larger than k.\nIt is guaranteed ...
205
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\": [\"a\\n\", \"a\\n\", \"`\\n\", \"_\\n\", \"^\\n\", \"]\\n\", \"\\\\\\n\", \"[\\n\"], \"outputs\": [\"0\\n\", \"0\\n\", \"0\\n\", \"0\\n\", \"0\\n\", \"0\\n\", \"0\\n\", \"0\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 11234, "prompt": "Solve the programming task below in a Python markdown code block.\nThe bear has a string s = s_1s_2... s_{|}s| (record |s| is the string's length), consisting of lowercase English letters. The bear wants to count the number of such pairs of indices...
610
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\\n5\\n\", \"1\\n5\\n4\\n\", \"1\\n5\\n5\\n\", \"1\\n5\\n4\\n\", \"1\\n4\\n5\\n\", \"1\\n5\\n5\\n\", \"1\\n5\\n2\\n\", \"1\\n4\\n6\\n\"], \"outputs\": [\"4\\n\", \"4\\n\", \"5\\n\", \"4 \", \"4 \", \"5 \", \"2\\n\", \"4\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 2204, "prompt": "Solve the programming task below in a Python markdown code block.\nAlice likes snow a lot! Unfortunately, this year's winter is already over, and she can't expect to have any more of it. Bob has thus bought her a gift — a large snow maker. He plans ...
707
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\\n\", \"1\\n7\\n\", \"1\\n2\\n\", \"1\\n9\\n\", \"1\\n8\\n\", \"1\\n6\\n\", \"1\\n3\\n\", \"1\\n5\\n\"], \"outputs\": [\"7\\n\", \"1\\n\", \"3\\n\", \"15\\n\", \"15\\n\", \"7\\n\", \"1\\n\", \"7\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 12219, "prompt": "Solve the programming task below in a Python markdown code block.\nCan the greatest common divisor and bitwise operations have anything in common? It is time to answer this question.\n\nSuppose you are given a positive integer $a$. You want to choo...
710
richest-customer-wealth
[ { "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().maximumWealth
def check(candidate): assert candidate(accounts = [[1,2,3],[3,2,1]]) == 6 assert candidate(accounts = [[1,5],[7,3],[3,5]]) == 10 assert candidate(accounts = [[2,8,7],[7,1,3],[1,9,5]]) == 17
class Solution: def maximumWealth(self, accounts: List[List[int]]) -> int: return max(sum(v) for v in accounts)
[ { "input": "accounts = [[1,2,3],[3,2,1]]", "output": "6" }, { "input": "accounts = [[1,5],[7,3],[3,5]]", "output": "10" }, { "input": "accounts = [[2,8,7],[7,1,3],[1,9,5]]", "output": "17" } ]
You are given an m x n integer grid accounts where accounts[i][j] is the amount of money the i​​​​​​​​​​​th​​​​ customer has in the j​​​​​​​​​​​th​​​​ bank. Return the wealth that the richest customer has. A customer's wealth is the amount of money they have in all their bank accounts. The richest customer is the custo...
{ "question_id": 1791, "difficulty": "Easy", "lang_code": "class Solution:\n def maximumWealth(self, accounts: List[List[int]]) -> int:", "question_title": "You are given an m x n integer grid accounts where accounts[i][j] is the amount of money the i​​​​​​​​​​​th​​​​ customer has in the j​​​​​​​​​​​th​​​​ b...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(accounts = [[1,2,3],[3,2,1]]) == 6\\n assert candidate(accounts = [[1,5],[7,3],[3,5]]) == 10\\n assert candidate(accounts = [[2,8,7],[7,1,3],[1,9,5]]) == 17\\n\\n\\ncheck(Solution().maximumWealth)\"}", "style": "rule" }
{ "dataset": "LeetCodeDataset", "index": 252, "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 grid accounts where accounts[i][j] is the amount of money the i​​​​​​​​​​​th​​​​ customer has in the j​​​​​​​​​​​th​​​​ b...
371
bomb-enemy
[ { "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().maxKilledEnemies
def check(candidate): assert candidate(grid = [["0","E","0","0"],["E","0","W","E"],["0","E","0","0"]]) == 3 assert candidate(grid = [["W","W","W"],["0","0","0"],["E","E","E"]]) == 1
class Solution: def maxKilledEnemies(self, grid: List[List[str]]) -> int: m, n = len(grid), len(grid[0]) g = [[0] * n for _ in range(m)] for i in range(m): t = 0 for j in range(n): if grid[i][j] == 'W': t = 0 elif gr...
[ { "input": "grid = [[\"0\",\"E\",\"0\",\"0\"],[\"E\",\"0\",\"W\",\"E\"],[\"0\",\"E\",\"0\",\"0\"]]", "output": "3" }, { "input": "grid = [[\"W\",\"W\",\"W\"],[\"0\",\"0\",\"0\"],[\"E\",\"E\",\"E\"]]", "output": "1" } ]
Given an m x n matrix grid where each cell is either a wall 'W', an enemy 'E' or empty '0', return the maximum enemies you can kill using one bomb. You can only place the bomb in an empty cell. The bomb kills all the enemies in the same row and column from the planted point until it hits the wall since it is too strong...
{ "question_id": 361, "difficulty": "Medium", "lang_code": "class Solution:\n def maxKilledEnemies(self, grid: List[List[str]]) -> int:", "question_title": "Given an m x n matrix grid where each cell is either a wall 'W', an enemy 'E' or empty '0', return the maximum enemies you can kill using one bomb. You ...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(grid = [[\\\"0\\\",\\\"E\\\",\\\"0\\\",\\\"0\\\"],[\\\"E\\\",\\\"0\\\",\\\"W\\\",\\\"E\\\"],[\\\"0\\\",\\\"E\\\",\\\"0\\\",\\\"0\\\"]]) == 3\\n assert candidate(grid = [[\\\"W\\\",\\\"W\\\",\\\"W\\\"],[\\\"0\\\",\\\"0\\\",\\\"0\\\"]...
{ "dataset": "LeetCodeDataset", "index": 1767, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nGiven an m x n matrix grid where each cell is either a wall 'W', an enemy 'E' or empty '0', return the maximum enemies you can kill using one bomb. You...
230
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 3\\n1 2 300\\n2 2 100\\n2 3\\n1 1 100\\n2 2 300\\n2 3\\n3 2 150\\n1 1 200\"], \"outputs\": [\"100\\n0\\n150\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 1566, "prompt": "Solve the programming task below in a Python markdown code block.\nRead problems statements in Mandarin Chinese, Russian and Vietnamese as well. \n\nDuring the Indian Programming Camp (IPC), there are N trainers. The camp runs for D days. Each day, ...
875
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 = [['Ifmmp'], ['Uif usjdl up uijt lbub jt tjnqmf'], [45], ['XiBu BcPvU dSbAz UfYu'], [['Hello there', 'World']], ['BMM DBQT NBZCF'], ['qVAamFt BsF gVo'], ['CodeWars RockZ'], [''], ['J ipqf zpv bsf ibwjoh b ojdf ebz']]\\n_outputs = [['Hello'], ['The trick to this kata is s...
{ "dataset": "likaixin/TACO-verified", "index": 6491, "prompt": "Solve the programming task below in a Python markdown code block.\nA very passive-aggressive co-worker of yours was just fired. While he was gathering his things, he quickly inserted a bug into your system which renamed everything to what looks like...
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": "{\"inputs\": [\"3\\n4\\n1 2 4 8\\n3\\n2 3 3\\n5\\n3 3 3 3 3\", \"3\\n4\\n1 2 4 8\\n3\\n2 3 3\\n5\\n1 3 3 3 3\", \"3\\n4\\n1 2 4 2\\n3\\n3 3 3\\n5\\n1 3 2 3 3\", \"3\\n4\\n1 2 8 7\\n3\\n2 1 3\\n5\\n1 3 1 3 3\", \"3\\n4\\n1 2 4 8\\n3\\n3 3 3\\n5\\n1 3 3 3 3\", \"3\\n4\\n1 2 4 8\\n3\\n3 3 3\\n5\\n1 3 ...
{ "dataset": "likaixin/TACO-verified", "index": 4478, "prompt": "Solve the programming task below in a Python markdown code block.\nRead problems statements in Mandarin Chinese, Russian and Vietnamese as well. \nNim is a well-known combinatorial game, based on removing stones from piles. In this problem, we'll de...
483
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\\nbananasqr\\naaaaa\\nabcde\\nayacazkeafagahbcbdbebfbg\\nqweer\\n\"], \"outputs\": [\"bansqr\\na\\nabcde\\nayczkefghbd\\nqwer\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 7500, "prompt": "Solve the programming task below in a Python markdown code block.\nGiven a word consisting of lowercase English letters, write a program to remove duplicates from the word. The characters in the output must preserve the same order, as their first ap...
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 3\\n\", \"4 2\\n\", \"4 6\\n\", \"2 1\\n\", \"17957 2\\n\", \"300000 1\\n\", \"2 1000000000000\\n\", \"1337 424242424242\\n\"], \"outputs\": [\"6\\n\", \"26\\n\", \"1494\\n\", \"1\\n\", \"653647969\\n\", \"299999\\n\", \"138131255\\n\", \"119112628\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 9922, "prompt": "Solve the programming task below in a Python markdown code block.\nConsider an array $a$ of length $n$ with elements numbered from $1$ to $n$. It is possible to remove the $i$-th element of $a$ if $gcd(a_i, i) = 1$, where $gcd$ denotes the greatest ...
797
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- 1\\n\", \"1\\n- 1\\n+\\n\", \"3\\n+\\n+\\n+\\n- 2\\n- 1\\n- 2\\n\", \"3\\n+\\n+\\n+\\n- 2\\n- 1\\n- 3\\n\", \"4\\n+\\n- 1\\n+\\n+\\n- 4\\n+\\n- 2\\n- 3\\n\", \"4\\n+\\n+\\n+\\n- 3\\n- 4\\n+\\n- 1\\n- 2\\n\", \"4\\n+\\n+\\n+\\n- 4\\n- 4\\n+\\n- 1\\n- 2\\n\", \"4\\n+\\n+\\n+...
{ "dataset": "likaixin/TACO-verified", "index": 3363, "prompt": "Solve the programming task below in a Python markdown code block.\nTenten runs a weapon shop for ninjas. Today she is willing to sell n shurikens which cost 1, 2, ..., n ryo (local currency). During a day, Tenten will place the shurikens onto the sh...
845
partition-labels
[ { "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().partitionLabels
def check(candidate): assert candidate(s = "ababcbacadefegdehijhklij") == [9,7,8] assert candidate(s = "eccbbbbdec") == [10]
class Solution: def partitionLabels(self, s: str) -> List[int]: last = {c: i for i, c in enumerate(s)} mx = j = 0 ans = [] for i, c in enumerate(s): mx = max(mx, last[c]) if mx == i: ans.append(i - j + 1) j = i + 1 retur...
[ { "input": "s = \"ababcbacadefegdehijhklij\"", "output": "[9,7,8]" }, { "input": "s = \"eccbbbbdec\"", "output": "[10]" } ]
You are given a string s. We want to partition the string into as many parts as possible so that each letter appears in at most one part. Note that the partition is done so that after concatenating all the parts in order, the resultant string should be s. Return a list of integers representing the size of these parts. ...
{ "question_id": 768, "difficulty": "Medium", "lang_code": "class Solution:\n def partitionLabels(self, s: str) -> List[int]:", "question_title": "You are given a string s. We want to partition the string into as many parts as possible so that each letter appears in at most one part.\nNote that the partition...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(s = \\\"ababcbacadefegdehijhklij\\\") == [9,7,8]\\n assert candidate(s = \\\"eccbbbbdec\\\") == [10]\\n\\n\\ncheck(Solution().partitionLabels)\"}", "style": "rule" }
{ "dataset": "LeetCodeDataset", "index": 504, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nYou are given a string s. We want to partition the string into as many parts as possible so that each letter appears in at most one part.\nNote that the...
217
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\\n10 4\\n7 3\\n\"], \"outputs\": [\"10\\n7\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 2439, "prompt": "Solve the programming task below in a Python markdown code block.\nHarvey Specter has agreed to take Mike Ross to a meeting filled with brilliant scientists at NSA Headquarters. But, as always, it's not going to be easy for Mike. He has to solve a p...
518
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\\n22 1\\n26 9\\n2 11\\n3 6\\n3 96\\n\", \"5\\n22 1\\n26 61\\n2 11\\n3 6\\n3 96\\n\", \"5\\n4 1\\n42 61\\n10 11\\n3 1\\n3 47\\n\", \"5\\n4 1\\n42 61\\n13 11\\n3 1\\n3 63\\n\", \"5\\n41 1\\n26 13\\n2 14\\n3 6\\n3 96\\n\", \"5\\n41 1\\n26 13\\n2 14\\n3 6\\n5 96\\n\", \"5\\n1 1\\n42 6...
{ "dataset": "likaixin/TACO-verified", "index": 12681, "prompt": "Solve the programming task below in a Python markdown code block.\nYou are given an integer n. You have to apply m operations to it.\n\nIn a single operation, you must replace every digit d of the number with the decimal representation of integer d...
488
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\\n96\\n86\\n\", \"1 1\\n96\\n86\\n\", \"1 1\\n71\\n86\\n\", \"1 1\\n50\\n86\\n\", \"1 1\\n126\\n86\\n\", \"8 4\\n3 8 7 9 9 4 6 8\\n2 5 9 4 3 8 9 1\\n\", \"8 4\\n3 8 7 9 9 4 6 8\\n2 5 9 4 3 8 9 0\\n\", \"8 4\\n3 3 7 9 9 4 6 8\\n2 5 9 4 3 8 9 0\\n\"], \"outputs\": [\"182\", \"182\...
{ "dataset": "likaixin/TACO-verified", "index": 9699, "prompt": "Solve the programming task below in a Python markdown code block.\nThe marmots need to prepare k problems for HC^2 over n days. Each problem, once prepared, also has to be printed.\n\nThe preparation of a problem on day i (at most one per day) costs...
606
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\\n11\\n3\\n101\\n7\\n0100101\\n\"], \"outputs\": [\"1\\n2\\n1\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 6552, "prompt": "Solve the programming task below in a Python markdown code block.\nChef has a binary string S of size N. Chef can perform the following operation on the string:\nSelect any substring of size 3 and reverse it.\n\nFind the minimum *distance* between a...
690
longest-substring-with-at-least-k-repeating-characters
[ { "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().longestSubstring
def check(candidate): assert candidate(s = "aaabb", k = 3) == 3 assert candidate(s = "ababbc", k = 2) == 5
class Solution: def longestSubstring(self, s: str, k: int) -> int: def dfs(l, r): cnt = Counter(s[l : r + 1]) split = next((c for c, v in cnt.items() if v < k), '') if not split: return r - l + 1 i = l ans = 0 while i <=...
[ { "input": "s = \"aaabb\", k = 3", "output": "3" }, { "input": "s = \"ababbc\", k = 2", "output": "5" } ]
Given a string s and an integer k, return the length of the longest substring of s such that the frequency of each character in this substring is greater than or equal to k. if no such substring exists, return 0.   Please complete the following python code precisely: ```python class Solution: def longestSubstring(s...
{ "question_id": 395, "difficulty": "Medium", "lang_code": "class Solution:\n def longestSubstring(self, s: str, k: int) -> int:", "question_title": "Given a string s and an integer k, return the length of the longest substring of s such that the frequency of each character in this substring is greater than ...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(s = \\\"aaabb\\\", k = 3) == 3\\n assert candidate(s = \\\"ababbc\\\", k = 2) == 5\\n\\n\\ncheck(Solution().longestSubstring)\"}", "style": "rule" }
{ "dataset": "LeetCodeDataset", "index": 1652, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nGiven a string s and an integer k, return the length of the longest substring of s such that the frequency of each character in this substring is great...
198
counting-elements
[ { "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().countElements
def check(candidate): assert candidate(arr = [1,2,3]) == 2 assert candidate(arr = [1,1,3,3,5,5,7,7]) == 0
class Solution: def countElements(self, arr: List[int]) -> int: cnt = Counter(arr) return sum(v for x, v in cnt.items() if cnt[x + 1])
[ { "input": "arr = [1,2,3]", "output": "2" }, { "input": "arr = [1,1,3,3,5,5,7,7]", "output": "0" } ]
Given an integer array arr, count how many elements x there are, such that x + 1 is also in arr. If there are duplicates in arr, count them separately.   Please complete the following python code precisely: ```python class Solution: def countElements(self, arr: List[int]) -> int: ```
{ "question_id": 1391, "difficulty": "Easy", "lang_code": "class Solution:\n def countElements(self, arr: List[int]) -> int:", "question_title": "Given an integer array arr, count how many elements x there are, such that x + 1 is also in arr. If there are duplicates in arr, count them separately.\n \nExample...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(arr = [1,2,3]) == 2\\n assert candidate(arr = [1,1,3,3,5,5,7,7]) == 0\\n\\n\\ncheck(Solution().countElements)\"}", "style": "rule" }
{ "dataset": "LeetCodeDataset", "index": 1888, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nGiven an integer array arr, count how many elements x there are, such that x + 1 is also in arr. If there are duplicates in arr, count them separately....
184
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\\n2 2\\n2 5\\n3 5\\n\"], \"outputs\": [\"1\\n2\\n4\\n5\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 10625, "prompt": "Solve the programming task below in a Python markdown code block.\nDavid was given a red checkered rectangle of size $n \\times m$. But he doesn't like it. So David cuts the original or any other rectangle piece obtained during the cutting into two...
474
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\": [\"0 1\\nD\\n\", \"1 0\\nD\\n\", \"0 0\\nD\\n\", \"1 1\\nLD\\n\", \"0 -1\\nU\\n\", \"-1 0\\nR\\n\", \"-1 1\\nR\\n\", \"2 4\\nRU\\n\"], \"outputs\": [\"No\\n\", \"No\\n\", \"Yes\\n\", \"No\\n\", \"No\\n\", \"No\\n\", \"No\\n\", \"No\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 3831, "prompt": "Solve the programming task below in a Python markdown code block.\nFox Ciel has a robot on a 2D plane. Initially it is located in (0, 0). Fox Ciel code a command to it. The command was represented by string s. Each character of s is one move operati...
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\": [\"3\\n2\\n5 10\\n2\\n10 5\\n2\\n5 15\\n\"], \"outputs\": [\"YES\\nNO\\nNO\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 3482, "prompt": "Solve the programming task below in a Python markdown code block.\nChef owns an icecream shop in Chefland named scoORZ. There are only three types of coins in Chefland: Rs. 5, Rs. 10 and Rs. 15. An icecream costs Rs. 5.\nThere are $N$ people (number...
740
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\\n4\\n\"], \"outputs\": [\"3\\n3\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 10425, "prompt": "Solve the programming task below in a Python markdown code block.\nYou are given $\\mbox{Q}$ queries. Each query consists of a single number $N$. You can perform any of the $2$ operations on $N$ in each move:\n\n1: If we take 2 integers $\\class{ML...
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\": [\"1\\n5\\n3 3 3 3 3\\n\", \"1\\n5\\n3 3 3 3 3\\n\", \"1\\n5\\n3 3 0 3 3\\n\", \"1\\n5\\n3 3 1 3 3\\n\", \"1\\n5\\n3 0 1 4 3\\n\", \"1\\n5\\n2 1 0 2 2\\n\", \"1\\n5\\n0 3 0 3 3\\n\", \"1\\n5\\n3 0 1 3 3\\n\"], \"outputs\": [\"5\\n\", \"5\\n\", \"5\\n\", \"4\\n\", \"3\\n\", \"2\\n\", \"...
{ "dataset": "likaixin/TACO-verified", "index": 5391, "prompt": "Solve the programming task below in a Python markdown code block.\nYou are given an array $a$ consisting of $n$ integers $a_1, a_2, \\dots , a_n$.\n\nIn one operation you can choose two elements of the array and replace them with the element equal t...
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\": [\"5\\nabbba\", \"12\\nabcbcabbacba\"], \"outputs\": [\"5\\nabbba\", \"8\\nbcabbacb\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 11693, "prompt": "Solve the programming task below in a Python markdown code block.\nAs we all know, a palindrome is a word that equals its reverse. Here are some examples of palindromes: malayalam, gag, appa, amma.\nWe consider any sequence consisting of the letter...
561
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\\n(())\\n)()(\\n()(()\\n\"], \"outputs\": [\"0 1\\n2 1\\n1 2\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 10118, "prompt": "Solve the programming task below in a Python markdown code block.\nA string consisting only of parentheses \\verb+(+ and \\verb+)+ is called a parentheses string. The balanced parentheses strings are defined recursively as follows:\n\nAn empty stri...
753
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\\n5 7\\n3 3\\n0 0\", \"3 6\\n5 6\\n3 3\\n0 0\", \"3 4\\n5 0\\n3 3\\n0 0\", \"3 4\\n5 3\\n3 3\\n0 0\", \"3 4\\n8 0\\n3 3\\n0 0\", \"5 4\\n8 0\\n3 3\\n0 0\", \"5 4\\n8 0\\n3 6\\n0 0\", \"3 4\\n5 6\\n5 3\\n0 0\"], \"outputs\": [\"####\\n#..#\\n####\\n\\n#######\\n#.....#\\n#.....#\...
{ "dataset": "likaixin/TACO-verified", "index": 4982, "prompt": "Solve the programming task below in a Python markdown code block.\nDraw a frame which has a height of H cm and a width of W cm. For example, the following figure shows a frame which has a height of 6 cm and a width of 10 cm.\n\n\n\n........#\n.........
331
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 0 0 2\\n\", \"4\\n1 0 0 0\\n\", \"4\\n1 0 1 2\\n\", \"5\\n4 1 4 7 6\\n\", \"5\\n2 1 4 7 6\\n\", \"5\\n2 2 4 7 6\\n\", \"5\\n2 2 6 7 6\\n\", \"5\\n2 2 9 7 6\\n\"], \"outputs\": [\"1\\n1\\n2\\n\", \"1\\n1\\n2\\n\", \"1\\n1\\n3\\n\", \"4\\n5\\n9\\n17\\n\", \"2\\n3\\n7\\n15\\n\", ...
{ "dataset": "likaixin/TACO-verified", "index": 11559, "prompt": "Solve the programming task below in a Python markdown code block.\nThe Smart Beaver from ABBYY began to develop a new educational game for children. The rules of the game are fairly simple and are described below.\n\nThe playing field is a sequence...
714
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\": [\"a\\n0\\n5 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\", \"a\\n0\\n5 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\", \"a\\n0\\n5 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\\n\", \"a\\n1\\n5 1 1 1 1 1 1 0 2 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 0 1\\n\", \"a\\n0\\n5 1...
{ "dataset": "likaixin/TACO-verified", "index": 12186, "prompt": "Solve the programming task below in a Python markdown code block.\nDZY loves collecting special strings which only contain lowercase letters. For each lowercase letter c DZY knows its value w_{c}. For each special string s = s_1s_2... s_{|}s| (|s| ...
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": "{\"inputs\": [\"3\\n4\\ndbca\\n3\\nccc\\n3\\nbza\"], \"outputs\": [\"YES\\nYES\\nNO\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 1463, "prompt": "Solve the programming task below in a Python markdown code block.\nChef is working on his swap-based sorting algorithm for strings.\n\nGiven a string S of length N, he wants to know whether he can sort the string using his algorithm.\n\nAccording to...
728
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\\nABCDAB\\nABCDAB\\n8\\nDDCABCCA\\nDNCBBBBA\\n3\\nCDD\\nNDC\"], \"outputs\": [\"6\\n3\\n1\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 7538, "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\nChef is taking a cooking exam. The exam consists of $N$ multiple-choice qu...
829
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\\n0\\n\", \"1\\n1\\n\", \"1\\n2\\n\", \"1\\n4\\n\", \"1\\n6\\n\", \"1\\n3\\n\", \"1\\n9\\n\", \"1\\n-1\\n\"], \"outputs\": [\"0 0 0\\n\", \"0 0 1\\n\", \"0 0 1\\n\", \"0 0 1\\n\", \"0 0 1\\n\", \"0 0 1\\n\", \"0 0 1\\n\", \"0 0 0\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 1069, "prompt": "Solve the programming task below in a Python markdown code block.\nYou are given an array of n integer numbers. Let sum(l, r) be the sum of all numbers on positions from l to r non-inclusive (l-th element is counted, r-th element is not counted). Fo...
523
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\": [\"u\\n\", \"u\\n\", \"v\\n\", \"w\\n\", \"zza\\n\", \"abb\\n\", \"zaz\\n\", \"acc\\n\"], \"outputs\": [\"u\\n\", \"u\\n\", \"v\\n\", \"w\\n\", \"zaz\\n\", \"bab\\n\", \"zaz\\n\", \"cac\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 7937, "prompt": "Solve the programming task below in a Python markdown code block.\nA string is called palindrome if it reads the same from left to right and from right to left. For example \"kazak\", \"oo\", \"r\" and \"mikhailrubinchikkihcniburliahkim\" are palind...
399
find-the-winner-of-the-circular-game
[ { "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().findTheWinner
def check(candidate): assert candidate(n = 5, k = 2) == 3 assert candidate(n = 6, k = 5) == 1
class Solution: def findTheWinner(self, n: int, k: int) -> int: if n == 1: return 1 ans = (k + self.findTheWinner(n - 1, k)) % n return n if ans == 0 else ans
[ { "input": "n = 5, k = 2", "output": "3" }, { "input": "n = 6, k = 5", "output": "1" } ]
There are n friends that are playing a game. The friends are sitting in a circle and are numbered from 1 to n in clockwise order. More formally, moving clockwise from the ith friend brings you to the (i+1)th friend for 1 <= i < n, and moving clockwise from the nth friend brings you to the 1st friend. The rules of the g...
{ "question_id": 1951, "difficulty": "Medium", "lang_code": "class Solution:\n def findTheWinner(self, n: int, k: int) -> int:", "question_title": "There are n friends that are playing a game. The friends are sitting in a circle and are numbered from 1 to n in clockwise order. More formally, moving clockwise...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(n = 5, k = 2) == 3\\n assert candidate(n = 6, k = 5) == 1\\n\\n\\ncheck(Solution().findTheWinner)\"}", "style": "rule" }
{ "dataset": "LeetCodeDataset", "index": 854, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nThere are n friends that are playing a game. The friends are sitting in a circle and are numbered from 1 to n in clockwise order. More formally, moving ...
358
integer-to-roman
[ { "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().intToRoman
def check(candidate): assert candidate(num = 3) == "III" assert candidate(num = 4) == "IV" assert candidate(num = 9) == "IX" assert candidate(num = 58) == "LVIII" assert candidate(num = 1994) == "MCMXCIV"
class Solution: def intToRoman(self, num: int) -> str: cs = ('M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I') vs = (1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1) ans = [] for c, v in zip(cs, vs): while num >= v: num -= v ...
[ { "input": "num = 3", "output": "\"III\"" }, { "input": "num = 4", "output": "\"IV\"" }, { "input": "num = 9", "output": "\"IX\"" }, { "input": "num = 58", "output": "\"LVIII\"" }, { "input": "num = 1994", "output": "\"MCMXCIV\"" } ]
Seven different symbols represent Roman numerals with the following values: Symbol Value I 1 V 5 X 10 L 50 C 100 D 500 M 1000 Roman numerals are formed by appending the conversions of decimal place values from highest to lowest. Converting a decimal place value into a Roman numeral has the followi...
{ "question_id": 12, "difficulty": "Medium", "lang_code": "class Solution:\n def intToRoman(self, num: int) -> str:", "question_title": "Seven different symbols represent Roman numerals with the following values:\n\n\n\nSymbol\nValue\n\n\n\n\nI\n1\n\n\nV\n5\n\n\nX\n10\n\n\nL\n50\n\n\nC\n100\n\n\nD\n500\n\n\n...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(num = 3) == \\\"III\\\"\\n assert candidate(num = 4) == \\\"IV\\\"\\n assert candidate(num = 9) == \\\"IX\\\"\\n assert candidate(num = 58) == \\\"LVIII\\\"\\n assert candidate(num = 1994) == \\\"MCMXCIV\\\"\\n\\n\\ncheck(S...
{ "dataset": "LeetCodeDataset", "index": 224, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nSeven different symbols represent Roman numerals with the following values:\n\n\n\nSymbol\nValue\n\n\n\n\nI\n1\n\n\nV\n5\n\n\nX\n10\n\n\nL\n50\n\n\nC\n1...
532
remove-all-adjacent-duplicates-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().removeDuplicates
def check(candidate): assert candidate("abbaca") == "ca"
class Solution: def removeDuplicates(self, s: str) -> str: stk = [] for c in s: if stk and stk[-1] == c: stk.pop() else: stk.append(c) return ''.join(stk)
[ { "input": "\"abbaca\"", "output": "\"ca\"" } ]
You are given a string s consisting of lowercase English letters. A duplicate removal consists of choosing two adjacent and equal letters and removing them. We repeatedly make duplicate removals on s until we no longer can. Return the final string after all such duplicate removals have been made. It can be proven that ...
{ "question_id": 1128, "difficulty": "Easy", "lang_code": "class Solution:\n def removeDuplicates(self, s: str) -> str:", "question_title": "You are given a string s consisting of lowercase English letters. A duplicate removal consists of choosing two adjacent and equal letters and removing them.\nWe repeate...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(\\\"abbaca\\\") == \\\"ca\\\"\\n\\n\\ncheck(Solution().removeDuplicates)\"}", "style": "rule" }
{ "dataset": "LeetCodeDataset", "index": 1163, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nYou are given a string s consisting of lowercase English letters. A duplicate removal consists of choosing two adjacent and equal letters and removing ...
214
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 1 2\\n\", \"3 3 3\\n\", \"5 1 1\\n\", \"2 1 1\\n\", \"1 1 1\\n\", \"3 1 1\\n\", \"5 2 2\\n\", \"4 1 1\\n\"], \"outputs\": [\"YES\\n001\\n001\\n110\\n\", \"NO\\n\", \"YES\\n01000\\n10100\\n01010\\n00101\\n00010\\n\", \"NO\\n\", \"YES\\n0\\n\", \"NO\\n\", \"NO\\n\", \"YES\\n0100\\n1...
{ "dataset": "likaixin/TACO-verified", "index": 5700, "prompt": "Solve the programming task below in a Python markdown code block.\nGiven three numbers $n, a, b$. You need to find an adjacency matrix of such an undirected graph that the number of components in it is equal to $a$, and the number of components in i...
686
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 1\\n\", \"2\\n1 110\\n2 1 10\\n\", \"2\\n1 100\\n2 1 10\\n\", \"2\\n2 60 2\\n3 1 000 4\\n\", \"2\\n2 60 2\\n3 1 000 5\\n\", \"2\\n2 200 1\\n3 1 100 2\\n\", \"2\\n2 200 2\\n3 1 100 2\\n\", \"2\\n2 200 2\\n3 1 000 2\\n\"], \"outputs\": [\"1 0\\n\", \"111 10\\n\", \"101 10\\n\", ...
{ "dataset": "likaixin/TACO-verified", "index": 9495, "prompt": "Solve the programming task below in a Python markdown code block.\nFox Ciel is playing a card game with her friend Fox Jiro. There are n piles of cards on the table. And there is a positive integer on each card.\n\nThe players take turns and Ciel ta...
674
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 3\\n1 2\\n4 3\\n1 4\\n2 7\\n1 000\\n3 1\", \"4 3\\n1 2\\n2 3\\n2 4\\n2 4\\n2 100\\n3 1\", \"2 3\\n1 2\\n2 4\\n1 4\\n1 6\\n2 100\\n1 1\", \"4 3\\n1 2\\n2 3\\n2 4\\n2 4\\n2 100\\n3 0\", \"4 3\\n1 2\\n2 3\\n2 4\\n2 4\\n2 110\\n3 0\", \"2 3\\n1 2\\n2 4\\n1 4\\n1 3\\n2 100\\n1 1\", \"4...
{ "dataset": "likaixin/TACO-verified", "index": 869, "prompt": "Solve the programming task below in a Python markdown code block.\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\nEach of the vertices has a count...
761
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 2\\n1\\n\", \"1 2 2\\n1\\n\", \"1 4 2\\n1\\n\", \"1 6 2\\n1\\n\", \"1 2 4\\n1\\n\", \"1 4 0\\n1\\n\", \"1 6 1\\n1\\n\", \"1 2 5\\n1\\n\"], \"outputs\": [\"2\\n\", \"2\\n\", \"4\\n\", \"6\\n\", \"2\\n\", \"4\\n\", \"6\\n\", \"2\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 6124, "prompt": "Solve the programming task below in a Python markdown code block.\nPupils decided to go to amusement park. Some of them were with parents. In total, n people came to the park and they all want to get to the most extreme attraction and roll on it exa...
664
guess-number-higher-or-lower-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().getMoneyAmount
def check(candidate): assert candidate(n = 10) == 16 assert candidate(n = 1) == 0 assert candidate(n = 2) == 1
class Solution: def getMoneyAmount(self, n: int) -> int: dp = [[0] * (n + 10) for _ in range(n + 10)] for l in range(2, n + 1): for i in range(1, n - l + 2): j = i + l - 1 dp[i][j] = inf for k in range(i, j + 1): t = max...
[ { "input": "n = 10", "output": "16" }, { "input": "n = 1", "output": "0" }, { "input": "n = 2", "output": "1" } ]
We are playing the Guessing Game. The game will work as follows: I pick a number between 1 and n. You guess a number. If you guess the right number, you win the game. If you guess the wrong number, then I will tell you whether the number I picked is higher or lower, and you will continue guessing. Every time you guess...
{ "question_id": 375, "difficulty": "Medium", "lang_code": "class Solution:\n def getMoneyAmount(self, n: int) -> int:", "question_title": "We are playing the Guessing Game. The game will work as follows:\n\nI pick a number between 1 and n.\nYou guess a number.\nIf you guess the right number, you win the gam...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(n = 10) == 16\\n assert candidate(n = 1) == 0\\n assert candidate(n = 2) == 1\\n\\n\\ncheck(Solution().getMoneyAmount)\"}", "style": "rule" }
{ "dataset": "LeetCodeDataset", "index": 884, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nWe are playing the Guessing Game. The game will work as follows:\n\nI pick a number between 1 and n.\nYou guess a number.\nIf you guess the right number...
297
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 = [['9783815820865'], ['9783815820864'], ['9783827317100']]\\n_outputs = [[True], [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_tol=tol, abs_tol=tol)\\n if i...
{ "dataset": "likaixin/TACO-verified", "index": 82, "prompt": "Solve the programming task below in a Python markdown code block.\nA lot of goods have an International Article Number (formerly known as \"European Article Number\") abbreviated \"EAN\". EAN is a 13-digits barcode consisting of 12-digits data follow...
646