task_id
stringlengths
3
77
prompt
listlengths
2
2
entry_point
stringlengths
14
56
test
stringlengths
59
925
completion
stringlengths
83
3.41k
examples
listlengths
1
5
src
stringlengths
199
2.12k
meta
dict
data_source
stringclasses
1 value
ability
stringclasses
1 value
reward_model
dict
extra_info
dict
token_count
int64
158
1.02k
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
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 2 2 4\\n2 1 1\\n3 0\\n4 1 3\", \"4\\n1 2 0 4\\n2 1 1\\n3 0\\n4 1 3\", \"4\\n1 2 1 4\\n2 1 1\\n3 0\\n4 1 3\", \"4\\n1 2 1 4\\n2 1 2\\n3 0\\n4 1 3\", \"4\\n1 2 0 4\\n2 1 2\\n3 0\\n4 1 3\", \"4\\n1 2 0 4\\n2 1 4\\n3 0\\n0 1 3\", \"4\\n1 2 0 4\\n2 1 3\\n3 0\\n4 1 3\", \"4\\n1 2 0 ...
{ "dataset": "likaixin/TACO-verified", "index": 8859, "prompt": "Solve the programming task below in a Python markdown code block.\nThere are two standard ways to represent a graph $G = (V, E)$, where $V$ is a set of vertices and $E$ is a set of edges; Adjacency list representation and Adjacency matrix representa...
580
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\": [\"6 10\\n4 6 4 1 9 3\\n\", \"6 10\\n4 3 4 1 9 3\\n\", \"6 10\\n4 3 4 2 9 3\\n\", \"6 10\\n4 3 2 2 9 3\\n\", \"6 10\\n4 3 0 2 9 3\\n\", \"6 10\\n5 6 4 1 9 3\\n\", \"5 1\\n24 30 18 9 76\\n\", \"5 1\\n24 28 18 9 76\\n\"], \"outputs\": [\"30\\n\", \"30\\n\", \"30\\n\", \"30\\n\", \"30\\n\...
{ "dataset": "likaixin/TACO-verified", "index": 3058, "prompt": "Solve the programming task below in a Python markdown code block.\nAccording to the regulations of Berland's army, a reconnaissance unit should consist of exactly two soldiers. Since these two soldiers shouldn't differ much, their heights can differ...
394
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"3\\n1 4\\n3 6\\n3 5\"], \"outputs\": [\"139\\n40079781\\n32745632\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 11113, "prompt": "Solve the programming task below in a Python markdown code block.\nA squarer is a simple and convenient device. You give it some positive integer X and it calculates its square.\nLeha is implementing a module of this device which is responsible for...
556
find-the-closest-palindrome
[ { "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().nearestPalindromic
def check(candidate): assert candidate(n = "123") == "121" assert candidate(n = "1") == "0"
class Solution: def nearestPalindromic(self, n: str) -> str: x = int(n) l = len(n) res = {10 ** (l - 1) - 1, 10**l + 1} left = int(n[: (l + 1) >> 1]) for i in range(left - 1, left + 2): j = i if l % 2 == 0 else i // 10 while j: i = i * ...
[ { "input": "n = \"123\"", "output": "\"121\"" }, { "input": "n = \"1\"", "output": "\"0\"" } ]
Given a string n representing an integer, return the closest integer (not including itself), which is a palindrome. If there is a tie, return the smaller one. The closest is defined as the absolute difference minimized between two integers.   Please complete the following python code precisely: ```python class Solution...
{ "question_id": 564, "difficulty": "Hard", "lang_code": "class Solution:\n def nearestPalindromic(self, n: str) -> str:", "question_title": "Given a string n representing an integer, return the closest integer (not including itself), which is a palindrome. If there is a tie, return the smaller one.\nThe clo...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(n = \\\"123\\\") == \\\"121\\\"\\n assert candidate(n = \\\"1\\\") == \\\"0\\\"\\n\\n\\ncheck(Solution().nearestPalindromic)\"}", "style": "rule" }
{ "dataset": "LeetCodeDataset", "index": 679, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nGiven a string n representing an integer, return the closest integer (not including itself), which is a palindrome. If there is a tie, return the smalle...
196
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\\n7\\n15\", \"3\\n7\\n45\", \"3\\n7\\n76\", \"3\\n7\\n54\", \"3\\n0\\n76\", \"3\\n2\\n43\", \"3\\n2\\n59\", \"3\\n1\\n34\"], \"outputs\": [\"3\\n\", \"7\\n\", \"11\\n\", \"8\\n\", \"26\\n\", \"15\\n\", \"20\\n\", \"12\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 665, "prompt": "Solve the programming task below in a Python markdown code block.\nWe have a grid with H rows and W columns, where all the squares are initially white.\n\nYou will perform some number of painting operations on the grid. In one operation, you can do o...
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\\n5\\n4 6 8 1 10\\n10 3\\n2\\n1 2\\n1 2\"], \"outputs\": [\"18\\nNot Possible\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 198, "prompt": "Solve the programming task below in a Python markdown code block.\nNaman owns a very famous Ice Cream parlour in Pune. He has a wide range of flavours with different pricing. \n\nEvery flavour costs ₹ X per gram and quantity of each flavour in the pa...
528
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"functional\": \"_inputs = [['John Doe hs seven red pples under his bsket'], ['Bb Smith sent us six neatly arranged range bicycles']]\\n_outputs = [[0], [3]]\\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, re...
{ "dataset": "likaixin/TACO-verified", "index": 9226, "prompt": "Solve the programming task below in a Python markdown code block.\nYour job is to figure out the index of which vowel is missing from a given string:\n\n* `A` has an index of 0,\n* `E` has an index of 1, \n* `I` has an index of 2, \n* `O` has an ind...
310
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\", \"6\", \"8\", \"9\", \"7\", \"6\", \"5\", \"4\"], \"outputs\": [\"865\\n\", \"3247\\n\", \"45719\\n\", \"171531\\n\", \"12185\\n\", \"3247\\n\", \"865\\n\", \"230\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 1370, "prompt": "Solve the programming task below in a Python markdown code block.\nYou are given an integer N. Find the number of strings of length N that satisfy the following conditions, modulo 10^9+7:\n - The string does not contain characters other than A, C, G...
399
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 = [['codewars'], ['kata'], ['kumite'], ['greekleet'], [\\\"This Kata's Sensei is Divyansh\\\"], ['Any reviews about CS50'], ['Man is still the most extraordinary computer of all.'], ['I do not fear computers. I fear the lack of them.'], ['Do you also think these quotes ar...
{ "dataset": "likaixin/TACO-verified", "index": 10235, "prompt": "Solve the programming task below in a Python markdown code block.\n**Getting Familiar:**\nLEET: (sometimes written as \"1337\" or \"l33t\"), also known as eleet or leetspeak, is another alphabet for the English language that is used mostly on the i...
645
longest-nice-subarray
[ { "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().longestNiceSubarray
def check(candidate): assert candidate(nums = [1,3,8,48,10]) == 3 assert candidate(nums = [3,1,5,11,13]) == 1
class Solution: def longestNiceSubarray(self, nums: List[int]) -> int: ans = j = mask = 0 for i, x in enumerate(nums): while mask & x: mask ^= nums[j] j += 1 ans = max(ans, i - j + 1) mask |= x return ans
[ { "input": "nums = [1,3,8,48,10]", "output": "3" }, { "input": "nums = [3,1,5,11,13]", "output": "1" } ]
You are given an array nums consisting of positive integers. We call a subarray of nums nice if the bitwise AND of every pair of elements that are in different positions in the subarray is equal to 0. Return the length of the longest nice subarray. A subarray is a contiguous part of an array. Note that subarrays of len...
{ "question_id": 2478, "difficulty": "Medium", "lang_code": "class Solution:\n def longestNiceSubarray(self, nums: List[int]) -> int:", "question_title": "You are given an array nums consisting of positive integers.\nWe call a subarray of nums nice if the bitwise AND of every pair of elements that are in dif...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(nums = [1,3,8,48,10]) == 3\\n assert candidate(nums = [3,1,5,11,13]) == 1\\n\\n\\ncheck(Solution().longestNiceSubarray)\"}", "style": "rule" }
{ "dataset": "LeetCodeDataset", "index": 989, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nYou are given an array nums consisting of positive integers.\nWe call a subarray of nums nice if the bitwise AND of every pair of elements that are in d...
231
count-pairs-of-points-with-distance-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().countPairs
def check(candidate): assert candidate(coordinates = [[1,2],[4,2],[1,3],[5,2]], k = 5) == 2 assert candidate(coordinates = [[1,3],[1,3],[1,3],[1,3],[1,3]], k = 0) == 10
class Solution: def countPairs(self, coordinates: List[List[int]], k: int) -> int: cnt = Counter() ans = 0 for x2, y2 in coordinates: for a in range(k + 1): b = k - a x1, y1 = a ^ x2, b ^ y2 ans += cnt[(x1, y1)] cnt[(x2,...
[ { "input": "coordinates = [[1,2],[4,2],[1,3],[5,2]], k = 5", "output": "2" }, { "input": "coordinates = [[1,3],[1,3],[1,3],[1,3],[1,3]], k = 0", "output": "10" } ]
You are given a 2D integer array coordinates and an integer k, where coordinates[i] = [xi, yi] are the coordinates of the ith point in a 2D plane. We define the distance between two points (x1, y1) and (x2, y2) as (x1 XOR x2) + (y1 XOR y2) where XOR is the bitwise XOR operation. Return the number of pairs (i, j) such t...
{ "question_id": 2953, "difficulty": "Medium", "lang_code": "class Solution:\n def countPairs(self, coordinates: List[List[int]], k: int) -> int:", "question_title": "You are given a 2D integer array coordinates and an integer k, where coordinates[i] = [xi, yi] are the coordinates of the ith point in a 2D pl...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(coordinates = [[1,2],[4,2],[1,3],[5,2]], k = 5) == 2\\n assert candidate(coordinates = [[1,3],[1,3],[1,3],[1,3],[1,3]], k = 0) == 10\\n\\n\\ncheck(Solution().countPairs)\"}", "style": "rule" }
{ "dataset": "LeetCodeDataset", "index": 682, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nYou are given a 2D integer array coordinates and an integer k, where coordinates[i] = [xi, yi] are the coordinates of the ith point in a 2D plane.\nWe d...
268
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\\n97\\n42\\n80\\n10\\n\"], \"outputs\": [\"YES\\nNO\\nYES\\nNO\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 4233, "prompt": "Solve the programming task below in a Python markdown code block.\nApple considers any iPhone with a battery health of 80\\% or above, to be in *optimal* condition. \n\nGiven that your iPhone has X\\% battery health, find whether it is in *optimal* ...
497
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 1\\n\", \"2\\n2 1\\n\", \"2\\n3 1\\n\", \"2\\n3 2\\n\", \"2\\n5 2\\n\", \"2\\n7 2\\n\", \"2\\n4 1\\n\", \"2\\n1 2\\n\"], \"outputs\": [\"1\\n\", \"1\\n\", \"1\\n\", \"1\\n\", \"1\\n\", \"1\\n\", \"1\\n\", \"1\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 7745, "prompt": "Solve the programming task below in a Python markdown code block.\nMike decided to teach programming to children in an elementary school. He knows that it is not an easy task to interest children in that age to code. That is why he decided to give e...
748
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 \\nDEXTER <dexter@hotmail.com>\\nVIRUS <virus!@variable.:p>\\n\"], \"outputs\": [\"DEXTER <dexter@hotmail.com>\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 478, "prompt": "Solve the programming task below in a Python markdown code block.\nA valid email address meets the following criteria: \n\nIt's composed of a username, domain name, and extension assembled in this format: username@domain.extension \nThe username sta...
603
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 4 5 6\\n1 2\\n\", \"2 3 1 5 6\\n1 2\\n\", \"2 1 1 5 6\\n1 2\\n\", \"2 1 1 5 1\\n1 3\\n\", \"2 1 1 5 1\\n1 2\\n\", \"2 1 1 5 1\\n2 3\\n\", \"3 4 2 19 0\\n5 3 99\\n\", \"3 4 2 19 0\\n2 3 99\\n\"], \"outputs\": [\"11\\n\", \"5\\n\", \"3\\n\", \"4\\n\", \"3\\n\", \"5\\n\", \"214\\n\...
{ "dataset": "likaixin/TACO-verified", "index": 11388, "prompt": "Solve the programming task below in a Python markdown code block.\nVasya has n items lying in a line. The items are consecutively numbered by numbers from 1 to n in such a way that the leftmost item has number 1, the rightmost item has number n. Ea...
703
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\\ncba\\ncab\\nb\\na\\n3\\nbca\\nab\\na\\n5\\nabc\\nacb\\nb\\nc\\nc\\n5\\nabc\\nacc\\nc\\nb\\nb\\n0\", \"4\\ncba\\ncab\\nb\\na\\n3\\nbca\\nab\\na\\n5\\nabc\\nacb\\nb\\nc\\nc\\n5\\nabc\\nacc\\nd\\nb\\nb\\n0\", \"4\\ncba\\ncab\\nb\\na\\n3\\nbca\\nab\\na\\n5\\ncba\\nacb\\nb\\nc\\nc\\n...
{ "dataset": "likaixin/TACO-verified", "index": 4225, "prompt": "Solve the programming task below in a Python markdown code block.\nProblem Statement\n\nWe found a dictionary of the Ancient Civilization Mayo (ACM) during excavation of the ruins. After analysis of the dictionary, we revealed they used a language t...
512
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"functional\": \"_inputs = [['5*4+6'], ['5+4*6'], ['3*8+6*5'], ['5*8+6*3*2'], ['5.4*4.0+6.2+8.0'], ['0.5*1.2*56+9.6*5*81+1'], ['1'], ['1.333333333*1.23456789+0.003*0.002']]\\n_outputs = [['2.60000e+01'], ['2.90000e+01'], ['5.40000e+01'], ['7.60000e+01'], ['3.58000e+01'], ['3.92260e+03'], ['1.0000...
{ "dataset": "likaixin/TACO-verified", "index": 983, "prompt": "Solve the programming task below in a Python markdown code block.\nWrite a function that solves an algebraic expression given as a string. \n\n* The expression can include only sums and products. \n\n* The numbers in the expression are in standard no...
248
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\\n3 3\\n2 1 2\\n1 1 1\\n2 1 2\"], \"outputs\": [\"10\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 9455, "prompt": "Solve the programming task below in a Python markdown code block.\nRead problem statements in [Hindi], [Bengali], [Mandarin Chinese], [Russian], and [Vietnamese] as well.\n\nDoraemon has a matrix with $N$ rows (numbered $1$ through $N$) and $M$ colu...
789
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 3 1\\n\", \"2 7 1\\n\", \"1 1 1\\n\", \"2 2 1\\n\", \"1 1 1\\n\", \"2 2 1\\n\", \"2 7 1\\n\", \"1 7 1\\n\"], \"outputs\": [\"1\\n\", \"64\\n\", \"1\\n\", \"2\\n\", \"1\", \"2\\n\", \"64\\n\", \"1\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 5014, "prompt": "Solve the programming task below in a Python markdown code block.\nRalph has a magic field which is divided into n × m blocks. That is to say, there are n rows and m columns on the field. Ralph can put an integer in each block. However, the magic fi...
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\": [\"1 1 1\\n1\\n1\\n\", \"3 3 3\\n2 2 4\\n1 1 3\\n\", \"3 3 3\\n2 2 4\\n1 1 1\\n\", \"3 3 3\\n2 2 4\\n1 1 2\\n\", \"3 3 3\\n2 2 2\\n1 1 3\\n\", \"5 4 5\\n1 2 2 3 4\\n1 3 4 5\\n\", \"5 5 10\\n8 2 8 5 9\\n9 1 7 5 1\\n\", \"5 5 10\\n8 2 8 5 1\\n9 1 7 5 1\\n\"], \"outputs\": [\"NO\\n\", \"Y...
{ "dataset": "likaixin/TACO-verified", "index": 12406, "prompt": "Solve the programming task below in a Python markdown code block.\nIt is known that there are k fish species in the polar ocean, numbered from 1 to k. They are sorted by non-decreasing order of their weight, which is a positive number. Let the weig...
602
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\\n8 2\\n\", \"1\\n8 2\\n\", \"1\\n8 4\\n\", \"1\\n8 1\\n\", \"1\\n6 1\\n\", \"1\\n4 1\\n\", \"1\\n16 1\\n\", \"2\\n7 7\\n1 4\\n\"], \"outputs\": [\"10\\n\", \"10\\n\", \"12\\n\", \"9\\n\", \"7\\n\", \"5\\n\", \"17\\n\", \"14\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 2007, "prompt": "Solve the programming task below in a Python markdown code block.\nLena is the most economical girl in Moscow. So, when her dad asks her to buy some food for a trip to the country, she goes to the best store — \"PriceFixed\". Here are some rules of...
868
rearrange-string-k-distance-apart
[ { "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().rearrangeString
def check(candidate): assert candidate(s = "aabbcc", k = 3) == "abcabc" assert candidate(s = "aaabc", k = 3) == "" assert candidate(s = "aaadbbcc", k = 2) == "abacabcd"
class Solution: def rearrangeString(self, s: str, k: int) -> str: h = [(-v, c) for c, v in Counter(s).items()] heapify(h) q = deque() ans = [] while h: v, c = heappop(h) v *= -1 ans.append(c) q.append((v - 1, c)) if ...
[ { "input": "s = \"aabbcc\", k = 3", "output": "\"abcabc\"" }, { "input": "s = \"aaabc\", k = 3", "output": "\"\"" }, { "input": "s = \"aaadbbcc\", k = 2", "output": "\"abacabcd\"" } ]
Given a string s and an integer k, rearrange s such that the same characters are at least distance k from each other. If it is not possible to rearrange the string, return an empty string "".   Please complete the following python code precisely: ```python class Solution: def rearrangeString(self, s: str, k: int) -...
{ "question_id": 358, "difficulty": "Hard", "lang_code": "class Solution:\n def rearrangeString(self, s: str, k: int) -> str:", "question_title": "Given a string s and an integer k, rearrange s such that the same characters are at least distance k from each other. If it is not possible to rearrange the strin...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(s = \\\"aabbcc\\\", k = 3) == \\\"abcabc\\\"\\n assert candidate(s = \\\"aaabc\\\", k = 3) == \\\"\\\"\\n assert candidate(s = \\\"aaadbbcc\\\", k = 2) == \\\"abacabcd\\\"\\n\\n\\ncheck(Solution().rearrangeString)\"}", "style":...
{ "dataset": "LeetCodeDataset", "index": 1143, "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, rearrange s such that the same characters are at least distance k from each other. If it is not possible to rearrang...
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": "{\"functional\": \"_inputs = [[2, 5, 6], [6.3, 3, 5]]\\n_outputs = [[60], [94.5]]\\nimport math\\ndef _deep_eq(a, b, tol=1e-5):\\n if isinstance(a, float) or isinstance(b, float):\\n return math.isclose(a, b, rel_tol=tol, abs_tol=tol)\\n if isinstance(a, (list, tuple)):\\n if le...
{ "dataset": "likaixin/TACO-verified", "index": 6146, "prompt": "Solve the programming task below in a Python markdown code block.\nBob needs a fast way to calculate the volume of a cuboid with three values: `length`, `width` and the `height` of the cuboid. Write a function to help Bob with this calculation.\n\n`...
213
zigzag-conversion
[ { "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().convert
def check(candidate): assert candidate(s = "PAYPALISHIRING", numRows = 3) == "PAHNAPLSIIGYIR" assert candidate(s = "PAYPALISHIRING", numRows = 4) == "PINALSIGYAHRPI" assert candidate(s = "A", numRows = 1) == "A"
class Solution: def convert(self, s: str, numRows: int) -> str: if numRows == 1: return s g = [[] for _ in range(numRows)] i, k = 0, -1 for c in s: g[i].append(c) if i == 0 or i == numRows - 1: k = -k i += k retu...
[ { "input": "s = \"PAYPALISHIRING\", numRows = 3", "output": "\"PAHNAPLSIIGYIR\"" }, { "input": "s = \"PAYPALISHIRING\", numRows = 4", "output": "\"PINALSIGYAHRPI\"" }, { "input": "s = \"A\", numRows = 1", "output": "\"A\"" } ]
The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility) P A H N A P L S I I G Y I R And then read line by line: "PAHNAPLSIIGYIR" Write the code that will take a string and make this conversio...
{ "question_id": 6, "difficulty": "Medium", "lang_code": "class Solution:\n def convert(self, s: str, numRows: int) -> str:", "question_title": "The string \"PAYPALISHIRING\" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better l...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(s = \\\"PAYPALISHIRING\\\", numRows = 3) == \\\"PAHNAPLSIIGYIR\\\"\\n assert candidate(s = \\\"PAYPALISHIRING\\\", numRows = 4) == \\\"PINALSIGYAHRPI\\\"\\n assert candidate(s = \\\"A\\\", numRows = 1) == \\\"A\\\"\\n\\n\\ncheck(...
{ "dataset": "LeetCodeDataset", "index": 1316, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nThe string \"PAYPALISHIRING\" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font...
264
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"2\\n3\\n1 1 1\\nRPS\\n3\\n3 0 0\\nRPS\\n\", \"2\\n3\\n1 1 1\\nRSP\\n3\\n3 0 0\\nRPS\\n\", \"2\\n3\\n1 1 1\\nPSR\\n3\\n4 1 0\\nRPR\\n\", \"2\\n3\\n1 1 1\\nSPR\\n3\\n4 1 0\\nRPR\\n\", \"2\\n3\\n1 1 1\\nSRP\\n3\\n6 0 0\\nRPR\\n\", \"2\\n3\\n2 0 1\\nRSP\\n3\\n4 1 0\\nRPR\\n\", \"2\\n3\\...
{ "dataset": "likaixin/TACO-verified", "index": 3241, "prompt": "Solve the programming task below in a Python markdown code block.\nLet $n$ be a positive integer. Let $a, b, c$ be nonnegative integers such that $a + b + c = n$.\n\nAlice and Bob are gonna play rock-paper-scissors $n$ times. Alice knows the sequenc...
901
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\\n3\\n800 1200 900\\n4\\n999 1000 1001 1002\\n5\\n1 2 2 2 5000\\n5\\n1000 1000 1000 1000 1000\\n3\\n900 700 800\\n\"], \"outputs\": [\"1\\n3\\n1\\n5\\n0\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 7615, "prompt": "Solve the programming task below in a Python markdown code block.\n*CodeChef recently revamped its [practice page] to make it easier for users to identify the next problems they should solve by introducing some new features:* \n*Recent Contest Probl...
958
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\\n50\\n\", \"1\\n69\\n\", \"1\\n96\\n\", \"1\\n68\\n\", \"1\\n50\\n\", \"2\\n4 73\\n\", \"2\\n7 73\\n\", \"2\\n7 85\\n\"], \"outputs\": [\"2\\n\", \"578692380\\n\", \"291154604\\n\", \"528482306\\n\", \"2\\n\", \"259817059\\n\", \"443447121\\n\", \"16777234\\n\"]}", "style": "ru...
{ "dataset": "likaixin/TACO-verified", "index": 6971, "prompt": "Solve the programming task below in a Python markdown code block.\nCreatnx has $n$ mirrors, numbered from $1$ to $n$. Every day, Creatnx asks exactly one mirror \"Am I beautiful?\". The $i$-th mirror will tell Creatnx that he is beautiful with proba...
669
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 = [[1990]]\\n_outputs = [False]\\nimport math\\ndef _deep_eq(a, b, tol=1e-5):\\n if isinstance(a, float) or isinstance(b, float):\\n return math.isclose(a, b, rel_tol=tol, abs_tol=tol)\\n if isinstance(a, (list, tuple)):\\n if len(a) != len(b): return ...
{ "dataset": "likaixin/TACO-verified", "index": 10908, "prompt": "Solve the programming task below in a Python markdown code block.\n=====Problem Statement=====\nAn extra day is added to the calendar almost every four years as February 29, and the day is called a leap day. It corrects the calendar for the fact th...
512
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\\n5\\n4\\n6\\n12\\n18\\n4\\n820514\\n99999998\\n699564\\n100001100\\n0\", \"1\\n1\\n5\\n6\\n6\\n12\\n18\\n4\\n820514\\n99999998\\n699564\\n100001100\\n0\", \"1\\n1\\n5\\n4\\n6\\n1\\n5\\n5\\n1356316\\n171009028\\n699564\\n100001100\\n0\", \"1\\n1\\n5\\n6\\n6\\n12\\n20\\n4\\n820...
{ "dataset": "likaixin/TACO-verified", "index": 11562, "prompt": "Solve the programming task below in a Python markdown code block.\nLet S be the sum of divisors of an integer N excluding the number itself. When N = S, N is called a perfect number, when N> S, N is called a defendant number, and when N <S, N is ca...
444
repeated-dna-sequences
[ { "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().findRepeatedDnaSequences
def check(candidate): assert candidate(s = "AAAAACCCCCAAAAACCCCCCAAAAAGGGTTT") == ["AAAAACCCCC","CCCCCAAAAA"] assert candidate(s = "AAAAAAAAAAAAA") == ["AAAAAAAAAA"]
class Solution: def findRepeatedDnaSequences(self, s: str) -> List[str]: cnt = Counter() ans = [] for i in range(len(s) - 10 + 1): t = s[i : i + 10] cnt[t] += 1 if cnt[t] == 2: ans.append(t) return ans
[ { "input": "s = \"AAAAACCCCCAAAAACCCCCCAAAAAGGGTTT\"", "output": "[\"AAAAACCCCC\",\"CCCCCAAAAA\"]" }, { "input": "s = \"AAAAAAAAAAAAA\"", "output": "[\"AAAAAAAAAA\"]" } ]
The DNA sequence is composed of a series of nucleotides abbreviated as 'A', 'C', 'G', and 'T'. For example, "ACGAATTCCG" is a DNA sequence. When studying DNA, it is useful to identify repeated sequences within the DNA. Given a string s that represents a DNA sequence, return all the 10-letter-long sequences (substring...
{ "question_id": 187, "difficulty": "Medium", "lang_code": "class Solution:\n def findRepeatedDnaSequences(self, s: str) -> List[str]:", "question_title": "The DNA sequence is composed of a series of nucleotides abbreviated as 'A', 'C', 'G', and 'T'.\n\nFor example, \"ACGAATTCCG\" is a DNA sequence.\n\nWhen ...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(s = \\\"AAAAACCCCCAAAAACCCCCCAAAAAGGGTTT\\\") == [\\\"AAAAACCCCC\\\",\\\"CCCCCAAAAA\\\"]\\n assert candidate(s = \\\"AAAAAAAAAAAAA\\\") == [\\\"AAAAAAAAAA\\\"]\\n\\n\\ncheck(Solution().findRepeatedDnaSequences)\"}", "style": "rule...
{ "dataset": "LeetCodeDataset", "index": 1106, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nThe DNA sequence is composed of a series of nucleotides abbreviated as 'A', 'C', 'G', and 'T'.\n\nFor example, \"ACGAATTCCG\" is a DNA sequence.\n\nWhe...
259
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 = [[10]]\\n_outputs = [[9]]\\nimport math\\ndef _deep_eq(a, b, tol=1e-5):\\n if isinstance(a, float) or isinstance(b, float):\\n return math.isclose(a, b, rel_tol=tol, abs_tol=tol)\\n if isinstance(a, (list, tuple)):\\n if len(a) != len(b): return Fals...
{ "dataset": "likaixin/TACO-verified", "index": 10372, "prompt": "Solve the programming task below in a Python markdown code block.\nThere's a waiting room with N chairs set in single row. Chairs are consecutively numbered from 1 to N. First is closest to the entrance (which is exit as well).\n \nFor some reason ...
347
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\\n\", \"1\\n1\\n\", \"1\\n2\\n\", \"1\\n0\\n\", \"1\\n4\\n\", \"3\\n1 2 6\\n\", \"3\\n1 2 3\\n\", \"3\\n1 2 3\\n\"], \"outputs\": [\"1\\n\", \"1 \", \"2 \", \"0 \", \"4 \", \"1 6 2\\n\", \"1 3 2\\n\", \"1 3 2 \"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 6556, "prompt": "Solve the programming task below in a Python markdown code block.\nA student of z-school found a kind of sorting called z-sort. The array a with n elements are z-sorted if two conditions hold:\n\n a_{i} ≥ a_{i} - 1 for all even i, a_{i} ≤ a_{i} - ...
411
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"1\\n2\\n\", \"2\\n1 2\\n\", \"2\\n2 1\\n\", \"2\\n1 1\\n\", \"2\\n2 2\\n\", \"3\\n1 2 1\\n\", \"3\\n2 1 2\\n\", \"3\\n1 1 1\\n\"], \"outputs\": [\"1\\n\", \"2\\n\", \"2\\n\", \"2\\n\", \"2\\n\", \"3\\n\", \"3\\n\", \"3\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 5466, "prompt": "Solve the programming task below in a Python markdown code block.\nA dragon symbolizes wisdom, power and wealth. On Lunar New Year's Day, people model a dragon with bamboo strips and clothes, raise them with rods, and hold the rods high and low to r...
584
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"functional\": \"_inputs = [[1], [2], [4], [32], [128], [512], [6], [14], [688], [8197], [1966], [9007199254740991]]\\n_outputs = [[[1]], [[2]], [[4]], [[32]], [[128]], [[512]], [[2, 4]], [[2, 4, 8]], [[16, 32, 128, 512]], [[1, 4, 8192]], [[2, 4, 8, 32, 128, 256, 512, 1024]], [[1, 2, 4, 8, 16, 32...
{ "dataset": "likaixin/TACO-verified", "index": 11713, "prompt": "Solve the programming task below in a Python markdown code block.\n# Description\n\nGiven a number `n`, you should find a set of numbers for which the sum equals `n`. This set must consist exclusively of values that are a power of `2` (eg: `2^0 => ...
402
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"123 3 0 4 0 1 1\\n999 9 9 9 9 9 9\\n0 0 0 0 0 0 0\", \"123 3 0 4 0 1 0\\n999 9 9 9 9 9 9\\n0 0 0 0 0 0 0\", \"123 3 0 2 3 2 2\\n999 9 9 9 9 7 8\\n0 0 0 0 0 0 0\", \"123 3 0 2 3 2 2\\n999 9 9 9 9 4 8\\n0 0 0 0 0 0 0\", \"123 3 0 4 0 2 1\\n999 9 9 9 9 9 9\\n0 0 0 0 0 0 0\", \"123 3 1 ...
{ "dataset": "likaixin/TACO-verified", "index": 8167, "prompt": "Solve the programming task below in a Python markdown code block.\nTaro, a boy who hates any inefficiencies, pays coins so that the number of coins to be returned as change is minimized in order to do smoothly when he buys something.\n\nOne day, how...
531
uncommon-words-from-two-sentences
[ { "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().uncommonFromSentences
def check(candidate): assert candidate(s1 = "this apple is sweet", s2 = "this apple is sour") == ["sweet","sour"] assert candidate(s1 = "apple apple", s2 = "banana") == ["banana"]
class Solution: def uncommonFromSentences(self, s1: str, s2: str) -> List[str]: cnt = Counter(s1.split()) + Counter(s2.split()) return [s for s, v in cnt.items() if v == 1]
[ { "input": "s1 = \"this apple is sweet\", s2 = \"this apple is sour\"", "output": "[\"sweet\",\"sour\"]" }, { "input": "s1 = \"apple apple\", s2 = \"banana\"", "output": "[\"banana\"]" } ]
A sentence is a string of single-space separated words where each word consists only of lowercase letters. A word is uncommon if it appears exactly once in one of the sentences, and does not appear in the other sentence. Given two sentences s1 and s2, return a list of all the uncommon words. You may return the answer i...
{ "question_id": 920, "difficulty": "Easy", "lang_code": "class Solution:\n def uncommonFromSentences(self, s1: str, s2: str) -> List[str]:", "question_title": "A sentence is a string of single-space separated words where each word consists only of lowercase letters.\nA word is uncommon if it appears exactly...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(s1 = \\\"this apple is sweet\\\", s2 = \\\"this apple is sour\\\") == [\\\"sweet\\\",\\\"sour\\\"]\\n assert candidate(s1 = \\\"apple apple\\\", s2 = \\\"banana\\\") == [\\\"banana\\\"]\\n\\n\\ncheck(Solution().uncommonFromSentences...
{ "dataset": "LeetCodeDataset", "index": 383, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nA sentence is a string of single-space separated words where each word consists only of lowercase letters.\nA word is uncommon if it appears exactly onc...
229
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"1\\n2\\n\", \"1\\n2\\n\", \"1\\n4\\n\", \"1\\n6\\n\", \"2\\n2\\n4\\n\", \"2\\n4\\n4\\n\", \"2\\n4\\n6\\n\", \"2\\n6\\n4\\n\"], \"outputs\": [\"2\\n\", \"2\\n\", \"6\\n\", \"14\\n\", \"2\\n6\\n\", \"6\\n6\\n\", \"6\\n14\\n\", \"14\\n6\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 7049, "prompt": "Solve the programming task below in a Python markdown code block.\nPhoenix has $n$ coins with weights $2^1, 2^2, \\dots, 2^n$. He knows that $n$ is even.\n\nHe wants to split the coins into two piles such that each pile has exactly $\\frac{n}{2}$ co...
500
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"functional\": \"_inputs = [['3D2a5d2f'], ['4D1a8d4j3k'], ['4D2a8d4j2f'], ['3n6s7f3n'], ['0d4n8d2b'], ['0c3b1n7m'], ['7m3j4ik2a'], ['3A5m3B3Y'], ['5M0L8P1'], ['2B'], ['7M1n3K'], ['A4g1b4d'], ['111111'], ['4d324n2'], ['5919nf3u'], ['2n1k523n4i'], ['6o23M32d'], ['1B44n3r'], ['M21d1r32'], ['23M31r2r...
{ "dataset": "likaixin/TACO-verified", "index": 7543, "prompt": "Solve the programming task below in a Python markdown code block.\nGiven a string that includes alphanumeric characters ('3a4B2d') return the expansion of that string: The numeric values represent the occurrence of each letter preceding that numeric...
415
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"2\\n0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0\\n3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0\", \"2\\n0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0\\n3.0 2.0 9.680227793087974 6.0 13.0 5.0 7.0 9.0\", \"2\\n0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0\\n3.0 2.0 9.680227793087974 6.0 13.541356008746918 5.0 7.0 9.0\", \"2\\n0.0 0.0 1...
{ "dataset": "likaixin/TACO-verified", "index": 12787, "prompt": "Solve the programming task below in a Python markdown code block.\nThere are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If thos...
476
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\\nThis is a sample piece of text to illustrate this\\nproblem.\"], \"outputs\": [\"10\\na\\nillustrate\\nis\\nof\\npiece\\nproblem\\nsample\\ntext\\nthis\\nto\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 3406, "prompt": "Solve the programming task below in a Python markdown code block.\nIn this problem the input will consist of a number of lines of English text consisting of the letters of the English alphabet, the punctuation marks ' (apostrophe), . (full stop), , ...
500
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"3 4\\n4 0\\n0 0\\n-2 -4\\n-2 -1\\n\"], \"outputs\": [\"-2.00 0.00\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 2164, "prompt": "Solve the programming task below in a Python markdown code block.\nAdam and Martha are planning to leave the city after their retirement and build a house in a huge land belonging to their family. To keep everyone happy, they want to build the house...
543
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"3\\n1 3 2\\n\", \"3\\n2 3 1\\n\", \"3\\n1 3 2\\n\", \"4\\n5 5 5 5\\n\", \"4\\n5 5 5 5\\n\", \"4\\n3 1 5 5\\n\", \"4\\n5 1 5 8\\n\", \"4\\n1 3 8 64\\n\"], \"outputs\": [\"1\\n\", \"1\\n\", \"1\\n\", \"11\\n\", \"11\\n\", \"5\\n\", \"4\\n\", \"9\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 570, "prompt": "Solve the programming task below in a Python markdown code block.\nLet's call a list of positive integers $a_0, a_1, ..., a_{n-1}$ a power sequence if there is a positive integer $c$, so that for every $0 \\le i \\le n-1$ then $a_i = c^i$.\n\nGiven a...
595
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"1\\n2 -2 1\"], \"outputs\": [\"2\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 2573, "prompt": "Solve the programming task below in a Python markdown code block.\nThis problem was part of the CodeChef April Challenge. All user submissions for this contest problem are publicly available here.\n\nIn the game of \"BattleShip V\", you control a c...
499
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\": [\"6\\n2528\\n18211\\n575\\n268\\n1\\n257\", \"6\\n4360\\n18211\\n575\\n268\\n1\\n257\", \"6\\n4360\\n18211\\n575\\n268\\n1\\n443\", \"6\\n4360\\n18211\\n575\\n268\\n1\\n145\", \"6\\n5788\\n18211\\n575\\n268\\n1\\n145\", \"6\\n5788\\n32221\\n575\\n268\\n1\\n145\", \"6\\n1689\\n7692\\n1...
{ "dataset": "likaixin/TACO-verified", "index": 1444, "prompt": "Solve the programming task below in a Python markdown code block.\nFor any positive integer, we define a digit rotation as either moving the first digit\nto the end of the number (left digit rotation), or the last digit to the front of the number (r...
433
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\\n4-2*3=\\n8*(4+4+3)=\", \"2\\n4-2*3=\\n8*(4+4+2)=\", \"2\\n4-3*3=\\n4*(8+4+3)=\", \"2\\n4-1*3=\\n4*(8+4+3)=\", \"2\\n4-1+3=\\n4*(8+4+3)=\", \"2\\n4-2+3=\\n4*(8+4+3)=\", \"2\\n5-1+3=\\n4*(8+4+3)=\", \"2\\n3-1*3=\\n4*(8+4+3)=\"], \"outputs\": [\"-2\\n88\\n\", \"-2\\n80\\n\", \"-5\\...
{ "dataset": "likaixin/TACO-verified", "index": 1016, "prompt": "Solve the programming task below in a Python markdown code block.\nYour task is to write a program which reads an expression and evaluates it.\n\n* The expression consists of numerical values, operators and parentheses, and the ends with '='.\n* The...
365
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"7\\n1 2\\n2 3\\n2 4\\n2 5\\n4 6\\n6 7\", \"7\\n1 4\\n2 3\\n2 4\\n4 5\\n4 6\\n6 7\", \"7\\n1 4\\n2 3\\n2 4\\n4 5\\n7 6\\n6 7\", \"7\\n1 4\\n2 3\\n2 4\\n1 5\\n7 6\\n6 7\", \"7\\n1 4\\n2 3\\n2 4\\n1 5\\n7 6\\n6 5\", \"7\\n1 4\\n2 3\\n2 4\\n4 5\\n7 3\\n6 3\", \"7\\n1 2\\n2 3\\n4 4\\n1 5...
{ "dataset": "likaixin/TACO-verified", "index": 9312, "prompt": "Solve the programming task below in a Python markdown code block.\nTakahashi has decided to make a Christmas Tree for the Christmas party in AtCoder, Inc.\n\nA Christmas Tree is a tree with N vertices numbered 1 through N and N-1 edges, whose i-th e...
662
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\\n7 3 4\\n12345 30036 63\", \"2\\n7 3 4\\n12345 57737 63\", \"2\\n7 1 1\\n9796 9219 1485\", \"2\\n7 2 4\\n12345 57737 63\", \"2\\n7 1 1\\n9796 9219 2637\", \"2\\n3 2 4\\n12345 57737 63\", \"2\\n3 1 4\\n12345 57737 63\", \"2\\n3 1 0\\n12345 57737 63\"], \"outputs\": [\"14560\\n4870...
{ "dataset": "likaixin/TACO-verified", "index": 6300, "prompt": "Solve the programming task below in a Python markdown code block.\nConsider the following arithmetic progression with n terms:\n\n* x, x + d, x + 2d, \\ldots, x + (n-1)d\n\n\n\nWhat is the product of all terms in this sequence? Compute the answer mo...
396
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"2\\n1 2\\n2 4\", \"2\\n1 1\\n2 4\", \"2\\n1 1\\n1 7\", \"2\\n0 1\\n1 7\", \"2\\n0 1\\n0 7\", \"2\\n0 1\\n0 8\", \"2\\n1 2\\n0 0\", \"2\\n0 2\\n6 0\"], \"outputs\": [\"4\\n\", \"3\\n\", \"7\\n\", \"8\\n\", \"9\\n\", \"10\\n\", \"2\\n\", \"-3\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 1588, "prompt": "Solve the programming task below in a Python markdown code block.\nThere are N integers X_1, X_2, \\cdots, X_N, and we know that A_i \\leq X_i \\leq B_i.\nFind the number of different values that the median of X_1, X_2, \\cdots, X_N can take.\n\n---...
551
checking-existence-of-edge-length-limited-paths
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
Solution().distanceLimitedPathsExist
def check(candidate): assert candidate(n = 3, edgeList = [[0,1,2],[1,2,4],[2,0,8],[1,0,16]], queries = [[0,1,2],[0,2,5]]) == [False,True] assert candidate(n = 5, edgeList = [[0,1,10],[1,2,5],[2,3,9],[3,4,13]], queries = [[0,4,14],[1,4,13]]) == [True,False]
class Solution: def distanceLimitedPathsExist( self, n: int, edgeList: List[List[int]], queries: List[List[int]] ) -> List[bool]: def find(x): if p[x] != x: p[x] = find(p[x]) return p[x] p = list(range(n)) edgeList.sort(key=lambda x: x[2])...
[ { "input": "n = 3, edgeList = [[0,1,2],[1,2,4],[2,0,8],[1,0,16]], queries = [[0,1,2],[0,2,5]]", "output": "[false,true]" }, { "input": "n = 5, edgeList = [[0,1,10],[1,2,5],[2,3,9],[3,4,13]], queries = [[0,4,14],[1,4,13]]", "output": "[true,false]" } ]
An undirected graph of n nodes is defined by edgeList, where edgeList[i] = [ui, vi, disi] denotes an edge between nodes ui and vi with distance disi. Note that there may be multiple edges between two nodes. Given an array queries, where queries[j] = [pj, qj, limitj], your task is to determine for each queries[j] whethe...
{ "question_id": 1815, "difficulty": "Hard", "lang_code": "class Solution:\n def distanceLimitedPathsExist(self, n: int, edgeList: List[List[int]], queries: List[List[int]]) -> List[bool]:", "question_title": "An undirected graph of n nodes is defined by edgeList, where edgeList[i] = [ui, vi, disi] denotes a...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(n = 3, edgeList = [[0,1,2],[1,2,4],[2,0,8],[1,0,16]], queries = [[0,1,2],[0,2,5]]) == [False,True]\\n assert candidate(n = 5, edgeList = [[0,1,10],[1,2,5],[2,3,9],[3,4,13]], queries = [[0,4,14],[1,4,13]]) == [True,False]\\n\\n\\nche...
{ "dataset": "LeetCodeDataset", "index": 1504, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nAn undirected graph of n nodes is defined by edgeList, where edgeList[i] = [ui, vi, disi] denotes an edge between nodes ui and vi with distance disi. N...
311
queens-that-can-attack-the-king
[ { "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().queensAttacktheKing
def check(candidate): assert candidate(queens = [[0,1],[1,0],[4,0],[0,4],[3,3],[2,4]], king = [0,0]) == [[0,1],[1,0],[3,3]] assert candidate(queens = [[0,0],[1,1],[2,2],[3,4],[3,5],[4,4],[4,5]], king = [3,3]) == [[2,2],[3,4],[4,4]]
class Solution: def queensAttacktheKing( self, queens: List[List[int]], king: List[int] ) -> List[List[int]]: n = 8 s = {(i, j) for i, j in queens} ans = [] for a in range(-1, 2): for b in range(-1, 2): if a or b: x, y = kin...
[ { "input": "queens = [[0,1],[1,0],[4,0],[0,4],[3,3],[2,4]], king = [0,0]", "output": "[[0,1],[1,0],[3,3]]" }, { "input": "queens = [[0,0],[1,1],[2,2],[3,4],[3,5],[4,4],[4,5]], king = [3,3]", "output": "[[2,2],[3,4],[4,4]]" } ]
On a 0-indexed 8 x 8 chessboard, there can be multiple black queens and one white king. You are given a 2D integer array queens where queens[i] = [xQueeni, yQueeni] represents the position of the ith black queen on the chessboard. You are also given an integer array king of length 2 where king = [xKing, yKing] represen...
{ "question_id": 1342, "difficulty": "Medium", "lang_code": "class Solution:\n def queensAttacktheKing(self, queens: List[List[int]], king: List[int]) -> List[List[int]]:", "question_title": "On a 0-indexed 8 x 8 chessboard, there can be multiple black queens and one white king.\nYou are given a 2D integer a...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(queens = [[0,1],[1,0],[4,0],[0,4],[3,3],[2,4]], king = [0,0]) == [[0,1],[1,0],[3,3]]\\n assert candidate(queens = [[0,0],[1,1],[2,2],[3,4],[3,5],[4,4],[4,5]], king = [3,3]) == [[2,2],[3,4],[4,4]]\\n\\n\\ncheck(Solution().queensAttac...
{ "dataset": "LeetCodeDataset", "index": 658, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nOn a 0-indexed 8 x 8 chessboard, there can be multiple black queens and one white king.\nYou are given a 2D integer array queens where queens[i] = [xQue...
276
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"functional\": \"_inputs = [[100], [40], [39], [5], [0]]\\n_outputs = [['Your plant has had more than enough water for today!'], ['Your plant has had more than enough water for today!'], ['You need to give your plant 1mm of water'], ['You need to give your plant 35mm of water'], ['You need to giv...
{ "dataset": "likaixin/TACO-verified", "index": 8510, "prompt": "Solve the programming task below in a Python markdown code block.\nYou have an award-winning garden and everyday the plants need exactly 40mm of water. You created a great piece of JavaScript to calculate the amount of water your plants will need wh...
211
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"4\\n5\\n105\\n101\\n100\\n\"], \"outputs\": [\"5\\n95\\n91\\n100\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 399, "prompt": "Solve the programming task below in a Python markdown code block.\nIn Chefland, a tax of rupees 10 is deducted if the total income is strictly greater than rupees 100. \n\nGiven that total income is X rupees, find out how much money you get.\n\n-----...
530
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 4 3\\n2\\n2 4\", \"3\\n1 4 3\\n2\\n2 2\", \"3\\n1 4 3\\n3\\n2 2\", \"3\\n1 4 3\\n3\\n2 1\", \"3\\n1 4 3\\n6\\n2 1\", \"3\\n1 4 5\\n6\\n2 1\", \"3\\n1 4 8\\n6\\n2 1\", \"3\\n1 4 8\\n6\\n4 1\"], \"outputs\": [\"1\\n\", \"1\\n\", \"1\\n\", \"1\\n\", \"1\\n\", \"1\\n\", \"1\\n\", ...
{ "dataset": "likaixin/TACO-verified", "index": 9448, "prompt": "Solve the programming task below in a Python markdown code block.\nCompare given two sequence $A = \\\\{a_0, a_1, ..., a_{n-1}\\\\}$ and $B = \\\\{b_0, b_1, ..., b_{m-1}$ lexicographically.\n\nConstraints\n\n* $1 \\leq n, m \\leq 1,000$\n* $0 \\leq ...
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": "{\"functional\": \"_inputs = [[[100], 0], [[100, 100, 100, 100], 0], [[100, 100, 100, 100], 1], [[100, 100, 100, 100], 2], [[100, 100, 100, 100], 3]]\\n_outputs = [[[1, 1]], [[1, -1]], [[-1, 1]], [[1, -1]], [[-1, 1]]]\\nimport math\\ndef _deep_eq(a, b, tol=1e-5):\\n if isinstance(a, float) or is...
{ "dataset": "likaixin/TACO-verified", "index": 11965, "prompt": "Solve the programming task below in a Python markdown code block.\n# Kata Task\n\nYou are given a list of cogs in a gear train\n\nEach element represents the number of teeth of that cog\n\ne.g. `[100, 50, 25]` means \n* 1st cog has 100 teeth \n* 2n...
342
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], [20], [30], [40], [43], [60], [70], [90], [200], [275]]\\n_outputs = [[1], [2], [3], [5], [7], [627], [5604], [37338], [63261], [966467], [4087968], [56634173], [3972999029388], [1520980492851175]]\\nimport math\\ndef _deep_eq(a, b, tol=1e-5):\...
{ "dataset": "likaixin/TACO-verified", "index": 1592, "prompt": "Solve the programming task below in a Python markdown code block.\n# How many ways can you make the sum of a number?\n\nFrom wikipedia: https://en.wikipedia.org/wiki/Partition_(number_theory)#\n\n>In number theory and combinatorics, a partition of a...
537
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\\n?\\n\", \"1\\na\\n\", \"1\\n?\\n\", \"1\\n?a\\n\", \"3\\nb?c\\n\", \"3\\na?c\\n\", \"2\\n????\\n\", \"3\\n????\\n\"], \"outputs\": [\"IMPOSSIBLE\\n\", \"a\\n\", \"a\\n\", \"aa\\n\", \"IMPOSSIBLE\\n\", \"IMPOSSIBLE\\n\", \"abba\\n\", \"IMPOSSIBLE\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 1150, "prompt": "Solve the programming task below in a Python markdown code block.\nVasya has recently finished writing a book. Now he faces the problem of giving it the title. Vasya wants the title to be vague and mysterious for his book to be noticeable among othe...
620
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 5\\n\", \"3 2 4\\n\", \"6 1 4\\n\", \"2 2 3\\n\", \"5 4 6\\n\", \"2 1 2\\n\", \"2 2 2\\n\", \"5 5 6\\n\"], \"outputs\": [\"3\\n\", \"1\\n\", \"1\\n\", \"1\\n\", \"3\\n\", \"1\\n\", \"2\\n\", \"4\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 2441, "prompt": "Solve the programming task below in a Python markdown code block.\nArpa is researching the Mexican wave.\n\nThere are n spectators in the stadium, labeled from 1 to n. They start the Mexican wave at time 0. \n\n At time 1, the first spectator stand...
839
triangle
[ { "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().minimumTotal
def check(candidate): assert candidate(triangle = [[2],[3,4],[6,5,7],[4,1,8,3]]) == 11 assert candidate(triangle = [[-10]]) == -10
class Solution: def minimumTotal(self, triangle: List[List[int]]) -> int: n = len(triangle) f = [[0] * (n + 1) for _ in range(n + 1)] for i in range(n - 1, -1, -1): for j in range(i + 1): f[i][j] = min(f[i + 1][j], f[i + 1][j + 1]) + triangle[i][j] return ...
[ { "input": "triangle = [[2],[3,4],[6,5,7],[4,1,8,3]]", "output": "11" }, { "input": "triangle = [[-10]]", "output": "-10" } ]
Given a triangle array, return the minimum path sum from top to bottom. For each step, you may move to an adjacent number of the row below. More formally, if you are on index i on the current row, you may move to either index i or index i + 1 on the next row.   Please complete the following python code precisely: ```py...
{ "question_id": 120, "difficulty": "Medium", "lang_code": "class Solution:\n def minimumTotal(self, triangle: List[List[int]]) -> int:", "question_title": "Given a triangle array, return the minimum path sum from top to bottom.\nFor each step, you may move to an adjacent number of the row below. More formal...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(triangle = [[2],[3,4],[6,5,7],[4,1,8,3]]) == 11\\n assert candidate(triangle = [[-10]]) == -10\\n\\n\\ncheck(Solution().minimumTotal)\"}", "style": "rule" }
{ "dataset": "LeetCodeDataset", "index": 1625, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nGiven a triangle array, return the minimum path sum from top to bottom.\nFor each step, you may move to an adjacent number of the row below. More forma...
213
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\\n5\\n2\"], \"outputs\": [\"200000002\\n0\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 47, "prompt": "Solve the programming task below in a Python markdown code block.\nAfter the hundred years of war started by the Fire Nation, its time for the Water Tribes to bring it to an end. Avatar asked Sokka to go to the Southern WarZone from The Northern WarZo...
814
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\\n6 6\\n\", \"2\\n3 6\\n\", \"2\\n511 5\\n\", \"2\\n511 6\\n\", \"2\\n605 6\\n\", \"2\\n511 32\\n\", \"3\\n83 504 68\\n\", \"3\\n136 452 68\\n\"], \"outputs\": [\"1 2\\n\", \"1 2\\n\", \"1 2\\n\", \"1 2\\n\", \"1 2\\n\", \"1 2\\n\", \"3 1\\n\", \"3 1\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 4837, "prompt": "Solve the programming task below in a Python markdown code block.\nn soldiers stand in a circle. For each soldier his height ai is known. A reconnaissance unit can be made of such two neighbouring soldiers, whose heights difference is minimal, i.e. ...
354
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 1\\n\", \"1\\n2 1 1\\n\", \"1\\n2 1 1\\n\", \"1\\n1 1 1\\n\", \"1\\n2 1 0\\n\", \"1\\n1 1 2\\n\", \"1\\n2 2 0\\n\", \"1\\n2 2 1\\n\"], \"outputs\": [\"YES\\n\", \"YES\\n\", \"YES\\n\", \"YES\\n\", \"NO\\n\", \"YES\\n\", \"YES\\n\", \"YES\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 5964, "prompt": "Solve the programming task below in a Python markdown code block.\nYou have $r$ red and $b$ blue beans. You'd like to distribute them among several (maybe, one) packets in such a way that each packet:\n\nhas at least one red bean (or the number of r...
631
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\\n3\\n1000 1000 1001\\n\", \"1\\n3\\n1000 1000 1001\\n\", \"1\\n3\\n0000 1000 1001\\n\", \"1\\n3\\n1000 1001 1001\\n\", \"1\\n3\\n0000 1000 1000\\n\", \"1\\n3\\n1000 1001 0001\\n\", \"1\\n3\\n0001 1000 1000\\n\", \"1\\n2\\n1000000000 1000000000\\n\"], \"outputs\": [\"1\\n\", \"1\\...
{ "dataset": "likaixin/TACO-verified", "index": 6740, "prompt": "Solve the programming task below in a Python markdown code block.\nYou are asked to watch your nephew who likes to play with toy blocks in a strange way.\n\nHe has $n$ boxes and the $i$-th box has $a_i$ blocks. His game consists of two steps:\n\nhe ...
744
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\\n\", \"1\\n0\\n\", \"1\\n1\\n\", \"2\\n1 1\\n\", \"2\\n1 1\\n\", \"2\\n1 0\\n\", \"1\\n1000\\n\", \"1\\n1000\\n\"], \"outputs\": [\"YES\\n\", \"YES\\n\", \"YES\\n\", \"NO\\n\", \"NO\\n\", \"YES\\n\", \"YES\\n\", \"YES\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 4842, "prompt": "Solve the programming task below in a Python markdown code block.\nYaroslav has an array that consists of n integers. In one second Yaroslav can swap two neighboring array elements. Now Yaroslav is wondering if he can obtain an array where any two n...
410
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"3\\n1 3 3\\n2 2 2\", \"3\\n1 3 2\\n2 2 3\", \"3\\n1 3 6\\n2 2 2\", \"3\\n1 3 2\\n3 2 3\", \"3\\n1 3 6\\n2 2 4\", \"3\\n2 3 2\\n3 2 3\", \"3\\n1 3 6\\n3 2 4\", \"3\\n2 3 2\\n5 2 3\"], \"outputs\": [\"No\\n\", \"Yes\\n\", \"No\\n\", \"Yes\\n\", \"No\\n\", \"Yes\\n\", \"No\\n\", \"Yes\...
{ "dataset": "likaixin/TACO-verified", "index": 685, "prompt": "Solve the programming task below in a Python markdown code block.\nGiven are two integer sequences of N elements each: A_1,...,A_N and B_1,...,B_N. Determine if it is possible to do the following operation at most N-2 times (possibly zero) so that, f...
399
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\\n387420490\\n\", \"1\\n506859788\\n\", \"1\\n132370398\\n\", \"1\\n230139648\\n\", \"1\\n152260256\\n\", \"1\\n586187597\\n\", \"1\\n100214312\\n\", \"1\\n218113389\\n\"], \"outputs\": [\"387420490\\n\", \"516560652\\n\", \"133923132\\n\", \"387420489\\n\", \"172186884\\n\", \"11...
{ "dataset": "likaixin/TACO-verified", "index": 6163, "prompt": "Solve the programming task below in a Python markdown code block.\nThe only difference between easy and hard versions is the maximum value of $n$.\n\nYou are given a positive integer number $n$. You really love good numbers so you want to find the s...
701
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"5\\n1\\n1\\n2\\n01\\n3\\n100\\n4\\n1001\\n5\\n11111\\n\"], \"outputs\": [\"1\\n3\\n4\\n8\\n5\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 9804, "prompt": "Solve the programming task below in a Python markdown code block.\nLet's call a binary string $T$ of length $m$ indexed from $1$ to $m$ paranoid if we can obtain a string of length $1$ by performing the following two kinds of operations $m-1$ times ...
752
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"a b\\n1 3\\na\\n\", \"abc arc\\n3 6\\nabc\\n\", \"red blue\\n3 2\\nred\", \"red blte\\n3 0\\nred\", \"red blue\\n5 0\\nred\", \"red blue\\n7 0\\nred\", \"red blue\\n5 1\\nred\", \"red blue\\n0 0\\nred\"], \"outputs\": [\"0 3\\n\", \"2 6\\n\", \"2 2\\n\", \"2 0\\n\", \"4 0\\n\", \"6 ...
{ "dataset": "likaixin/TACO-verified", "index": 10637, "prompt": "Solve the programming task below in a Python markdown code block.\nWe have A balls with the string S written on each of them and B balls with the string T written on each of them.\n\nFrom these balls, Takahashi chooses one with the string U written...
362
decode-the-message
[ { "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().decodeMessage
def check(candidate): assert candidate(key = "the quick brown fox jumps over the lazy dog", message = "vkbs bs t suepuv") == "this is a secret" assert candidate(key = "eljuxhpwnyrdgtqkviszcfmabo", message = "zwx hnfx lqantp mnoeius ycgk vcnjrdb") == "the five boxing wizards jump quickly"
class Solution: def decodeMessage(self, key: str, message: str) -> str: d = {" ": " "} i = 0 for c in key: if c not in d: d[c] = ascii_lowercase[i] i += 1 return "".join(d[c] for c in message)
[ { "input": "key = \"the quick brown fox jumps over the lazy dog\", message = \"vkbs bs t suepuv\"", "output": "\"this is a secret\"" }, { "input": "key = \"eljuxhpwnyrdgtqkviszcfmabo\", message = \"zwx hnfx lqantp mnoeius ycgk vcnjrdb\"", "output": "\"the five boxing wizards jump quickly\"" } ...
You are given the strings key and message, which represent a cipher key and a secret message, respectively. The steps to decode message are as follows: Use the first appearance of all 26 lowercase English letters in key as the order of the substitution table. Align the substitution table with the regular English alpha...
{ "question_id": 2406, "difficulty": "Easy", "lang_code": "class Solution:\n def decodeMessage(self, key: str, message: str) -> str:", "question_title": "You are given the strings key and message, which represent a cipher key and a secret message, respectively. The steps to decode message are as follows:\n\n...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(key = \\\"the quick brown fox jumps over the lazy dog\\\", message = \\\"vkbs bs t suepuv\\\") == \\\"this is a secret\\\"\\n assert candidate(key = \\\"eljuxhpwnyrdgtqkviszcfmabo\\\", message = \\\"zwx hnfx lqantp mnoeius ycgk vcnj...
{ "dataset": "LeetCodeDataset", "index": 943, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nYou are given the strings key and message, which represent a cipher key and a secret message, respectively. The steps to decode message are as follows:\...
325
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"1 0\\n5\\n\", \"1 0\\n8\\n\", \"1 0\\n3\\n\", \"3 1\\n108\\n\", \"3 2\\n108\\n\", \"5 2\\n39923\\n\", \"5 2\\n20409\\n\", \"5 2\\n59455\\n\"], \"outputs\": [\"5\\n\", \"8\\n\", \"3\\n\", \"27\\n\", \"9\\n\", \"2667\\n\", \"792\\n\", \"2409\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 8383, "prompt": "Solve the programming task below in a Python markdown code block.\nVasya is sitting on an extremely boring math class. To have fun, he took a piece of paper and wrote out n numbers on a single line. After that, Vasya began to write out different way...
562
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\\n8\\n4\"], \"outputs\": [\"3\\n2\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 3286, "prompt": "Solve the programming task below in a Python markdown code block.\nYou are given an integer K.\n\nConsider an integer sequence A = [A_{1}, A_{2}, \\ldots, A_{N}].\n\nDefine another sequence S of length N, such that S_{i} = A_{1} + A_{2} + \\ldots + ...
622
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, 4], [-2, 2], [-10, 10], [5, 100]]\\n_outputs = [[[1, 2, 3, 4]], [[-2, -1, 0, 1, 2]], [[-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]], [[5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, ...
{ "dataset": "likaixin/TACO-verified", "index": 10862, "prompt": "Solve the programming task below in a Python markdown code block.\nComplete the function that takes two integers (`a, b`, where `a < b`) and return an array of all integers between the input parameters, **including** them.\n\nFor example:\n```\na =...
198
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\\n32 32\\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\\n\", \"7\\n3 2\\n0 1 0\\n5 3\\n1 0 1 1 0\\n2 2\\n1 1\\n4 4\\n0 0 0 0\\n6 3\\n0 0 1 0 0 1\\n7 5\\n1 1 1 1 1 1 1\\n5 3\\n0 0 1 0 0\\n\"], \"outputs\": [\"NO\\n\", \"YES\\nYES\\nYES\\nNO\\nYES\\nYES\\nYES\\n\"...
{ "dataset": "likaixin/TACO-verified", "index": 9115, "prompt": "Solve the programming task below in a Python markdown code block.\nYou have an array $a$ of size $n$ consisting only of zeroes and ones and an integer $k$. In one operation you can do one of the following:\n\nSelect $2$ consecutive elements of $a$ a...
881
find-first-palindromic-string-in-the-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().firstPalindrome
def check(candidate): assert candidate(words = ["abc","car","ada","racecar","cool"]) == "ada" assert candidate(words = ["notapalindrome","racecar"]) == "racecar" assert candidate(words = ["def","ghi"]) == ""
class Solution: def firstPalindrome(self, words: List[str]) -> str: return next((w for w in words if w == w[::-1]), "")
[ { "input": "words = [\"abc\",\"car\",\"ada\",\"racecar\",\"cool\"]", "output": "\"ada\"" }, { "input": "words = [\"notapalindrome\",\"racecar\"]", "output": "\"racecar\"" }, { "input": "words = [\"def\",\"ghi\"]", "output": "\"\"" } ]
Given an array of strings words, return the first palindromic string in the array. If there is no such string, return an empty string "". A string is palindromic if it reads the same forward and backward.   Please complete the following python code precisely: ```python class Solution: def firstPalindrome(self, word...
{ "question_id": 2231, "difficulty": "Easy", "lang_code": "class Solution:\n def firstPalindrome(self, words: List[str]) -> str:", "question_title": "Given an array of strings words, return the first palindromic string in the array. If there is no such string, return an empty string \"\".\nA string is palind...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(words = [\\\"abc\\\",\\\"car\\\",\\\"ada\\\",\\\"racecar\\\",\\\"cool\\\"]) == \\\"ada\\\"\\n assert candidate(words = [\\\"notapalindrome\\\",\\\"racecar\\\"]) == \\\"racecar\\\"\\n assert candidate(words = [\\\"def\\\",\\\"ghi\...
{ "dataset": "LeetCodeDataset", "index": 1583, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nGiven an array of strings words, return the first palindromic string in the array. If there is no such string, return an empty string \"\".\nA string i...
197
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\\nHarry\\n37.21\\nBerry\\n37.21\\nTina\\n37.2\\nAkriti\\n41\\nHarsh\\n39\\n\"], \"outputs\": [\"Berry\\nHarry\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 3063, "prompt": "Solve the programming task below in a Python markdown code block.\nGiven the names and grades for each student in a class of $N$ students, store them in a nested list and print the name(s) of any student(s) having the second lowest grade.\n\nNote: I...
621
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\": [\"(\\n1\\n1 1\\n\", \")\\n1\\n1 1\\n\", \"(\\n1\\n1 1\\n\", \")\\n1\\n1 1\\n\", \"()\\n1\\n1 2\\n\", \")(\\n1\\n1 2\\n\", \")(\\n1\\n1 2\\n\", \"()\\n1\\n1 2\\n\"], \"outputs\": [\"0\\n\", \"0\\n\", \"0\\n\", \"0\\n\", \"2\\n\", \"0\\n\", \"0\\n\", \"2\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 10151, "prompt": "Solve the programming task below in a Python markdown code block.\nSereja has a bracket sequence s_1, s_2, ..., s_{n}, or, in other words, a string s of length n, consisting of characters \"(\" and \")\".\n\nSereja needs to answer m queries, each o...
684
best-sightseeing-pair
[ { "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().maxScoreSightseeingPair
def check(candidate): assert candidate(values = [8,1,5,2,6]) == 11 assert candidate(values = [1,2]) == 2
class Solution: def maxScoreSightseeingPair(self, values: List[int]) -> int: ans, mx = 0, values[0] for j in range(1, len(values)): ans = max(ans, values[j] - j + mx) mx = max(mx, values[j] + j) return ans
[ { "input": "values = [8,1,5,2,6]", "output": "11" }, { "input": "values = [1,2]", "output": "2" } ]
You are given an integer array values where values[i] represents the value of the ith sightseeing spot. Two sightseeing spots i and j have a distance j - i between them. The score of a pair (i < j) of sightseeing spots is values[i] + values[j] + i - j: the sum of the values of the sightseeing spots, minus the distance ...
{ "question_id": 1063, "difficulty": "Medium", "lang_code": "class Solution:\n def maxScoreSightseeingPair(self, values: List[int]) -> int:", "question_title": "You are given an integer array values where values[i] represents the value of the ith sightseeing spot. Two sightseeing spots i and j have a distanc...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(values = [8,1,5,2,6]) == 11\\n assert candidate(values = [1,2]) == 2\\n\\n\\ncheck(Solution().maxScoreSightseeingPair)\"}", "style": "rule" }
{ "dataset": "LeetCodeDataset", "index": 1149, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nYou are given an integer array values where values[i] represents the value of the ith sightseeing spot. Two sightseeing spots i and j have a distance j...
246
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\\n0\\n\", \"1\\n1\\n0\\n\", \"1\\n1\\n1\\n\", \"1\\n0\\n1\\n\", \"1\\n0\\n2\\n\", \"1\\n0\\n4\\n\", \"1\\n0\\n3\\n\", \"1\\n0\\n-1\\n\"], \"outputs\": [\"0\\n\", \"1\\n1\\n\", \"0\\n\", \"1\\n1\\n\", \"1\\n1\\n\", \"1\\n1\\n\", \"1\\n1\\n\", \"1\\n1\\n\"]}", "style": "rule" ...
{ "dataset": "likaixin/TACO-verified", "index": 3912, "prompt": "Solve the programming task below in a Python markdown code block.\nIahub is very proud of his recent discovery, propagating trees. Right now, he invented a new tree, called xor-tree. After this new revolutionary discovery, he invented a game for kid...
590
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 1\\n3 1 2\\n4 3\\n1 2 2 3\"], \"outputs\": [\"2\\n24\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 10462, "prompt": "Solve the programming task below in a Python markdown code block.\nRead problems statements in Mandarin Chinese and Russian. \nLittle Elephant from Zoo of Lviv likes to watch movies.\nThere are N different movies (numbered from 0 to N − 1) he want...
574
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\": [\"aa\\n3\\n\", \"aa\\n2\\n\", \"cba\\n6\\n\", \"cba\\n4\\n\", \"abc\\n6\\n\", \"caa\\n4\\n\", \"daa\\n4\\n\", \"daa\\n3\\n\"], \"outputs\": [\"aa\\n\", \"a\\n\", \"cba\\n\", \"c\\n\", \"c\\n\", \"c\\n\", \"d\\n\", \"aa\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 2517, "prompt": "Solve the programming task below in a Python markdown code block.\nOne day in the IT lesson Anna and Maria learned about the lexicographic order.\n\nString x is lexicographically less than string y, if either x is a prefix of y (and x ≠ y), or there...
547
minimum-degree-of-a-connected-trio-in-a-graph
[ { "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().minTrioDegree
def check(candidate): assert candidate(n = 6, edges = [[1,2],[1,3],[3,2],[4,1],[5,2],[3,6]]) == 3 assert candidate(n = 7, edges = [[1,3],[4,1],[4,3],[2,5],[5,6],[6,7],[7,5],[2,6]]) == 0
class Solution: def minTrioDegree(self, n: int, edges: List[List[int]]) -> int: g = [[False] * n for _ in range(n)] deg = [0] * n for u, v in edges: u, v = u - 1, v - 1 g[u][v] = g[v][u] = True deg[u] += 1 deg[v] += 1 ans = inf ...
[ { "input": "n = 6, edges = [[1,2],[1,3],[3,2],[4,1],[5,2],[3,6]]", "output": "3" }, { "input": "n = 7, edges = [[1,3],[4,1],[4,3],[2,5],[5,6],[6,7],[7,5],[2,6]]", "output": "0" } ]
You are given an undirected graph. You are given an integer n which is the number of nodes in the graph and an array edges, where each edges[i] = [ui, vi] indicates that there is an undirected edge between ui and vi. A connected trio is a set of three nodes where there is an edge between every pair of them. The degree ...
{ "question_id": 1887, "difficulty": "Hard", "lang_code": "class Solution:\n def minTrioDegree(self, n: int, edges: List[List[int]]) -> int:", "question_title": "You are given an undirected graph. You are given an integer n which is the number of nodes in the graph and an array edges, where each edges[i] = [...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(n = 6, edges = [[1,2],[1,3],[3,2],[4,1],[5,2],[3,6]]) == 3\\n assert candidate(n = 7, edges = [[1,3],[4,1],[4,3],[2,5],[5,6],[6,7],[7,5],[2,6]]) == 0\\n\\n\\ncheck(Solution().minTrioDegree)\"}", "style": "rule" }
{ "dataset": "LeetCodeDataset", "index": 977, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nYou are given an undirected graph. You are given an integer n which is the number of nodes in the graph and an array edges, where each edges[i] = [ui, v...
278
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 3\\n###\\n#.#\\n###\\n\", \"3 3\\n###\\n###\\n###\\n\", \"3 3\\n...\\n...\\n...\\n\", \"3 3\\n...\\n...\\n...\\n\", \"3 3\\n###\\n.##\\n###\\n\", \"3 3\\n###\\n###\\n###\\n\", \"3 3\\n###\\n#.#\\n###\\n\", \"3 4\\n####\\n#.##\\n####\\n\"], \"outputs\": [\"YES\", \"NO\", \"YES\", \...
{ "dataset": "likaixin/TACO-verified", "index": 6247, "prompt": "Solve the programming task below in a Python markdown code block.\nStudent Andrey has been skipping physical education lessons for the whole term, and now he must somehow get a passing grade on this subject. Obviously, it is impossible to do this by...
734
reaching-points
[ { "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().reachingPoints
def check(candidate): assert candidate(sx = 1, sy = 1, tx = 3, ty = 5) == True assert candidate(sx = 1, sy = 1, tx = 2, ty = 2) == False assert candidate(sx = 1, sy = 1, tx = 1, ty = 1) == True
class Solution: def reachingPoints(self, sx: int, sy: int, tx: int, ty: int) -> bool: while tx > sx and ty > sy and tx != ty: if tx > ty: tx %= ty else: ty %= tx if tx == sx and ty == sy: return True if tx == sx: ...
[ { "input": "sx = 1, sy = 1, tx = 3, ty = 5", "output": "true" }, { "input": "sx = 1, sy = 1, tx = 2, ty = 2", "output": "false" }, { "input": "sx = 1, sy = 1, tx = 1, ty = 1", "output": "true" } ]
Given four integers sx, sy, tx, and ty, return true if it is possible to convert the point (sx, sy) to the point (tx, ty) through some operations, or false otherwise. The allowed operation on some point (x, y) is to convert it to either (x, x + y) or (x + y, y).   Please complete the following python code precisely: ``...
{ "question_id": 796, "difficulty": "Hard", "lang_code": "class Solution:\n def reachingPoints(self, sx: int, sy: int, tx: int, ty: int) -> bool:", "question_title": "Given four integers sx, sy, tx, and ty, return true if it is possible to convert the point (sx, sy) to the point (tx, ty) through some operati...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(sx = 1, sy = 1, tx = 3, ty = 5) == True\\n assert candidate(sx = 1, sy = 1, tx = 2, ty = 2) == False\\n assert candidate(sx = 1, sy = 1, tx = 1, ty = 1) == True\\n\\n\\ncheck(Solution().reachingPoints)\"}", "style": "rule" }
{ "dataset": "LeetCodeDataset", "index": 511, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nGiven four integers sx, sy, tx, and ty, return true if it is possible to convert the point (sx, sy) to the point (tx, ty) through some operations, or fa...
234
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"functional\": \"_inputs = [[6, 11, 2], [11, 345, 17], [0, 1, 7], [20, 20, 2], [20, 20, 8], [19, 20, 2], [0, 10, 1], [11, 14, 2], [101, 9999999999999999999999999999999999999999999, 11], [1005, 9999999999999999999999999999999999999999999, 109]]\\n_outputs = [[3], [20], [1], [1], [0], [1], [11], [2...
{ "dataset": "likaixin/TACO-verified", "index": 5707, "prompt": "Solve the programming task below in a Python markdown code block.\nComplete the function that takes 3 numbers `x, y and k` (where `x ≤ y`), and returns the number of integers within the range `[x..y]` (both ends included) that are divisible by `k`.\...
302
sum-in-a-matrix
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
Solution().matrixSum
def check(candidate): assert candidate(nums = [[7,2,1],[6,4,2],[6,5,3],[3,2,1]]) == 15 assert candidate(nums = [[1]]) == 1
class Solution: def matrixSum(self, nums: List[List[int]]) -> int: for row in nums: row.sort() return sum(map(max, zip(*nums)))
[ { "input": "nums = [[7,2,1],[6,4,2],[6,5,3],[3,2,1]]", "output": "15" }, { "input": "nums = [[1]]", "output": "1" } ]
You are given a 0-indexed 2D integer array nums. Initially, your score is 0. Perform the following operations until the matrix becomes empty: From each row in the matrix, select the largest number and remove it. In the case of a tie, it does not matter which number is chosen. Identify the highest number amongst all th...
{ "question_id": 2728, "difficulty": "Medium", "lang_code": "class Solution:\n def matrixSum(self, nums: List[List[int]]) -> int:", "question_title": "You are given a 0-indexed 2D integer array nums. Initially, your score is 0. Perform the following operations until the matrix becomes empty:\n\nFrom each row...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(nums = [[7,2,1],[6,4,2],[6,5,3],[3,2,1]]) == 15\\n assert candidate(nums = [[1]]) == 1\\n\\n\\ncheck(Solution().matrixSum)\"}", "style": "rule" }
{ "dataset": "LeetCodeDataset", "index": 925, "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 2D integer array nums. Initially, your score is 0. Perform the following operations until the matrix becomes empty:\n\nFrom ea...
244
destroying-asteroids
[ { "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().asteroidsDestroyed
def check(candidate): assert candidate(mass = 10, asteroids = [3,9,19,5,21]) == True assert candidate(mass = 5, asteroids = [4,9,23,4]) == False
class Solution: def asteroidsDestroyed(self, mass: int, asteroids: List[int]) -> bool: asteroids.sort() for v in asteroids: if mass < v: return False mass += v return True
[ { "input": "mass = 10, asteroids = [3,9,19,5,21]", "output": "true" }, { "input": "mass = 5, asteroids = [4,9,23,4]", "output": "false" } ]
You are given an integer mass, which represents the original mass of a planet. You are further given an integer array asteroids, where asteroids[i] is the mass of the ith asteroid. You can arrange for the planet to collide with the asteroids in any arbitrary order. If the mass of the planet is greater than or equal to ...
{ "question_id": 2245, "difficulty": "Medium", "lang_code": "class Solution:\n def asteroidsDestroyed(self, mass: int, asteroids: List[int]) -> bool:", "question_title": "You are given an integer mass, which represents the original mass of a planet. You are further given an integer array asteroids, where ast...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(mass = 10, asteroids = [3,9,19,5,21]) == True\\n assert candidate(mass = 5, asteroids = [4,9,23,4]) == False\\n\\n\\ncheck(Solution().asteroidsDestroyed)\"}", "style": "rule" }
{ "dataset": "LeetCodeDataset", "index": 643, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nYou are given an integer mass, which represents the original mass of a planet. You are further given an integer array asteroids, where asteroids[i] is t...
260
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\\n4\\n12\\n69\\n\"], \"outputs\": [\"Bob\\nAlice\\nAlice\\nBob\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 11668, "prompt": "Solve the programming task below in a Python markdown code block.\nAlice and Bob are playing a game.\n\nThey start with a positive integer $n$ and take alternating turns doing operations on it. Each turn a player can subtract from $n$ one of its di...
491
best-time-to-buy-and-sell-stock
[ { "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().maxProfit
def check(candidate): assert candidate([7,1,5,3,6,4]) == 5 assert candidate(prices = [7,6,4,3,1]) == 0
class Solution: def maxProfit(self, prices: List[int]) -> int: ans, mi = 0, inf for v in prices: ans = max(ans, v - mi) mi = min(mi, v) return ans
[ { "input": "[7,1,5,3,6,4]", "output": "5" }, { "input": "prices = [7,6,4,3,1]", "output": "0" } ]
You are given an array prices where prices[i] is the price of a given stock on the ith day. You want to maximize your profit by choosing a single day to buy one stock and choosing a different day in the future to sell that stock. Return the maximum profit you can achieve from this transaction. If you cannot achieve any...
{ "question_id": 121, "difficulty": "Easy", "lang_code": "class Solution:\n def maxProfit(self, prices: List[int]) -> int:", "question_title": "You are given an array prices where prices[i] is the price of a given stock on the ith day.\nYou want to maximize your profit by choosing a single day to buy one sto...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate([7,1,5,3,6,4]) == 5\\n assert candidate(prices = [7,6,4,3,1]) == 0\\n\\n\\ncheck(Solution().maxProfit)\"}", "style": "rule" }
{ "dataset": "LeetCodeDataset", "index": 831, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nYou are given an array prices where prices[i] is the price of a given stock on the ith day.\nYou want to maximize your profit by choosing a single day t...
222
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\\n0 0\\n\", \"2 1\\n1 0\\n\", \"2 1\\n2 1\\n\", \"2 1\\n1 1\\n\", \"2 1\\n1000 1000\\n\", \"2 1\\n1000 0000\\n\", \"2 1\\n0000 1000\\n\", \"2 1\\n0000 0000\\n\"], \"outputs\": [\"0\\n\", \"0\\n\\n\", \"0\\n\\n\", \"0\\n\", \"0\\n\", \"0\\n\\n\", \"1\\n1\\n\", \"0\\n\\n\"]}", "...
{ "dataset": "likaixin/TACO-verified", "index": 9855, "prompt": "Solve the programming task below in a Python markdown code block.\nByteburg Senate elections are coming. Usually \"United Byteland\", the ruling Byteland party, takes all the seats in the Senate to ensure stability and sustainable development. But t...
774
pseudo-palindromic-paths-in-a-binary-tree
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
Solution().pseudoPalindromicPaths
def check(candidate): assert candidate(root = tree_node([2,3,1,3,1,None,1])) == 2 assert candidate(root = tree_node([2,1,1,1,3,None,None,None,None,None,1])) == 1 assert candidate(root = tree_node([9])) == 1
# 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 pseudoPalindromicPaths(self, root: Optional[TreeNode]) -> int: def dfs(root: Optional[TreeNode],...
[ { "input": "root = [2,3,1,3,1,null,1]", "output": "2 " }, { "input": "root = [2,1,1,1,3,null,null,null,null,null,1]", "output": "1 " }, { "input": "root = [9]", "output": "1" } ]
Given a binary tree where node values are digits from 1 to 9. A path in the binary tree is said to be pseudo-palindromic if at least one permutation of the node values in the path is a palindrome. Return the number of pseudo-palindromic paths going from the root node to leaf nodes.   Please complete the following pytho...
{ "question_id": 1568, "difficulty": "Medium", "lang_code": "# Definition for a binary tree node.\n# class TreeNode:\n# def __init__(self, val=0, left=None, right=None):\n# self.val = val\n# self.left = left\n# self.right = right\nclass Solution:\n def pseudoPalindromicPaths (self, ...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(root = tree_node([2,3,1,3,1,None,1])) == 2 \\n assert candidate(root = tree_node([2,1,1,1,3,None,None,None,None,None,1])) == 1 \\n assert candidate(root = tree_node([9])) == 1\\n\\n\\ncheck(Solution().pseudoPalindromicPaths)\"}",...
{ "dataset": "LeetCodeDataset", "index": 441, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nGiven a binary tree where node values are digits from 1 to 9. A path in the binary tree is said to be pseudo-palindromic if at least one permutation of ...
277
jump-game-vi
[ { "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().maxResult
def check(candidate): assert candidate(nums = [1,-1,-2,4,-7,3], k = 2) == 7 assert candidate(nums = [10,-5,-2,4,0,3], k = 3) == 17 assert candidate(nums = [1,-5,-20,4,-1,3,-6,-3], k = 2) == 0
class Solution: def maxResult(self, nums: List[int], k: int) -> int: n = len(nums) f = [0] * n q = deque([0]) for i in range(n): if i - q[0] > k: q.popleft() f[i] = nums[i] + f[q[0]] while q and f[q[-1]] <= f[i]: q.p...
[ { "input": "nums = [1,-1,-2,4,-7,3], k = 2", "output": "7" }, { "input": "nums = [10,-5,-2,4,0,3], k = 3", "output": "17" }, { "input": "nums = [1,-5,-20,4,-1,3,-6,-3], k = 2", "output": "0" } ]
You are given a 0-indexed integer array nums and an integer k. You are initially standing at index 0. In one move, you can jump at most k steps forward without going outside the boundaries of the array. That is, you can jump from index i to any index in the range [i + 1, min(n - 1, i + k)] inclusive. You want to reach ...
{ "question_id": 1814, "difficulty": "Medium", "lang_code": "class Solution:\n def maxResult(self, nums: List[int], k: int) -> int:", "question_title": "You are given a 0-indexed integer array nums and an integer k.\nYou are initially standing at index 0. In one move, you can jump at most k steps forward wit...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(nums = [1,-1,-2,4,-7,3], k = 2) == 7\\n assert candidate(nums = [10,-5,-2,4,0,3], k = 3) == 17\\n assert candidate(nums = [1,-5,-20,4,-1,3,-6,-3], k = 2) == 0\\n\\n\\ncheck(Solution().maxResult)\"}", "style": "rule" }
{ "dataset": "LeetCodeDataset", "index": 1604, "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 nums and an integer k.\nYou are initially standing at index 0. In one move, you can jump at most k steps forwar...
279
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 -100 100\\n-99\\n99\\n\", \"1 1 -100 100\\n99\\n-99\\n\", \"3 2 10 40\\n8 1 15\\n16 22\", \"3 2 10 40\\n8 1 15\\n16 23\", \"3 0 10 40\\n8 1 15\\n16 23\", \"0 0 10 40\\n8 1 15\\n16 23\", \"3 3 10 40\\n8 1 15\\n16 23\", \"3 0 10 61\\n8 1 15\\n16 23\"], \"outputs\": [\"No War\\n\",...
{ "dataset": "likaixin/TACO-verified", "index": 11354, "prompt": "Solve the programming task below in a Python markdown code block.\nOur world is one-dimensional, and ruled by two empires called Empire A and Empire B.\nThe capital of Empire A is located at coordinate X, and that of Empire B is located at coordina...
585
maximum-score-from-removing-stones
[ { "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().maximumScore
def check(candidate): assert candidate(a = 2, b = 4, c = 6) == 6 assert candidate(a = 4, b = 4, c = 6) == 7 assert candidate(a = 1, b = 8, c = 8) == 8
class Solution: def maximumScore(self, a: int, b: int, c: int) -> int: s = sorted([a, b, c]) ans = 0 while s[1]: ans += 1 s[1] -= 1 s[2] -= 1 s.sort() return ans
[ { "input": "a = 2, b = 4, c = 6", "output": "6" }, { "input": "a = 4, b = 4, c = 6", "output": "7" }, { "input": "a = 1, b = 8, c = 8", "output": "8" } ]
You are playing a solitaire game with three piles of stones of sizes a​​​​​​, b,​​​​​​ and c​​​​​​ respectively. Each turn you choose two different non-empty piles, take one stone from each, and add 1 point to your score. The game stops when there are fewer than two non-empty piles (meaning there are no more available ...
{ "question_id": 1879, "difficulty": "Medium", "lang_code": "class Solution:\n def maximumScore(self, a: int, b: int, c: int) -> int:", "question_title": "You are playing a solitaire game with three piles of stones of sizes a​​​​​​, b,​​​​​​ and c​​​​​​ respectively. Each turn you choose two different non-em...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(a = 2, b = 4, c = 6) == 6\\n assert candidate(a = 4, b = 4, c = 6) == 7\\n assert candidate(a = 1, b = 8, c = 8) == 8\\n\\n\\ncheck(Solution().maximumScore)\"}", "style": "rule" }
{ "dataset": "LeetCodeDataset", "index": 1497, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nYou are playing a solitaire game with three piles of stones of sizes a​​​​​​, b,​​​​​​ and c​​​​​​ respectively. Each turn you choose two different non...
407
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 2 15\\n3 6 36\\n5 5 7\"], \"outputs\": [\"1 1 1 1\\n0 0 1\\n-2\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 1354, "prompt": "Solve the programming task below in a Python markdown code block.\nAlice gave Bob 3 integers N, K, and S. Help Bob find an S-good sequence.\n\nA sequence B of length N is called S-good if the following conditions are met:\nB_{i} \\in \\{-1, 0, 1\\} ...
626
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\\n5 2 3\\n6 4 5\\n\", \"2\\n5 3 4\\n9 4 4\\n\", \"2\\n5 2 3\\n9 4 7\\n\", \"2\\n5 2 3\\n1 4 7\\n\", \"2\\n5 2 4\\n9 4 4\\n\", \"2\\n5 2 4\\n1 4 7\\n\", \"2\\n5 4 4\\n1 4 7\\n\", \"2\\n5 3 4\\n9 4 5\\n\"], \"outputs\": [\"Yes\\nNo\\n\", \"No\\nNo\\n\", \"Yes\\nYes\\n\", \"Yes\\nNo\...
{ "dataset": "likaixin/TACO-verified", "index": 5522, "prompt": "Solve the programming task below in a Python markdown code block.\nAlexey, a merry Berland entrant, got sick of the gray reality and he zealously wants to go to university. There are a lot of universities nowadays, so Alexey is getting lost in the d...
821
palindrome-permutation
[ { "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().canPermutePalindrome
def check(candidate): assert candidate(s = "code") == False assert candidate(s = "aab") == True assert candidate(s = "carerac") == True
class Solution: def canPermutePalindrome(self, s: str) -> bool: return sum(v & 1 for v in Counter(s).values()) < 2
[ { "input": "s = \"code\"", "output": "False" }, { "input": "s = \"aab\"", "output": "True" }, { "input": "s = \"carerac\"", "output": "True" } ]
Given a string s, return true if a permutation of the string could form a palindrome and false otherwise.   Please complete the following python code precisely: ```python class Solution: def canPermutePalindrome(self, s: str) -> bool: ```
{ "question_id": 266, "difficulty": "Easy", "lang_code": "class Solution:\n def canPermutePalindrome(self, s: str) -> bool:", "question_title": "Given a string s, return true if a permutation of the string could form a palindrome and false otherwise.\n \nExample 1:\n\nInput: s = \"code\"\nOutput: false\n\nEx...
code
coding
{ "ground_truth": "{\"functional\": \"def check(candidate):\\n assert candidate(s = \\\"code\\\") == False\\n assert candidate(s = \\\"aab\\\") == True\\n assert candidate(s = \\\"carerac\\\") == True\\n\\n\\ncheck(Solution().canPermutePalindrome)\"}", "style": "rule" }
{ "dataset": "LeetCodeDataset", "index": 1085, "prompt": "Please solve the programming task below using a self-contained code snippet in a markdown code block.\n\nGiven a string s, return true if a permutation of the string could form a palindrome and false otherwise.\n \nPlease complete the following python code...
170
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 5\\n\", \"5 4 5\\n\", \"3 5 3\\n\", \"3 3 3\\n\", \"7 2 7\\n\", \"5 5 5\\n\", \"4 4 1\\n\", \"5 5 1\\n\"], \"outputs\": [\"8\", \"64\", \"25\", \"9\", \"16\", \"125\", \"256\", \"3125\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 6374, "prompt": "Solve the programming task below in a Python markdown code block.\nJust in case somebody missed it: this winter is totally cold in Nvodsk! It is so cold that one gets funny thoughts. For example, let's say there are strings with the length exactly n...
431
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"3\\n5\\n5 -4 2 -1 2\\n3\\n4 3 2\\n3\\n-3 -2 -1\\n\"], \"outputs\": [\"3\\n1 4 5\\n2 4 5\\n3 4 5\\n-1\\n0\\n\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 9678, "prompt": "Solve the programming task below in a Python markdown code block.\nYou are given an array $a$ of $n$ elements.\n\nYour can perform the following operation no more than $n$ times: Select three indices $x,y,z$ $(1 \\leq x < y < z \\leq n)$ and replace...
725
null
[ { "content": "You are a helpful programming assistant. The user will ask you a question and you as the assistant solve it. The assistant first thinks how to solve the task through reasoning and then provides the user with the final answer. The reasoning process and answer are enclosed within <think>...</think> ...
null
null
null
null
null
null
code
coding
{ "ground_truth": "{\"inputs\": [\"4\\n1\\n2\\n3\\n4\"], \"outputs\": [\"1\\n13\\n57\\n135\\n7911\\n131517\\n1357\\n9111315\\n17192123\\n25272931\"]}", "style": "rule" }
{ "dataset": "likaixin/TACO-verified", "index": 8516, "prompt": "Solve the programming task below in a Python markdown code block.\nThe chef is trying to solve some pattern problems, Chef wants your help to code it. Chef has one number K to form a new pattern. Help the chef to code this pattern problem.\n\n-----I...
345