prompt
listlengths
1
1
query
stringlengths
578
3.33k
constraints
listlengths
10
10
data_source
stringclasses
1 value
extra_info
dict
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed array arr consisting of n positive integers, and...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 0-indexed array arr consisting of n positive integers, and a positive integer k. The array arr is calle...
[ "assert candidate(arr=[6, 5, 4, 3, 2, 1], k=2) == 4", "assert candidate(arr=[1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5], k=5) == 0", "assert candidate(arr=[5, 4, 3, 2, 1, 0, -1, -2, -3, -4], k=4) == 6", "assert candidate(arr=[5, 9, 4, 6, 7, 2, 8, 10, 3, 11], k=2) == 4", "assert candidate(arr=[1, 1, 1, 1, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(arr=[6, 5, 4, 3, 2, 1], k=2) == 4", "assert candidate(arr=[1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5], k=5) == 0", "assert candidate(arr=[5, 4, 3, 2, 1, 0, -1, -2, -3, -4], k=4) == 6", "assert candidate(arr=[5, 9, 4, 6, 7, 2, 8, 10, 3, 11], k=2) == 4", "asser...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed integer array nums. Initially on minute 0, the a...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 0-indexed integer array nums. Initially on minute 0, the array is unchanged. Every minute, the leftmost...
[ "assert candidate(nums=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], queries=[[1, 0], [2, 1], [3, 2], [4, 3], [5, 4], [6, 5], [7, 6], [8, 7], [9, 8], [10, 9], [11, 0], [12, 1], [13, 2], [14, 3], [15, 4], [16, 5], [17, 6], [18, 7], [19, 8], [20, 9]]) == [1, 3, 5, 7, 9, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9]", "assert...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], queries=[[1, 0], [2, 1], [3, 2], [4, 3], [5, 4], [6, 5], [7, 6], [8, 7], [9, 8], [10, 9], [11, 0], [12, 1], [13, 2], [14, 3], [15, 4], [16, 5], [17, 6], [18, 7], [19, 8], [20, 9]]) == [1, 3, 5, 7, 9, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6,...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou have information about n different recipes. You are given a string arr...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You have information about n different recipes. You are given a string array recipes and a 2D string array ingredients....
[ "assert candidate(recipes=['chocolate_cake', 'vanilla_cake', 'red_velvet_cake'], ingredients=[['flour', 'sugar', 'eggs', 'chocolate'], ['flour', 'sugar', 'eggs'], ['vanilla_cake', 'red_food_color']], supplies=['flour', 'sugar', 'eggs', 'chocolate', 'red_food_color']) == ['vanilla_cake', 'chocolate_cake', 'red_velve...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(recipes=['chocolate_cake', 'vanilla_cake', 'red_velvet_cake'], ingredients=[['flour', 'sugar', 'eggs', 'chocolate'], ['flour', 'sugar', 'eggs'], ['vanilla_cake', 'red_food_color']], supplies=['flour', 'sugar', 'eggs', 'chocolate', 'red_food_color']) == ['vanilla_cake', 'chocol...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nA parentheses string is a non-empty string consisting only of '(' and ')'....
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: A parentheses string is a non-empty string consisting only of '(' and ')'. It is valid if any of the following conditio...
[ "assert candidate(s='()(()())', locked='10010010') == True", "assert candidate(s=')()(()(()))(', locked='010101010100') == True", "assert candidate(s='((())())()', locked='001010000001') == True", "assert candidate(s='()()()()()()()()', locked='0000000000000000') == True", "assert candidate(s='()))()', lock...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='()(()())', locked='10010010') == True", "assert candidate(s=')()(()(()))(', locked='010101010100') == True", "assert candidate(s='((())())()', locked='001010000001') == True", "assert candidate(s='()()()()()()()()', locked='0000000000000000') == True", "asse...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nThere is an n x n grid, with the top-left cell at (0, 0) and the bottom-ri...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: There is an n x n grid, with the top-left cell at (0, 0) and the bottom-right cell at (n - 1, n - 1). You are given the...
[ "assert candidate(n=3, startPos=[0, 2], s='LLD') == [3, 2, 1]", "assert candidate(n=300, startPos=[299, 299], s='DDDDRRRRUUUULLLL') == [0, 0, 0, 0, 0, 0, 0, 0, 8, 7, 6, 5, 4, 3, 2, 1]", "assert candidate(n=8, startPos=[7, 0], s='RRRRDDDDLLLLUUUU') == [4, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 4, 3, 2, 1]", "assert ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=3, startPos=[0, 2], s='LLD') == [3, 2, 1]", "assert candidate(n=300, startPos=[299, 299], s='DDDDRRRRUUUULLLL') == [0, 0, 0, 0, 0, 0, 0, 0, 8, 7, 6, 5, 4, 3, 2, 1]", "assert candidate(n=8, startPos=[7, 0], s='RRRRDDDDLLLLUUUU') == [4, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0,...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nAlice had a 0-indexed array arr consisting of n positive integers. She cho...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Alice had a 0-indexed array arr consisting of n positive integers. She chose an arbitrary positive integer k and create...
[ "assert candidate(nums=[5, 435]) == [220]", "assert candidate(nums=[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31]) == [2, 6, 10, 14, 18, 22, 26, 30]", "assert candidate(nums=[10, 20, 30, 40, 50, 60, 70, 80]) == [15, 35, 55, 75]", "assert candidate(nums=[1, 2, 3, 4, 5, 6]) == []", "assert candid...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[5, 435]) == [220]", "assert candidate(nums=[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31]) == [2, 6, 10, 14, 18, 22, 26, 30]", "assert candidate(nums=[10, 20, 30, 40, 50, 60, 70, 80]) == [15, 35, 55, 75]", "assert candidate(nums=[1, 2, 3, 4, 5, 6...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed binary matrix grid. In one operation, you can fl...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 0-indexed binary matrix grid. In one operation, you can flip any 1 in grid to be 0. A binary matrix is ...
[ "assert candidate(grid=[[1, 1, 1, 0, 0], [1, 0, 0, 1, 1], [0, 1, 1, 0, 0], [0, 0, 0, 1, 1], [1, 1, 0, 0, 0]]) == 6", "assert candidate(grid=[[1, 0, 0, 0, 0, 0, 1], [0, 1, 1, 0, 0, 1, 0], [0, 1, 0, 1, 0, 1, 0], [0, 0, 1, 0, 1, 0, 0], [0, 1, 0, 1, 0, 1, 0], [0, 1, 1, 0, 0, 1, 0], [1, 0, 0, 0, 0, 0, 1]]) == 4", "a...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(grid=[[1, 1, 1, 0, 0], [1, 0, 0, 1, 1], [0, 1, 1, 0, 0], [0, 0, 0, 1, 1], [1, 1, 0, 0, 0]]) == 6", "assert candidate(grid=[[1, 0, 0, 0, 0, 0, 1], [0, 1, 1, 0, 0, 1, 0], [0, 1, 0, 1, 0, 1, 0], [0, 0, 1, 0, 1, 0, 0], [0, 1, 0, 1, 0, 1, 0], [0, 1, 1, 0, 0, 1, 0], [1, 0, 0, 0,...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nAnti-theft security devices are activated inside a bank. You are given a 0...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Anti-theft security devices are activated inside a bank. You are given a 0-indexed binary string array bank representin...
[ "assert candidate(bank=['000', '000', '000', '111']) == 0", "assert candidate(bank=['000000000', '000101000', '000000000', '000010000', '000000000', '100000001']) == 4", "assert candidate(bank=['000000', '101010', '010101', '000000', '101010']) == 18", "assert candidate(bank=['111', '000', '111']) == 9", "a...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(bank=['000', '000', '000', '111']) == 0", "assert candidate(bank=['000000000', '000101000', '000000000', '000010000', '000000000', '100000001']) == 4", "assert candidate(bank=['000000', '101010', '010101', '000000', '101010']) == 18", "assert candidate(bank=['111',...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an integer mass, which represents the original mass of a pla...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given an integer mass, which represents the original mass of a planet. You are further given an integer array a...
[ "assert candidate(mass=25, asteroids=[25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25]) == True", "assert candidate(mass=9, asteroids=[9, 8, 7, 6, 5, 4, 3, 2, 1]) == True", "assert candidate(mass=25, asteroids=[20, 15, 10, 5, 30, 25, 35, 40, 45, 50]) == True", "assert candidate(...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(mass=25, asteroids=[25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25]) == True", "assert candidate(mass=9, asteroids=[9, 8, 7, 6, 5, 4, 3, 2, 1]) == True", "assert candidate(mass=25, asteroids=[20, 15, 10, 5, 30, 25, 35, 40, 45, 50]) == Tr...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nA company is organizing a meeting and has a list of n employees, waiting t...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: A company is organizing a meeting and has a list of n employees, waiting to be invited. They have arranged for a large ...
[ "assert candidate(favorite=[1, 2, 1, 4, 3, 6, 5, 8, 7, 10, 9, 12, 11, 14, 13, 0]) == 16", "assert candidate(favorite=[2, 1, 4, 3, 6, 5, 8, 7, 10, 9, 12, 11, 14, 13, 0, 15]) == 8", "assert candidate(favorite=[1, 3, 1, 4, 3, 6, 5, 8, 7, 10, 9, 12, 11, 14, 13, 16, 15]) == 16", "assert candidate(favorite=[4, 5, 6...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(favorite=[1, 2, 1, 4, 3, 6, 5, 8, 7, 10, 9, 12, 11, 14, 13, 0]) == 16", "assert candidate(favorite=[2, 1, 4, 3, 6, 5, 8, 7, 10, 9, 12, 11, 14, 13, 0, 15]) == 8", "assert candidate(favorite=[1, 3, 1, 4, 3, 6, 5, 8, 7, 10, 9, 12, 11, 14, 13, 16, 15]) == 16", "assert ...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nIn a linked list of size n, where n is even, the ith node (0-indexed) of t...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: In a linked list of size n, where n is even, the ith node (0-indexed) of the linked list is known as the twin of the (n...
[ "assert candidate(head=list_node([3, 3, 5, 5, 7, 7, 9, 9])) == 12", "assert candidate(head=list_node([100000, 50000, 25000, 12500, 6250, 3125, 1562, 781, 390, 195, 97, 48, 24, 12, 6, 3])) == 100003", "assert candidate(head=list_node([2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40])) ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(head=list_node([3, 3, 5, 5, 7, 7, 9, 9])) == 12", "assert candidate(head=list_node([100000, 50000, 25000, 12500, 6250, 3125, 1562, 781, 390, 195, 97, 48, 24, 12, 6, 3])) == 100003", "assert candidate(head=list_node([2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 3...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an array of strings words. Each element of words consists of...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given an array of strings words. Each element of words consists of two lowercase English letters. Create the lo...
[ "assert candidate(words=['ab', 'ba', 'ab', 'ba', 'ab', 'ba', 'cd', 'dc', 'cd', 'dc', 'ef', 'fe', 'ef', 'fe', 'gh', 'hg', 'gh', 'hg']) == 36", "assert candidate(words=['ab', 'ba', 'cd', 'dc', 'ef', 'fe', 'gh', 'hg', 'ij', 'ji', 'kl', 'lk', 'mn', 'nm', 'op', 'po', 'qr', 'rq', 'st', 'ts', 'uv', 'vu', 'wx', 'xw', 'yz...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(words=['ab', 'ba', 'ab', 'ba', 'ab', 'ba', 'cd', 'dc', 'cd', 'dc', 'ef', 'fe', 'ef', 'fe', 'gh', 'hg', 'gh', 'hg']) == 36", "assert candidate(words=['ab', 'ba', 'cd', 'dc', 'ef', 'fe', 'gh', 'hg', 'ij', 'ji', 'kl', 'lk', 'mn', 'nm', 'op', 'po', 'qr', 'rq', 'st', 'ts', 'uv'...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an m x n binary matrix grid where each cell is either 0 (emp...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given an m x n binary matrix grid where each cell is either 0 (empty) or 1 (occupied). You are then given stamp...
[ "assert candidate(grid=[[0, 1, 0, 1, 0], [1, 0, 1, 0, 1], [0, 1, 0, 1, 0], [1, 0, 1, 0, 1], [0, 1, 0, 1, 0]], stampHeight=2, stampWidth=2) == False", "assert candidate(grid=[[1, 0, 0, 1, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0]], stampHeight=2, stampWidth=2) == False",...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(grid=[[0, 1, 0, 1, 0], [1, 0, 1, 0, 1], [0, 1, 0, 1, 0], [1, 0, 1, 0, 1], [0, 1, 0, 1, 0]], stampHeight=2, stampWidth=2) == False", "assert candidate(grid=[[1, 0, 0, 1, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0]], stampHeight=2, s...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given two 0-indexed arrays of strings startWords and targetWords. ...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given two 0-indexed arrays of strings startWords and targetWords. Each string consists of lowercase English let...
[ "assert candidate(startWords=['zebra', 'dog', 'cat'], targetWords=['zebrao', 'doge', 'taco']) == 3", "assert candidate(startWords=['abc', 'def', 'ghi', 'jkl', 'mno'], targetWords=['abcd', 'abce', 'abcf', 'abck', 'abcm']) == 5", "assert candidate(startWords=['quick', 'brown', 'fox'], targetWords=['quickly', 'bro...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(startWords=['zebra', 'dog', 'cat'], targetWords=['zebrao', 'doge', 'taco']) == 3", "assert candidate(startWords=['abc', 'def', 'ghi', 'jkl', 'mno'], targetWords=['abcd', 'abce', 'abcf', 'abck', 'abcm']) == 5", "assert candidate(startWords=['quick', 'brown', 'fox'], tar...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou have n flower seeds. Every seed must be planted first before it can be...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You have n flower seeds. Every seed must be planted first before it can begin to grow, then bloom. Planting a seed take...
[ "assert candidate(plantTime=[1, 3, 5, 7, 9], growTime=[9, 7, 5, 3, 1]) == 26", "assert candidate(plantTime=[10, 5, 7], growTime=[4, 6, 8]) == 26", "assert candidate(plantTime=[5, 4, 3, 2, 1], growTime=[10, 20, 30, 40, 50]) == 51", "assert candidate(plantTime=[4, 3, 2, 1, 5, 6, 7, 8, 9, 10], growTime=[10, 9, 8...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(plantTime=[1, 3, 5, 7, 9], growTime=[9, 7, 5, 3, 1]) == 26", "assert candidate(plantTime=[10, 5, 7], growTime=[4, 6, 8]) == 26", "assert candidate(plantTime=[5, 4, 3, 2, 1], growTime=[10, 20, 30, 40, 50]) == 51", "assert candidate(plantTime=[4, 3, 2, 1, 5, 6, 7, 8,...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou have n buckets each containing some gallons of water in it, represente...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You have n buckets each containing some gallons of water in it, represented by a 0-indexed integer array buckets, where...
[ "assert candidate(buckets=[2, 4, 6], loss=50) == 3.499998092651367", "assert candidate(buckets=[50, 100, 150, 200, 250], loss=50) == 128.57142835855484", "assert candidate(buckets=[1, 1, 1, 1, 1, 1], loss=50) == 0.9999923706054688", "assert candidate(buckets=[99999, 100000, 100001, 100002, 100003, 100004], lo...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(buckets=[2, 4, 6], loss=50) == 3.499998092651367", "assert candidate(buckets=[50, 100, 150, 200, 250], loss=50) == 128.57142835855484", "assert candidate(buckets=[1, 1, 1, 1, 1, 1], loss=50) == 0.9999923706054688", "assert candidate(buckets=[99999, 100000, 100001, ...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are playing a game with integers. You start with the integer 1 and you...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are playing a game with integers. You start with the integer 1 and you want to reach the integer target. In one mov...
[ "assert candidate(target=100, maxDoubles=5) == 8", "assert candidate(target=1024, maxDoubles=10) == 10", "assert candidate(target=8973424, maxDoubles=50) == 32", "assert candidate(target=1, maxDoubles=1) == 0", "assert candidate(target=1023, maxDoubles=0) == 1022", "assert candidate(target=100, maxDoubles...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(target=100, maxDoubles=5) == 8", "assert candidate(target=1024, maxDoubles=10) == 10", "assert candidate(target=8973424, maxDoubles=50) == 32", "assert candidate(target=1, maxDoubles=1) == 0", "assert candidate(target=1023, maxDoubles=0) == 1022", "assert c...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed 2D integer array questions where questions[i] = ...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 0-indexed 2D integer array questions where questions[i] = [pointsi, brainpoweri]. The array describes t...
[ "assert candidate(questions=[[1, 0], [2, 1], [3, 2], [4, 3], [5, 4], [6, 5], [7, 6], [8, 7], [9, 8], [10, 9], [11, 10], [12, 11]]) == 22", "assert candidate(questions=[[1, 0], [1, 0], [1, 0], [1, 0], [1, 0], [1, 0], [1, 0], [1, 0], [1, 0], [1, 0]]) == 10", "assert candidate(questions=[[10, 0], [5, 2], [10, 1], ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(questions=[[1, 0], [2, 1], [3, 2], [4, 3], [5, 4], [6, 5], [7, 6], [8, 7], [9, 8], [10, 9], [11, 10], [12, 11]]) == 22", "assert candidate(questions=[[1, 0], [1, 0], [1, 0], [1, 0], [1, 0], [1, 0], [1, 0], [1, 0], [1, 0], [1, 0]]) == 10", "assert candidate(questions=[[...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given two 0-indexed integer arrays nums1 and nums2 of length n.\nA...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given two 0-indexed integer arrays nums1 and nums2 of length n. A range [l, r] (inclusive) where 0 <= l <= r < ...
[ "assert candidate(nums1=[10, 10, 10, 10], nums2=[5, 5, 5, 5]) == 6", "assert candidate(nums1=[0, 1], nums2=[1, 0]) == 4", "assert candidate(nums1=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], nums2=[9, 8, 7, 6, 5, 4, 3, 2, 1, 0]) == 610", "assert candidate(nums1=[10, 20, 30], nums2=[30, 20, 10]) == 0", "assert candidate(...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums1=[10, 10, 10, 10], nums2=[5, 5, 5, 5]) == 6", "assert candidate(nums1=[0, 1], nums2=[1, 0]) == 4", "assert candidate(nums1=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], nums2=[9, 8, 7, 6, 5, 4, 3, 2, 1, 0]) == 610", "assert candidate(nums1=[10, 20, 30], nums2=[30, 20, 10]) ...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed array of n integers differences, which describes...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 0-indexed array of n integers differences, which describes the differences between each pair of consecu...
[ "assert candidate(differences=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100, -100, -90, -80, -70, -60, -50, -40, -30, -20, -10], lower=0, upper=500) == 0", "assert candidate(differences=[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], lower=-10, upper=0) == 0", "assert candidate(differences=[100000, 100...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(differences=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100, -100, -90, -80, -70, -60, -50, -40, -30, -20, -10], lower=0, upper=500) == 0", "assert candidate(differences=[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], lower=-10, upper=0) == 0", "assert candidate...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed 2D integer array grid of size m x n that represe...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 0-indexed 2D integer array grid of size m x n that represents a map of the items in a shop. The integer...
[ "assert candidate(grid=[[100, 200, 300, 400, 500], [600, 700, 800, 900, 1000], [1100, 1200, 1300, 1400, 1500], [1600, 1700, 1800, 1900, 2000], [2100, 2200, 2300, 2400, 2500]], pricing=[500, 2000], start=[2, 2], k=10) == [[2, 2], [1, 2], [2, 1], [2, 3], [3, 2], [1, 1], [1, 3], [2, 0], [2, 4], [3, 1]]", "assert can...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(grid=[[100, 200, 300, 400, 500], [600, 700, 800, 900, 1000], [1100, 1200, 1300, 1400, 1500], [1600, 1700, 1800, 1900, 2000], [2100, 2200, 2300, 2400, 2500]], pricing=[500, 2000], start=[2, 2], k=10) == [[2, 2], [1, 2], [2, 1], [2, 3], [3, 2], [1, 1], [1, 3], [2, 0], [2, 4], [3...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nAlong a long library corridor, there is a line of seats and decorative pla...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Along a long library corridor, there is a line of seats and decorative plants. You are given a 0-indexed string corrido...
[ "assert candidate(corridor='SSPPSSPPSSPPSSPPSSPPSSPPSSPPSS') == 2187", "assert candidate(corridor='SSSPSPSPSPSPSSSSPSPS') == 0", "assert candidate(corridor='SSPPPSSPPPSSPPPSS') == 64", "assert candidate(corridor='SSPSSSPSSPSSPSSPSS') == 0", "assert candidate(corridor='PPPPSSPPPPSSPPPPSSPPPPSSPPPPSS') == 625...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(corridor='SSPPSSPPSSPPSSPPSSPPSSPPSSPPSS') == 2187", "assert candidate(corridor='SSSPSPSPSPSPSSSSPSPS') == 0", "assert candidate(corridor='SSPPPSSPPPSSPPPSS') == 64", "assert candidate(corridor='SSPSSSPSSPSSPSSPSS') == 0", "assert candidate(corridor='PPPPSSPPPP...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed integer array nums of even length consisting of ...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 0-indexed integer array nums of even length consisting of an equal number of positive and negative inte...
[ "assert candidate(nums=[6, -6, 5, -5, 4, -4, 3, -3, 2, -2, 1, -1]) == [6, -6, 5, -5, 4, -4, 3, -3, 2, -2, 1, -1]", "assert candidate(nums=[-1, 1, -2, 2, -3, 3, -4, 4, -5, 5]) == [1, -1, 2, -2, 3, -3, 4, -4, 5, -5]", "assert candidate(nums=[-1, 2, -3, 4, -5, 6, -7, 8, -9, 10, -11, 12]) == [2, -1, 4, -3, 6, -5, 8...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[6, -6, 5, -5, 4, -4, 3, -3, 2, -2, 1, -1]) == [6, -6, 5, -5, 4, -4, 3, -3, 2, -2, 1, -1]", "assert candidate(nums=[-1, 1, -2, 2, -3, 3, -4, 4, -5, 5]) == [1, -1, 2, -2, 3, -3, 4, -4, 5, -5]", "assert candidate(nums=[-1, 2, -3, 4, -5, 6, -7, 8, -9, 10, -11, 12]) =...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nThere are two types of persons:\n\nThe good person: The person who always ...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: There are two types of persons: The good person: The person who always tells the truth. The bad person: The person who...
[ "assert candidate(statements=[[2, 2, 1, 0, 2, 0, 2, 1, 0, 1, 2], [2, 2, 0, 1, 2, 0, 2, 0, 1, 0, 2], [1, 0, 2, 2, 0, 1, 2, 1, 2, 0, 1], [0, 1, 2, 2, 1, 0, 2, 0, 1, 2, 0], [2, 2, 0, 1, 2, 0, 2, 0, 1, 0, 2], [0, 0, 1, 0, 0, 2, 2, 0, 0, 1, 1], [2, 2, 2, 0, 2, 2, 2, 0, 2, 0, 2], [1, 0, 1, 0, 0, 0, 0, 2, 1, 0, 1], [0, 1,...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(statements=[[2, 2, 1, 0, 2, 0, 2, 1, 0, 1, 2], [2, 2, 0, 1, 2, 0, 2, 0, 1, 0, 2], [1, 0, 2, 2, 0, 1, 2, 1, 2, 0, 1], [0, 1, 2, 2, 1, 0, 2, 0, 1, 2, 0], [2, 2, 0, 1, 2, 0, 2, 0, 1, 0, 2], [0, 0, 1, 0, 0, 2, 2, 0, 0, 1, 1], [2, 2, 2, 0, 2, 2, 2, 0, 2, 0, 2], [1, 0, 1, 0, 0, 0, 0...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed binary array nums of length n. nums can be divid...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 0-indexed binary array nums of length n. nums can be divided at index i (where 0 <= i <= n) into two ar...
[ "assert candidate(nums=[1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1]) == [0]", "assert candidate(nums=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) == [0]", "assert candidate(nums=[0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1]) == [4, 12, 20, 28]...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1]) == [0]", "assert candidate(nums=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) == [0]", "assert candidate(nums=[0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, ...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nThe hash of a 0-indexed string s of length k, given integers p and m, is c...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: The hash of a 0-indexed string s of length k, given integers p and m, is computed using the following function: hash(s...
[ "assert candidate(s='powerrangers', power=29, modulo=97, k=4, hashValue=53) == 'gers'", "assert candidate(s='mmcp', power=13, modulo=457, k=2, hashValue=33) == 'cp'", "assert candidate(s='lkjihgfedcbazyxwvutsrqponml', power=41, modulo=1000000009, k=14, hashValue=102474831) == 'yxwvutsrqponml'", "assert candid...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='powerrangers', power=29, modulo=97, k=4, hashValue=53) == 'gers'", "assert candidate(s='mmcp', power=13, modulo=457, k=2, hashValue=33) == 'cp'", "assert candidate(s='lkjihgfedcbazyxwvutsrqponml', power=41, modulo=1000000009, k=14, hashValue=102474831) == 'yxwvutsrq...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed array of strings words. Each string consists of ...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 0-indexed array of strings words. Each string consists of lowercase English letters only. No letter occ...
[ "assert candidate(words=['abcd', 'ac', 'ab', 'abc', 'a']) == [1, 5]", "assert candidate(words=['abcdefghij', 'abcdefgh', 'abcdefg', 'abcdef', 'abcde', 'abcd', 'abc', 'ab', 'a', 'z', 'y', 'x', 'w', 'v', 'u', 't', 's', 'r', 'q', 'p', 'o', 'n', 'm', 'l', 'k', 'j', 'i', 'h', 'g', 'f', 'e', 'd', 'c', 'b']) == [2, 33]"...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(words=['abcd', 'ac', 'ab', 'abc', 'a']) == [1, 5]", "assert candidate(words=['abcdefghij', 'abcdefgh', 'abcdefg', 'abcdef', 'abcde', 'abcd', 'abc', 'ab', 'a', 'z', 'y', 'x', 'w', 'v', 'u', 't', 's', 'r', 'q', 'p', 'o', 'n', 'm', 'l', 'k', 'j', 'i', 'h', 'g', 'f', 'e', 'd',...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nA generic microwave supports cooking times for:\n\nat least 1 second.\nat ...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: A generic microwave supports cooking times for: at least 1 second. at most 99 minutes and 99 seconds. To set the cook...
[ "assert candidate(startAt=8, moveCost=2, pushCost=2, targetSeconds=2039) == 14", "assert candidate(startAt=8, moveCost=3, pushCost=2, targetSeconds=99) == 7", "assert candidate(startAt=1, moveCost=8, pushCost=5, targetSeconds=1234) == 36", "assert candidate(startAt=0, moveCost=1, pushCost=1000, targetSeconds=...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(startAt=8, moveCost=2, pushCost=2, targetSeconds=2039) == 14", "assert candidate(startAt=8, moveCost=3, pushCost=2, targetSeconds=99) == 7", "assert candidate(startAt=1, moveCost=8, pushCost=5, targetSeconds=1234) == 36", "assert candidate(startAt=0, moveCost=1, pu...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed integer array nums consisting of 3 * n elements....
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 0-indexed integer array nums consisting of 3 * n elements. You are allowed to remove any subsequence of...
[ "assert candidate(nums=[100, 200, 100, 200, 100, 200, 100, 200, 100, 200, 100, 200]) == -300", "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]) == -32", "assert candidate(nums=[1, 2, 3, 4, 5, 6]) == -8", "assert candidate(nums=[3, 2, 1, 6, 5, 4, 9, 8, 7]) == -18", "assert candidate(nums=[5, 4...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[100, 200, 100, 200, 100, 200, 100, 200, 100, 200, 100, 200]) == -300", "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]) == -32", "assert candidate(nums=[1, 2, 3, 4, 5, 6]) == -8", "assert candidate(nums=[3, 2, 1, 6, 5, 4, 9, 8, 7]) == -18", ...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed binary string s which represents a sequence of t...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 0-indexed binary string s which represents a sequence of train cars. s[i] = '0' denotes that the ith ca...
[ "assert candidate(s='000000') == 0", "assert candidate(s='00001010101010101000') == 14", "assert candidate(s='1110000111100001111000011110000111100001111000011110') == 48", "assert candidate(s='111100001111000011110000') == 20", "assert candidate(s='1100110011001100110011001100110011001100110011001100110011...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='000000') == 0", "assert candidate(s='00001010101010101000') == 14", "assert candidate(s='1110000111100001111000011110000111100001111000011110') == 48", "assert candidate(s='111100001111000011110000') == 20", "assert candidate(s='11001100110011001100110011001...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven a digit string s, return the number of unique substrings of s where ...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given a digit string s, return the number of unique substrings of s where every digit appears the same number of times....
[ "assert candidate(s='112211') == 9", "assert candidate(s='121212121212121212121212') == 25", "assert candidate(s='1234567890987654321012345678909876543210') == 142", "assert candidate(s='1212121212121212121212121212121212121212121212121212') == 53", "assert candidate(s='11223344556677889900') == 74", "ass...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='112211') == 9", "assert candidate(s='121212121212121212121212') == 25", "assert candidate(s='1234567890987654321012345678909876543210') == 142", "assert candidate(s='1212121212121212121212121212121212121212121212121212') == 53", "assert candidate(s='11223344...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed array nums consisting of n positive integers.\nT...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 0-indexed array nums consisting of n positive integers. The array nums is called alternating if: nums[...
[ "assert candidate(nums=[1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2]) == 0", "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1]) == 16", "assert candidate(nums=[1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2]) == 0", "assert candidate(nums...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2]) == 0", "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1]) == 16", "assert candidate(nums=[1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2]) == 0",...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an array of positive integers beans, where each integer repr...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given an array of positive integers beans, where each integer represents the number of magic beans found in a p...
[ "assert candidate(beans=[50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50]) == 0", "assert candidate(beans=[1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105, 120, 136, 153, 171, 190, 210]) == 805", "assert candidate(beans=[1, 100000, 2, 9...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(beans=[50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50]) == 0", "assert candidate(beans=[1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105, 120, 136, 153, 171, 190, 210]) == 805", "assert candida...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an integer array nums of length n and an integer numSlots su...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given an integer array nums of length n and an integer numSlots such that 2 * numSlots >= n. There are numSlots...
[ "assert candidate(nums=[15, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 1, 2, 3], numSlots=9) == 90", "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], numSlots=8) == 71", "assert candidate(nums=[7, 14, 21, 28, 35, 42, 49, 56], numSlots=4) == 19", "assert candidate(nums=[5, 5,...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[15, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 1, 2, 3], numSlots=9) == 90", "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], numSlots=8) == 71", "assert candidate(nums=[7, 14, 21, 28, 35, 42, 49, 56], numSlots=4) == 19", "a...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed m x n binary matrix grid.\nIn one operation, you...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 0-indexed m x n binary matrix grid. In one operation, you can choose any i and j that meet the followin...
[ "assert candidate(grid=[[1, 0, 1], [0, 1, 0], [1, 0, 1]]) == 3", "assert candidate(grid=[[0, 0], [0, 0]]) == 0", "assert candidate(grid=[[1, 0, 1, 0, 1], [0, 1, 0, 1, 0], [1, 0, 1, 0, 1], [0, 1, 0, 1, 0]]) == 4", "assert candidate(grid=[[0, 1, 0], [1, 0, 1], [0, 1, 0]]) == 2", "assert candidate(grid=[[1, 1,...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(grid=[[1, 0, 1], [0, 1, 0], [1, 0, 1]]) == 3", "assert candidate(grid=[[0, 0], [0, 0]]) == 0", "assert candidate(grid=[[1, 0, 1, 0, 1], [0, 1, 0, 1, 0], [1, 0, 1, 0, 1], [0, 1, 0, 1, 0]]) == 4", "assert candidate(grid=[[0, 1, 0], [1, 0, 1], [0, 1, 0]]) == 2", "...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven an integer num, return three consecutive integers (as a sorted array...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given an integer num, return three consecutive integers (as a sorted array) that sum to num. If num cannot be expressed...
[ "assert candidate(num=3000000000000) == [999999999999, 1000000000000, 1000000000001]", "assert candidate(num=1) == []", "assert candidate(num=9) == [2, 3, 4]", "assert candidate(num=1000000000000001) == []", "assert candidate(num=500000000000001) == [166666666666666, 166666666666667, 166666666666668]", "a...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(num=3000000000000) == [999999999999, 1000000000000, 1000000000001]", "assert candidate(num=1) == []", "assert candidate(num=9) == [2, 3, 4]", "assert candidate(num=1000000000000001) == []", "assert candidate(num=500000000000001) == [166666666666666, 16666666666...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an integer finalSum. Split it into a sum of a maximum number...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given an integer finalSum. Split it into a sum of a maximum number of unique positive even integers. For examp...
[ "assert candidate(finalSum=16) == [2, 4, 10]", "assert candidate(finalSum=300) == [2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 60]", "assert candidate(finalSum=1024) == [2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 94]", "asser...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(finalSum=16) == [2, 4, 10]", "assert candidate(finalSum=300) == [2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 60]", "assert candidate(finalSum=1024) == [2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 5...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given two 0-indexed arrays nums1 and nums2 of length n, both of wh...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given two 0-indexed arrays nums1 and nums2 of length n, both of which are permutations of [0, 1, ..., n - 1]. A...
[ "assert candidate(nums1=[7, 5, 6, 3, 4, 1, 2, 0], nums2=[3, 6, 2, 7, 0, 1, 4, 5]) == 2", "assert candidate(nums1=[10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0], nums2=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == 0", "assert candidate(nums1=[8, 7, 6, 5, 4, 3, 2, 1, 0], nums2=[0, 1, 2, 3, 4, 5, 6, 7, 8]) == 0", "assert candidate...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums1=[7, 5, 6, 3, 4, 1, 2, 0], nums2=[3, 6, 2, 7, 0, 1, 4, 5]) == 2", "assert candidate(nums1=[10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0], nums2=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == 0", "assert candidate(nums1=[8, 7, 6, 5, 4, 3, 2, 1, 0], nums2=[0, 1, 2, 3, 4, 5, 6, 7, 8]) =...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given the head of a linked list, which contains a series of intege...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given the head of a linked list, which contains a series of integers separated by 0's. The beginning and end of...
[ "assert is_same_list(candidate(head=list_node([0, 10, 20, 30, 40, 50, 0, 60, 70, 80, 90, 100, 0, 110, 120, 130, 140, 150, 0, 160, 170, 180, 190, 200, 0])), list_node([150, 400, 650, 900]))", "assert is_same_list(candidate(head=list_node([0, 100, 200, 0, 300, 400, 500, 0, 600, 700, 0])), list_node([300, 1200, 1300...
newfacade/LeetCodeDataset
{ "constraints": [ "assert is_same_list(candidate(head=list_node([0, 10, 20, 30, 40, 50, 0, 60, 70, 80, 90, 100, 0, 110, 120, 130, 140, 150, 0, 160, 170, 180, 190, 200, 0])), list_node([150, 400, 650, 900]))", "assert is_same_list(candidate(head=list_node([0, 100, 200, 0, 300, 400, 500, 0, 600, 700, 0])), lis...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven a 0-indexed integer array nums of length n and an integer k, return ...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given a 0-indexed integer array nums of length n and an integer k, return the number of pairs (i, j) such that: 0 <= i...
[ "assert candidate(nums=[13, 26, 39, 52, 65, 78, 91, 104, 117, 130], k=13) == 45", "assert candidate(nums=[8, 12, 18, 24, 30, 36, 42], k=6) == 21", "assert candidate(nums=[3, 5, 7, 11], k=1) == 6", "assert candidate(nums=[100, 200, 300, 400, 500, 600, 700, 800, 900, 1000], k=100) == 45", "assert candidate(nu...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[13, 26, 39, 52, 65, 78, 91, 104, 117, 130], k=13) == 45", "assert candidate(nums=[8, 12, 18, 24, 30, 36, 42], k=6) == 21", "assert candidate(nums=[3, 5, 7, 11], k=1) == 6", "assert candidate(nums=[100, 200, 300, 400, 500, 600, 700, 800, 900, 1000], k=100) == ...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given integers height and width which specify the dimensions of a ...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given integers height and width which specify the dimensions of a brick wall you are building. You are also giv...
[ "assert candidate(height=100, width=8, bricks=[2, 3, 5, 7]) == 220835789", "assert candidate(height=5, width=8, bricks=[2, 3, 4, 5]) == 6376", "assert candidate(height=6, width=6, bricks=[1, 5]) == 2", "assert candidate(height=7, width=10, bricks=[1, 2, 2, 3, 4]) == 462924506", "assert candidate(height=2, w...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(height=100, width=8, bricks=[2, 3, 5, 7]) == 220835789", "assert candidate(height=5, width=8, bricks=[2, 3, 4, 5]) == 6376", "assert candidate(height=6, width=6, bricks=[1, 5]) == 2", "assert candidate(height=7, width=10, bricks=[1, 2, 2, 3, 4]) == 462924506", ...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an array time where time[i] denotes the time taken by the it...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given an array time where time[i] denotes the time taken by the ith bus to complete one trip. Each bus can make...
[ "assert candidate(time=[2], totalTrips=1) == 2", "assert candidate(time=[7, 14, 21, 28, 35, 42], totalTrips=100) == 294", "assert candidate(time=[13, 26, 39, 52, 65, 78, 91, 104, 117, 130], totalTrips=20000) == 88790", "assert candidate(time=[9, 18, 27, 36, 45, 54, 63, 72, 81, 90], totalTrips=15000) == 46107"...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(time=[2], totalTrips=1) == 2", "assert candidate(time=[7, 14, 21, 28, 35, 42], totalTrips=100) == 294", "assert candidate(time=[13, 26, 39, 52, 65, 78, 91, 104, 117, 130], totalTrips=20000) == 88790", "assert candidate(time=[9, 18, 27, 36, 45, 54, 63, 72, 81, 90], ...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed 2D integer array tires where tires[i] = [fi, ri]...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 0-indexed 2D integer array tires where tires[i] = [fi, ri] indicates that the ith tire can finish its x...
[ "assert candidate(tires=[[2, 2], [3, 3], [4, 4], [5, 5], [6, 6]], changeTime=10, numLaps=25) == 190", "assert candidate(tires=[[100000, 100000], [50000, 50000], [25000, 25000], [12500, 12500], [6250, 6250]], changeTime=100000, numLaps=1000) == 106150000", "assert candidate(tires=[[1, 10], [2, 5], [3, 2]], chang...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(tires=[[2, 2], [3, 3], [4, 4], [5, 5], [6, 6]], changeTime=10, numLaps=25) == 190", "assert candidate(tires=[[100000, 100000], [50000, 50000], [25000, 25000], [12500, 12500], [6250, 6250]], changeTime=100000, numLaps=1000) == 106150000", "assert candidate(tires=[[1, 10...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an integer n representing the number of playing cards you ha...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given an integer n representing the number of playing cards you have. A house of cards meets the following cond...
[ "assert candidate(n=28) == 4", "assert candidate(n=350) == 705904", "assert candidate(n=11) == 1", "assert candidate(n=40) == 7", "assert candidate(n=496) == 22861784", "assert candidate(n=31) == 5", "assert candidate(n=495) == 22346078", "assert candidate(n=16) == 2", "assert candidate(n=25) == 4",...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=28) == 4", "assert candidate(n=350) == 705904", "assert candidate(n=11) == 1", "assert candidate(n=40) == 7", "assert candidate(n=496) == 22861784", "assert candidate(n=31) == 5", "assert candidate(n=495) == 22346078", "assert candidate(n=16) == 2...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed integer array mapping which represents the mappi...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 0-indexed integer array mapping which represents the mapping rule of a shuffled decimal system. mapping...
[ "assert candidate(mapping=[0, 9, 8, 7, 6, 5, 4, 3, 2, 1], nums=[9876543210, 8765432109, 7654321098, 6543210987, 5432109876]) == [9876543210, 8765432109, 7654321098, 6543210987, 5432109876]", "assert candidate(mapping=[0, 9, 1, 8, 2, 7, 3, 6, 4, 5], nums=[1111, 2222, 3333, 4444, 5555, 6666, 7777, 8888, 9999]) == [...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(mapping=[0, 9, 8, 7, 6, 5, 4, 3, 2, 1], nums=[9876543210, 8765432109, 7654321098, 6543210987, 5432109876]) == [9876543210, 8765432109, 7654321098, 6543210987, 5432109876]", "assert candidate(mapping=[0, 9, 1, 8, 2, 7, 3, 6, 4, 5], nums=[1111, 2222, 3333, 4444, 5555, 6666, ...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a positive integer n representing the number of nodes of a D...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a positive integer n representing the number of nodes of a Directed Acyclic Graph (DAG). The nodes are nu...
[ "assert candidate(n=14, edges=[[0, 4], [1, 4], [2, 5], [2, 6], [3, 6], [4, 7], [4, 8], [5, 9], [5, 10], [6, 10], [6, 11], [7, 12], [8, 12], [9, 13], [10, 13], [11, 13]]) == [[], [], [], [], [0, 1], [2], [2, 3], [0, 1, 4], [0, 1, 4], [2, 5], [2, 3, 5, 6], [2, 3, 6], [0, 1, 4, 7, 8], [2, 3, 5, 6, 9, 10, 11]]", "ass...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=14, edges=[[0, 4], [1, 4], [2, 5], [2, 6], [3, 6], [4, 7], [4, 8], [5, 9], [5, 10], [6, 10], [6, 11], [7, 12], [8, 12], [9, 13], [10, 13], [11, 13]]) == [[], [], [], [], [0, 1], [2], [2, 3], [0, 1, 4], [0, 1, 4], [2, 5], [2, 3, 5, 6], [2, 3, 6], [0, 1, 4, 7, 8], [2, 3, 5, 6,...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an integer array nums and an integer k. Append k unique posi...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given an integer array nums and an integer k. Append k unique positive integers that do not appear in nums to n...
[ "assert candidate(nums=[1000000000], k=100000) == 5000050000", "assert candidate(nums=[1], k=1000000) == 500001500000", "assert candidate(nums=[3, 5, 7, 9, 11], k=10) == 85", "assert candidate(nums=[1000000, 2000000, 3000000, 4000000, 5000000], k=100000) == 5000050000", "assert candidate(nums=[10, 20, 30, 4...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[1000000000], k=100000) == 5000050000", "assert candidate(nums=[1], k=1000000) == 500001500000", "assert candidate(nums=[3, 5, 7, 9, 11], k=10) == 85", "assert candidate(nums=[1000000, 2000000, 3000000, 4000000, 5000000], k=100000) == 5000050000", "assert ...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 2D integer array descriptions where descriptions[i] = [par...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 2D integer array descriptions where descriptions[i] = [parenti, childi, isLefti] indicates that parenti...
[ "assert is_same_tree(candidate(descriptions=[[99, 98, 1], [98, 97, 1], [97, 96, 1], [96, 95, 1], [95, 94, 1], [94, 93, 1], [93, 92, 1], [92, 91, 1], [91, 90, 1], [90, 89, 1], [89, 88, 1], [88, 87, 1], [87, 86, 1], [86, 85, 1]]), tree_node([99, 98, None, 97, None, 96, None, 95, None, 94, None, 93, None, 92, None, 91...
newfacade/LeetCodeDataset
{ "constraints": [ "assert is_same_tree(candidate(descriptions=[[99, 98, 1], [98, 97, 1], [97, 96, 1], [96, 95, 1], [95, 94, 1], [94, 93, 1], [93, 92, 1], [92, 91, 1], [91, 90, 1], [90, 89, 1], [89, 88, 1], [88, 87, 1], [87, 86, 1], [86, 85, 1]]), tree_node([99, 98, None, 97, None, 96, None, 95, None, 94, None, 9...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nThere is an n x n 0-indexed grid with some artifacts buried in it. You are...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: There is an n x n 0-indexed grid with some artifacts buried in it. You are given the integer n and a 0-indexed 2D integ...
[ "assert candidate(n=10, artifacts=[[0, 0, 2, 2], [3, 3, 5, 5], [6, 6, 8, 8], [7, 7, 9, 9]], dig=[[0, 0], [0, 1], [0, 2], [1, 0], [1, 1], [1, 2], [2, 0], [2, 1], [2, 2], [3, 3], [3, 4], [3, 5], [4, 3], [4, 4], [4, 5], [5, 3], [5, 4], [5, 5], [6, 6], [6, 7], [6, 8], [7, 6], [7, 7], [7, 8], [8, 6], [8, 7], [8, 8], [7,...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=10, artifacts=[[0, 0, 2, 2], [3, 3, 5, 5], [6, 6, 8, 8], [7, 7, 9, 9]], dig=[[0, 0], [0, 1], [0, 2], [1, 0], [1, 1], [1, 2], [2, 0], [2, 1], [2, 2], [3, 3], [3, 4], [3, 5], [4, 3], [4, 4], [4, 5], [5, 3], [5, 4], [5, 5], [6, 6], [6, 7], [6, 8], [7, 6], [7, 7], [7, 8], [8, 6]...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed integer array nums representing the contents of ...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 0-indexed integer array nums representing the contents of a pile, where nums[0] is the topmost element ...
[ "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], k=100) == 10", "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], k=12) == 13", "assert candidate(nums=[7, 7, 7, 7, 7, 7, 7, 7, 7, 7], k=10) == 7", "assert candidate(nums=[10, 9, 8, 7, 6, 5, 4, 3, 2, 1], k=1) == 9", "assert can...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], k=100) == 10", "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], k=12) == 13", "assert candidate(nums=[7, 7, 7, 7, 7, 7, 7, 7, 7, 7], k=10) == 7", "assert candidate(nums=[10, 9, 8, 7, 6, 5, 4, 3, 2, 1]...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an integer n denoting the number of nodes of a weighted dire...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given an integer n denoting the number of nodes of a weighted directed graph. The nodes are numbered from 0 to ...
[ "assert candidate(n=20, edges=[[0, 1, 1], [1, 2, 2], [2, 3, 3], [3, 4, 4], [4, 5, 5], [5, 6, 6], [6, 7, 7], [7, 8, 8], [8, 9, 9], [9, 10, 10], [10, 11, 11], [11, 12, 12], [12, 13, 13], [13, 14, 14], [14, 15, 15], [15, 16, 16], [16, 17, 17], [17, 18, 18], [18, 19, 19], [0, 19, 1]], src1=0, src2=10, dest=19) == 136",...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=20, edges=[[0, 1, 1], [1, 2, 2], [2, 3, 3], [3, 4, 4], [4, 5, 5], [5, 6, 6], [6, 7, 7], [7, 8, 8], [8, 9, 9], [9, 10, 10], [10, 11, 11], [11, 12, 12], [12, 13, 13], [13, 14, 14], [14, 15, 15], [15, 16, 16], [16, 17, 17], [17, 18, 18], [18, 19, 19], [0, 19, 1]], src1=0, src2=...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a positive integer n representing the number of nodes in a c...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a positive integer n representing the number of nodes in a connected undirected graph containing exactly ...
[ "assert candidate(n=18, edges=[[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10], [10, 11], [11, 12], [12, 13], [13, 14], [14, 15], [15, 16], [16, 17], [17, 0]]) == [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]", "assert candidate(n=12, edges=[[0, 1], [1, 2], [2, 3], [3, 4],...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=18, edges=[[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10], [10, 11], [11, 12], [12, 13], [13, 14], [14, 15], [15, 16], [16, 17], [17, 0]]) == [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]", "assert candidate(n=12, edges=[[0, 1], ...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed string text and another 0-indexed string pattern...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 0-indexed string text and another 0-indexed string pattern of length 2, both of which consist of only l...
[ "assert candidate(text='zzzzz', pattern='zz') == 15", "assert candidate(text='mnopqr', pattern='pq') == 2", "assert candidate(text='zzzz', pattern='zz') == 10", "assert candidate(text='abxyabxyabxy', pattern='bx') == 9", "assert candidate(text='zzyzxzyzxzy', pattern='yz') == 12", "assert candidate(text='a...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(text='zzzzz', pattern='zz') == 15", "assert candidate(text='mnopqr', pattern='pq') == 2", "assert candidate(text='zzzz', pattern='zz') == 10", "assert candidate(text='abxyabxyabxy', pattern='bx') == 9", "assert candidate(text='zzyzxzyzxzy', pattern='yz') == 12"...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed binary string floor, which represents the colors...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 0-indexed binary string floor, which represents the colors of tiles on a floor: floor[i] = '0' denotes...
[ "assert candidate(floor='000101001010100110010010001000101010010101010101', numCarpets=15, carpetLen=3) == 0", "assert candidate(floor='10101010101010101010', numCarpets=3, carpetLen=4) == 4", "assert candidate(floor='10001000100010001000100010001000', numCarpets=9, carpetLen=3) == 0", "assert candidate(floor...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(floor='000101001010100110010010001000101010010101010101', numCarpets=15, carpetLen=3) == 0", "assert candidate(floor='10101010101010101010', numCarpets=3, carpetLen=4) == 4", "assert candidate(floor='10001000100010001000100010001000', numCarpets=9, carpetLen=3) == 0", ...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nThere are n cars on an infinitely long road. The cars are numbered from 0 ...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: There are n cars on an infinitely long road. The cars are numbered from 0 to n - 1 from left to right and each car is p...
[ "assert candidate(directions='RSLR') == 2", "assert candidate(directions='LLLLLLRRRRRRLLLLRRRRRR') == 10", "assert candidate(directions='SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS') == 0", "assert candidate(directions='LLLSRLRLRLRLRLL') == 11", "assert candidate(directions='RSLRS') == 3", "assert ca...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(directions='RSLR') == 2", "assert candidate(directions='LLLLLLRRRRRRLLLLRRRRRR') == 10", "assert candidate(directions='SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS') == 0", "assert candidate(directions='LLLSRLRLRLRLRLL') == 11", "assert candidate(directions...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nAlice and Bob are opponents in an archery competition. The competition has...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Alice and Bob are opponents in an archery competition. The competition has set the following rules: Alice first shoots...
[ "assert candidate(numArrows=60, aliceArrows=[3, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == [0, 0, 2, 3, 4, 0, 6, 7, 8, 9, 10, 11]", "assert candidate(numArrows=50, aliceArrows=[0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5]) == [2, 0, 0, 0, 6, 6, 6, 6, 6, 6, 6, 6]", "assert candidate(numArrows=25, aliceArrows=[4, 3, 5, 3, 4, 5...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(numArrows=60, aliceArrows=[3, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == [0, 0, 2, 3, 4, 0, 6, 7, 8, 9, 10, 11]", "assert candidate(numArrows=50, aliceArrows=[0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5]) == [2, 0, 0, 0, 6, 6, 6, 6, 6, 6, 6, 6]", "assert candidate(numArrows=25, alic...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed string s. You are also given a 0-indexed string ...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 0-indexed string s. You are also given a 0-indexed string queryCharacters of length k and a 0-indexed a...
[ "assert candidate(s='ppppqqqqrrrrssss', queryCharacters='ttttuuuuvvvv', queryIndices=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]) == [4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4]", "assert candidate(s='abcdefghijklmnopqrstuvwxyz', queryCharacters='abcdefghijklmnopqrstuvwxyz', queryIndices=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9,...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='ppppqqqqrrrrssss', queryCharacters='ttttuuuuvvvv', queryIndices=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]) == [4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4]", "assert candidate(s='abcdefghijklmnopqrstuvwxyz', queryCharacters='abcdefghijklmnopqrstuvwxyz', queryIndices=[0, 1, ...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are playing a game that has n levels numbered from 0 to n - 1. You are...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are playing a game that has n levels numbered from 0 to n - 1. You are given a 0-indexed integer array damage where...
[ "assert candidate(damage=[100, 200, 300, 400, 500], armor=150) == 1351", "assert candidate(damage=[1000, 900, 800, 700, 600, 500, 400, 300, 200, 100], armor=1000) == 4501", "assert candidate(damage=[1, 1, 2, 2, 3, 3, 4, 4, 5, 5], armor=3) == 28", "assert candidate(damage=[1, 3, 5, 7, 9, 11, 13, 15, 17, 19], a...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(damage=[100, 200, 300, 400, 500], armor=150) == 1351", "assert candidate(damage=[1000, 900, 800, 700, 600, 500, 400, 300, 200, 100], armor=1000) == 4501", "assert candidate(damage=[1, 1, 2, 2, 3, 3, 4, 4, 5, 5], armor=3) == 28", "assert candidate(damage=[1, 3, 5, 7...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed integer array nums. The array nums is beautiful ...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 0-indexed integer array nums. The array nums is beautiful if: nums.length is even. nums[i] != nums[i +...
[ "assert candidate(nums=[1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == 1", "assert candidate(nums=[1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2]) == 1", "assert candidate(nums=[1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6]) == 6", "assert candidate(nums=[1, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == 1", "assert candidate(nums=[1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2]) == 1", "assert candidate(nums=[1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6]) == 6", ...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven an integer array queries and a positive integer intLength, return an...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given an integer array queries and a positive integer intLength, return an array answer where answer[i] is either the q...
[ "assert candidate(queries=[50000, 100000, 150000, 200000, 250000, 300000, 350000, 400000], intLength=13) == [1049999999401, 1099999999901, 1149999999411, 1199999999911, 1249999999421, 1299999999921, 1349999999431, 1399999999931]", "assert candidate(queries=[500000, 500001, 500002, 500003, 500004, 500005], intLeng...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(queries=[50000, 100000, 150000, 200000, 250000, 300000, 350000, 400000], intLength=13) == [1049999999401, 1099999999901, 1149999999411, 1199999999911, 1249999999421, 1299999999921, 1349999999431, 1399999999931]", "assert candidate(queries=[500000, 500001, 500002, 500003, 5...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nThere are n piles of coins on a table. Each pile consists of a positive nu...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: There are n piles of coins on a table. Each pile consists of a positive number of coins of assorted denominations. In o...
[ "assert candidate(piles=[[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [10, 9, 8, 7, 6, 5, 4, 3, 2, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]], k=15) == 95", "assert candidate(piles=[[100, 200, 300], [50, 60, 70, 80], [10, 20, 30, 40, 50]], k=15) == 1010", "assert candidate(piles=[[1, 2, 3], [4, 5, 6, 7], [8, 9, 10, 11, 12], [13, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(piles=[[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [10, 9, 8, 7, 6, 5, 4, 3, 2, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]], k=15) == 95", "assert candidate(piles=[[100, 200, 300], [50, 60, 70, 80], [10, 20, 30, 40, 50]], k=15) == 1010", "assert candidate(piles=[[1, 2, 3], [4, 5, 6, 7], ...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed integer array nums of length n.\nThe sum score o...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 0-indexed integer array nums of length n. The sum score of nums at an index i where 0 <= i < n is the m...
[ "assert candidate(nums=[1, 2, 3, 4, 5, -5, -4, -3, -2, -1]) == 15", "assert candidate(nums=[-1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1]) == 0", "assert candidate(nums=[5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5]) == 15", "assert candidate(nums=[10, 20, -30, 40, -50, 60, -70, 80, -90, 100, -110, 120, -130, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[1, 2, 3, 4, 5, -5, -4, -3, -2, -1]) == 15", "assert candidate(nums=[-1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1]) == 0", "assert candidate(nums=[5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5]) == 15", "assert candidate(nums=[10, 20, -30, 40, -50, 60, -70, 80, ...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed binary string s which represents the types of bu...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 0-indexed binary string s which represents the types of buildings along a street where: s[i] = '0' den...
[ "assert candidate(s='001001001') == 24", "assert candidate(s='1001001') == 12", "assert candidate(s='10101') == 5", "assert candidate(s='11100') == 0", "assert candidate(s='11111111111111111111111111111111') == 0", "assert candidate(s='10100101001010010100101001010010') == 1302", "assert candidate(s='00...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='001001001') == 24", "assert candidate(s='1001001') == 12", "assert candidate(s='10101') == 5", "assert candidate(s='11100') == 0", "assert candidate(s='11111111111111111111111111111111') == 0", "assert candidate(s='10100101001010010100101001010010') == 1...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are building a string s of length n one character at a time, prependin...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are building a string s of length n one character at a time, prepending each new character to the front of the stri...
[ "assert candidate(s='racecar') == 8", "assert candidate(s='zxyzyxzyxzyxzyxzyxzyxzyx') == 31", "assert candidate(s='aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz') == 53", "assert candidate(s='aabbcc') == 7", "assert candidate(s='xyzxyzxyz') == 18", "assert candidate(s='banana') == 6", "assert can...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='racecar') == 8", "assert candidate(s='zxyzyxzyxzyxzyxzyxzyxzyx') == 31", "assert candidate(s='aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz') == 53", "assert candidate(s='aabbcc') == 7", "assert candidate(s='xyzxyzxyz') == 18", "assert candidate(s...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an integer array matches where matches[i] = [winneri, loseri...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given an integer array matches where matches[i] = [winneri, loseri] indicates that the player winneri defeated ...
[ "assert candidate(matches=[[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]]) == [[1, 3, 5, 7, 9], [2, 4, 6, 8, 10]]", "assert candidate(matches=[[100000, 1], [99999, 2], [99998, 3], [99997, 4], [99996, 5]]) == [[99996, 99997, 99998, 99999, 100000], [1, 2, 3, 4, 5]]", "assert candidate(matches=[[1, 2], [2, 3], [3, 4], [...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(matches=[[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]]) == [[1, 3, 5, 7, 9], [2, 4, 6, 8, 10]]", "assert candidate(matches=[[100000, 1], [99999, 2], [99998, 3], [99997, 4], [99996, 5]]) == [[99996, 99997, 99998, 99999, 100000], [1, 2, 3, 4, 5]]", "assert candidate(matches=[...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed integer array candies. Each element in the array...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 0-indexed integer array candies. Each element in the array denotes a pile of candies of size candies[i]...
[ "assert candidate(candies=[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39], k=100) == 3", "assert candidate(candies=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], k=35) == 1", "assert candidate(candies=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], k=55) == 1", "assert candidate(candies=[7, 7, 7, 7, 7], k=5) =...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(candies=[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39], k=100) == 3", "assert candidate(candies=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], k=35) == 1", "assert candidate(candies=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], k=55) == 1", "assert candidate(cand...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an array of non-negative integers nums and an integer k. In ...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given an array of non-negative integers nums and an integer k. In one operation, you may choose any element fro...
[ "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], k=15) == 235146240", "assert candidate(nums=[10, 20, 30, 40, 50], k=30) == 54000000", "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], k=50) == 105099888", "assert candidate(nums=[100, 100, 100, 100, 100, 100, 100, 100, 100, 100], k=500000) == 249...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], k=15) == 235146240", "assert candidate(nums=[10, 20, 30, 40, 50], k=30) == 54000000", "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], k=50) == 105099888", "assert candidate(nums=[100, 100, 100, 100, 100, 100, 100, 100, ...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nAlice is a caretaker of n gardens and she wants to plant flowers to maximi...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Alice is a caretaker of n gardens and she wants to plant flowers to maximize the total beauty of all her gardens. You a...
[ "assert candidate(flowers=[1, 1, 1, 1], newFlowers=15, target=3, full=5, partial=3) == 21", "assert candidate(flowers=[50, 40, 30, 20, 10, 0, 0, 0, 0, 0], newFlowers=150, target=35, full=100, partial=20) == 940", "assert candidate(flowers=[100, 200, 300, 400, 500, 600, 700, 800, 900, 1000], newFlowers=3000, tar...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(flowers=[1, 1, 1, 1], newFlowers=15, target=3, full=5, partial=3) == 21", "assert candidate(flowers=[50, 40, 30, 20, 10, 0, 0, 0, 0, 0], newFlowers=150, target=35, full=100, partial=20) == 940", "assert candidate(flowers=[100, 200, 300, 400, 500, 600, 700, 800, 900, 10...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an integer total indicating the amount of money you have. Yo...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given an integer total indicating the amount of money you have. You are also given two integers cost1 and cost2...
[ "assert candidate(total=100000, cost1=33333, cost2=33333) == 10", "assert candidate(total=300, cost1=50, cost2=25) == 49", "assert candidate(total=1000, cost1=333, cost2=111) == 22", "assert candidate(total=800, cost1=120, cost2=30) == 105", "assert candidate(total=1000000, cost1=1, cost2=1000000) == 100000...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(total=100000, cost1=33333, cost2=33333) == 10", "assert candidate(total=300, cost1=50, cost2=25) == 49", "assert candidate(total=1000, cost1=333, cost2=111) == 22", "assert candidate(total=800, cost1=120, cost2=30) == 105", "assert candidate(total=1000000, cost...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nThere is an undirected graph with n nodes, numbered from 0 to n - 1.\nYou ...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: There is an undirected graph with n nodes, numbered from 0 to n - 1. You are given a 0-indexed integer array scores of ...
[ "assert candidate(scores=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150], edges=[[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10], [10, 11], [11, 12], [12, 13], [13, 14]]) == 540", "assert candidate(scores=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], edges=[[0, 1], [1, 2], [2...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(scores=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150], edges=[[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10], [10, 11], [11, 12], [12, 13], [13, 14]]) == 540", "assert candidate(scores=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], ed...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed integer array tasks, where tasks[i] represents t...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 0-indexed integer array tasks, where tasks[i] represents the difficulty level of a task. In each round,...
[ "assert candidate(tasks=[7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7]) == 7", "assert candidate(tasks=[1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]) == 16", "assert candidate(tasks=[3, 3, 3, 4, 4, 4, 4...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(tasks=[7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7]) == 7", "assert candidate(tasks=[1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]) == 16", "assert candidate(t...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 2D integer array grid of size m x n, where each cell conta...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 2D integer array grid of size m x n, where each cell contains a positive integer. A cornered path is de...
[ "assert candidate(grid=[[4, 8, 16, 32, 64, 128, 256], [3, 6, 12, 24, 48, 96, 192], [5, 10, 20, 40, 80, 160, 320], [7, 14, 28, 56, 112, 224, 448]]) == 7", "assert candidate(grid=[[1000, 1000, 1000], [1000, 1000, 1000], [1000, 1000, 1000]]) == 15", "assert candidate(grid=[[8, 12, 15, 25, 20, 5], [4, 16, 40, 100, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(grid=[[4, 8, 16, 32, 64, 128, 256], [3, 6, 12, 24, 48, 96, 192], [5, 10, 20, 40, 80, 160, 320], [7, 14, 28, 56, 112, 224, 448]]) == 7", "assert candidate(grid=[[1000, 1000, 1000], [1000, 1000, 1000], [1000, 1000, 1000]]) == 15", "assert candidate(grid=[[8, 12, 15, 25, ...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a tree (i.e. a connected, undirected graph that has no cycle...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a tree (i.e. a connected, undirected graph that has no cycles) rooted at node 0 consisting of n nodes num...
[ "assert candidate(parent=[-1, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14], s='aabbaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz') == 5", "assert candidate(parent=[-1, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6], s='aabbaaccddcceeddf...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(parent=[-1, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14], s='aabbaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz') == 5", "assert candidate(parent=[-1, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nA series of highways connect n cities numbered from 0 to n - 1. You are gi...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: A series of highways connect n cities numbered from 0 to n - 1. You are given a 2D integer array highways where highway...
[ "assert candidate(n=10, highways=[[0, 1, 10], [1, 2, 20], [2, 3, 30], [3, 4, 40], [4, 5, 50], [5, 6, 60], [6, 7, 70], [7, 8, 80], [8, 9, 90], [9, 0, 100], [0, 2, 5], [1, 3, 15], [2, 4, 25], [3, 5, 35], [4, 6, 45], [5, 7, 55], [6, 8, 65], [7, 9, 75], [8, 0, 85], [9, 1, 95]], k=5) == 430", "assert candidate(n=7, hi...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=10, highways=[[0, 1, 10], [1, 2, 20], [2, 3, 30], [3, 4, 40], [4, 5, 50], [5, 6, 60], [6, 7, 70], [7, 8, 80], [8, 9, 90], [9, 0, 100], [0, 2, 5], [1, 3, 15], [2, 4, 25], [3, 5, 35], [4, 6, 45], [5, 7, 55], [6, 8, 65], [7, 9, 75], [8, 0, 85], [9, 1, 95]], k=5) == 430", "a...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven a 2D integer array circles where circles[i] = [xi, yi, ri] represent...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given a 2D integer array circles where circles[i] = [xi, yi, ri] represents the center (xi, yi) and radius ri of the it...
[ "assert candidate(circles=[[1, 1, 1]]) == 5", "assert candidate(circles=[[10, 10, 1], [20, 20, 1], [30, 30, 1], [40, 40, 1], [50, 50, 1], [60, 60, 1], [70, 70, 1], [80, 80, 1], [90, 90, 1], [10, 90, 1], [90, 10, 1]]) == 55", "assert candidate(circles=[[1, 50, 20], [99, 50, 20], [50, 1, 20], [50, 99, 20], [50, 5...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(circles=[[1, 1, 1]]) == 5", "assert candidate(circles=[[10, 10, 1], [20, 20, 1], [30, 30, 1], [40, 40, 1], [50, 50, 1], [60, 60, 1], [70, 70, 1], [80, 80, 1], [90, 90, 1], [10, 90, 1], [90, 10, 1]]) == 55", "assert candidate(circles=[[1, 50, 20], [99, 50, 20], [50, 1, ...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 2D integer array rectangles where rectangles[i] = [li, hi]...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 2D integer array rectangles where rectangles[i] = [li, hi] indicates that ith rectangle has a length of...
[ "assert candidate(rectangles=[[500000000, 100], [500000001, 99], [500000002, 98], [500000003, 97], [500000004, 96]], points=[[500000000, 99], [500000001, 98], [500000002, 97]]) == [2, 2, 2]", "assert candidate(rectangles=[[1, 100], [1, 99], [1, 98], [1, 97], [1, 96], [1, 95]], points=[[1, 100], [2, 99], [3, 98], ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(rectangles=[[500000000, 100], [500000001, 99], [500000002, 98], [500000003, 97], [500000004, 96]], points=[[500000000, 99], [500000001, 98], [500000002, 97]]) == [2, 2, 2]", "assert candidate(rectangles=[[1, 100], [1, 99], [1, 98], [1, 97], [1, 96], [1, 95]], points=[[1, 1...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed 2D integer array flowers, where flowers[i] = [st...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 0-indexed 2D integer array flowers, where flowers[i] = [starti, endi] means the ith flower will be in f...
[ "assert candidate(flowers=[[1, 100], [10, 90], [20, 80], [30, 70], [40, 60], [50, 50]], people=[1, 50, 100, 150]) == [1, 6, 1, 0]", "assert candidate(flowers=[[1, 2], [3, 4], [5, 6], [7, 8], [9, 10], [11, 12], [13, 14], [15, 16], [17, 18], [19, 20]], people=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(flowers=[[1, 100], [10, 90], [20, 80], [30, 70], [40, 60], [50, 50]], people=[1, 50, 100, 150]) == [1, 6, 1, 0]", "assert candidate(flowers=[[1, 2], [3, 4], [5, 6], [7, 8], [9, 10], [11, 12], [13, 14], [15, 16], [17, 18], [19, 20]], people=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed integer array nums of length n.\nThe average dif...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 0-indexed integer array nums of length n. The average difference of the index i is the absolute differe...
[ "assert candidate(nums=[1, 0, 0, 0, 0]) == 1", "assert candidate(nums=[100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 0]) == 0", "assert candidate(nums=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) == 0", "assert candidate(nums=[100000, 0, 100000, 0, 100000,...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[1, 0, 0, 0, 0]) == 1", "assert candidate(nums=[100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 0]) == 0", "assert candidate(nums=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) == 0", "assert candidate(nums=[10...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given two integers m and n representing a 0-indexed m x n grid. Yo...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given two integers m and n representing a 0-indexed m x n grid. You are also given two 2D integer arrays guards...
[ "assert candidate(m=12, n=10, guards=[[2, 2], [2, 3], [3, 2], [3, 3], [5, 5], [6, 6], [7, 7], [8, 8]], walls=[[1, 1], [1, 2], [1, 3], [1, 4], [4, 4], [5, 4], [6, 4], [7, 4], [8, 4], [9, 9]]) == 30", "assert candidate(m=20, n=20, guards=[[1, 1], [2, 2], [3, 3], [4, 4], [5, 5]], walls=[[6, 6], [7, 7], [8, 8], [9, 9...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(m=12, n=10, guards=[[2, 2], [2, 3], [3, 2], [3, 3], [5, 5], [6, 6], [7, 7], [8, 8]], walls=[[1, 1], [1, 2], [1, 3], [1, 4], [4, 4], [5, 4], [6, 4], [7, 4], [8, 4], [9, 9]]) == 30", "assert candidate(m=20, n=20, guards=[[1, 1], [2, 2], [3, 3], [4, 4], [5, 5]], walls=[[6, 6]...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an integer array cards where cards[i] represents the value o...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given an integer array cards where cards[i] represents the value of the ith card. A pair of cards are matching ...
[ "assert candidate(cards=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]) == 21"...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(cards=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven an integer array nums and two integers k and p, return the number of...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given an integer array nums and two integers k and p, return the number of distinct subarrays, which have at most k ele...
[ "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 200], k=5, p=5) == 210", "assert candidate(nums=[19, 19, 19, 19, 19], k=3, p=19) == 3", "assert candidate(nums=[200, 199, 198, 197, 196, 195, 194, 193, 192, 191, 190, 189, 188, 187, 186, 185, 184, 183, 182, 181], k=15, p=...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 200], k=5, p=5) == 210", "assert candidate(nums=[19, 19, 19, 19, 19], k=3, p=19) == 3", "assert candidate(nums=[200, 199, 198, 197, 196, 195, 194, 193, 192, 191, 190, 189, 188, 187, 186, 185, 184,...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed integer array nums. In one operation, you can:\n...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 0-indexed integer array nums. In one operation, you can: Choose an index i in the range 0 <= i < nums....
[ "assert candidate(nums=[100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100]) == 370", "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == 50", "assert candidate(nums=[500, 400, 300, 200, 100, 0, 100, 200, 300, 4...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100]) == 370", "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == 50", "assert candidate(nums=[500, 400, 300, 200,...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven the root of a binary tree, return the number of nodes where the valu...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given the root of a binary tree, return the number of nodes where the value of the node is equal to the average of the ...
[ "assert candidate(root=tree_node([8, 5, 9, 4, 6, 8, 10, None, None, None, None, 7, 11, None, None])) == 8", "assert candidate(root=tree_node([5, 3, 7, 2, 4, 6, 8, 1, None, None, None, None, None, None, 9])) == 7", "assert candidate(root=tree_node([20, 10, 30, 5, 15, 25, 35, 1, 7, 13, 17, 23, 27, 33, 37])) == 12...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(root=tree_node([8, 5, 9, 4, 6, 8, 10, None, None, None, None, 7, 11, None, None])) == 8", "assert candidate(root=tree_node([5, 3, 7, 2, 4, 6, 8, 1, None, None, None, None, None, None, 9])) == 7", "assert candidate(root=tree_node([20, 10, 30, 5, 15, 25, 35, 1, 7, 13, 17...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nAlice is texting Bob using her phone. The mapping of digits to letters is ...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Alice is texting Bob using her phone. The mapping of digits to letters is shown in the figure below. In order to add a...
[ "assert candidate(pressedKeys='7777') == 8", "assert candidate(pressedKeys='888') == 4", "assert candidate(pressedKeys='6666666') == 44", "assert candidate(pressedKeys='55555') == 13", "assert candidate(pressedKeys='9999999') == 56", "assert candidate(pressedKeys='44444') == 13", "assert candidate(press...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(pressedKeys='7777') == 8", "assert candidate(pressedKeys='888') == 4", "assert candidate(pressedKeys='6666666') == 44", "assert candidate(pressedKeys='55555') == 13", "assert candidate(pressedKeys='9999999') == 56", "assert candidate(pressedKeys='44444') ==...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nA parentheses string is a non-empty string consisting only of '(' and ')'....
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: A parentheses string is a non-empty string consisting only of '(' and ')'. It is valid if any of the following conditio...
[ "assert candidate(grid=[['(', '(', ')', '(', ')'], [')', '(', '(', ')', '('], [')', '(', ')', '(', ')'], [')', '(', '(', ')', '('], [')', '(', ')', '(', ')']]) == False", "assert candidate(grid=[['(', '(', '(', '(', '('], [')', '(', ')', '(', ')'], ['(', '(', ')', '(', ')'], [')', '(', ')', '(', ')'], [')', '(', ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(grid=[['(', '(', ')', '(', ')'], [')', '(', '(', ')', '('], [')', '(', ')', '(', ')'], [')', '(', '(', ')', '('], [')', '(', ')', '(', ')']]) == False", "assert candidate(grid=[['(', '(', '(', '(', '('], [')', '(', ')', '(', ')'], ['(', '(', ')', '(', ')'], [')', '(', ')',...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou have a keypad with 9 buttons, numbered from 1 to 9, each mapped to low...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You have a keypad with 9 buttons, numbered from 1 to 9, each mapped to lowercase English letters. You can choose which ...
[ "assert candidate(s='xylophoneisamusicalinstrument') == 37", "assert candidate(s='thequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydog') == 120", "assert candidate(s='mississippi') == 11", "assert candidate(s='aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzzz') == 104", "assert candid...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='xylophoneisamusicalinstrument') == 37", "assert candidate(s='thequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydog') == 120", "assert candidate(s='mississippi') == 11", "assert candidate(s='aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzzz'...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed integer array nums of length n.\nnums contains a...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 0-indexed integer array nums of length n. nums contains a valid split at index i if the following are t...
[ "assert candidate(nums=[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) == 9", "assert candidate(nums=[-10, 20, -30, 40, -50, 60, -70, 80, -90, 100]) == 2", "assert candidate(nums=[10, -10, 20, -20, 30, -30, 40, -40, 50, -50]) == 9", "assert candidate(nums=[10000, 20000, 30000, -60000, 40000, 50000, -100000, 60000, 70000, 800...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) == 9", "assert candidate(nums=[-10, 20, -30, 40, -50, 60, -70, 80, -90, 100]) == 2", "assert candidate(nums=[10, -10, 20, -20, 30, -30, 40, -40, 50, -50]) == 9", "assert candidate(nums=[10000, 20000, 30000, -60000, 40000, 50000,...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 2D integer array tiles where tiles[i] = [li, ri] represent...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 2D integer array tiles where tiles[i] = [li, ri] represents that every tile j in the range li <= j <= r...
[ "assert candidate(tiles=[[1, 1000000000]], carpetLen=500000000) == 500000000", "assert candidate(tiles=[[1, 3], [5, 7], [9, 11]], carpetLen=10) == 8", "assert candidate(tiles=[[5, 5], [6, 6], [7, 7], [8, 8], [9, 9]], carpetLen=3) == 3", "assert candidate(tiles=[[1, 2], [3, 4], [5, 6], [7, 8], [9, 10], [11, 12...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(tiles=[[1, 1000000000]], carpetLen=500000000) == 500000000", "assert candidate(tiles=[[1, 3], [5, 7], [9, 11]], carpetLen=10) == 8", "assert candidate(tiles=[[5, 5], [6, 6], [7, 7], [8, 8], [9, 9]], carpetLen=3) == 3", "assert candidate(tiles=[[1, 2], [3, 4], [5, 6...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nAlice manages a company and has rented some floors of a building as office...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Alice manages a company and has rented some floors of a building as office space. Alice has decided some of these floor...
[ "assert candidate(bottom=1, top=100, special=[10, 20, 30, 40, 50, 60, 70, 80, 90]) == 10", "assert candidate(bottom=10, top=20, special=[12, 15, 18]) == 2", "assert candidate(bottom=5, top=50, special=[10, 15, 20, 25, 30, 35, 40, 45]) == 5", "assert candidate(bottom=10, top=50, special=[20, 30, 40]) == 10", ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(bottom=1, top=100, special=[10, 20, 30, 40, 50, 60, 70, 80, 90]) == 10", "assert candidate(bottom=10, top=20, special=[12, 15, 18]) == 2", "assert candidate(bottom=5, top=50, special=[10, 15, 20, 25, 30, 35, 40, 45]) == 5", "assert candidate(bottom=10, top=50, spec...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nThe bitwise AND of an array nums is the bitwise AND of all integers in num...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: The bitwise AND of an array nums is the bitwise AND of all integers in nums. For example, for nums = [1, 5, 3], the bi...
[ "assert candidate(candidates=[1073741823, 1073741822, 1073741821, 1073741820, 1073741819, 1073741818, 1073741817, 1073741816, 1073741815, 1073741814, 1073741813, 1073741812, 1073741811, 1073741810, 1073741809]) == 15", "assert candidate(candidates=[983040, 983041, 983042, 983043, 983044, 983045, 983046, 983047, 9...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(candidates=[1073741823, 1073741822, 1073741821, 1073741820, 1073741819, 1073741818, 1073741817, 1073741816, 1073741815, 1073741814, 1073741813, 1073741812, 1073741811, 1073741810, 1073741809]) == 15", "assert candidate(candidates=[983040, 983041, 983042, 983043, 983044, 98...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a positive integer n representing the number of nodes in a t...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a positive integer n representing the number of nodes in a tree, numbered from 0 to n - 1 (inclusive). Yo...
[ "assert candidate(n=20, edges=[[0, 1], [0, 2], [1, 3], [1, 4], [2, 5], [2, 6], [3, 7], [3, 8], [4, 9], [4, 10], [5, 11], [5, 12], [6, 13], [6, 14], [7, 15], [7, 16], [8, 17], [8, 18], [9, 19]], query=[[15, 19, 0], [11, 18, 2], [7, 14, 3], [10, 12, 4], [13, 17, 5]]) == [1, 2, 3, 4, 2]", "assert candidate(n=5, edge...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=20, edges=[[0, 1], [0, 2], [1, 3], [1, 4], [2, 5], [2, 6], [3, 7], [3, 8], [4, 9], [4, 10], [5, 11], [5, 12], [6, 13], [6, 14], [7, 15], [7, 16], [8, 17], [8, 18], [9, 19]], query=[[15, 19, 0], [11, 18, 2], [7, 14, 3], [10, 12, 4], [13, 17, 5]]) == [1, 2, 3, 4, 2]", "ass...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou have n bags numbered from 0 to n - 1. You are given two 0-indexed inte...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You have n bags numbered from 0 to n - 1. You are given two 0-indexed integer arrays capacity and rocks. The ith bag ca...
[ "assert candidate(capacity=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], rocks=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], additionalRocks=45) == 10", "assert candidate(capacity=[1, 2, 3, 4, 5], rocks=[0, 1, 2, 3, 4], additionalRocks=10) == 5", "assert candidate(capacity=[10, 10, 10, 10, 10], rocks=[0, 0, 0, 0, 0], additionalRocks=45) ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(capacity=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], rocks=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], additionalRocks=45) == 10", "assert candidate(capacity=[1, 2, 3, 4, 5], rocks=[0, 1, 2, 3, 4], additionalRocks=10) == 5", "assert candidate(capacity=[10, 10, 10, 10, 10], rocks=[0, 0, 0, 0,...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 2D integer array stockPrices where stockPrices[i] = [dayi,...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 2D integer array stockPrices where stockPrices[i] = [dayi, pricei] indicates the price of the stock on ...
[ "assert candidate(stockPrices=[[1, 5], [2, 5], [3, 5], [4, 6], [5, 6], [6, 6], [7, 7], [8, 7], [9, 7], [10, 8]]) == 6", "assert candidate(stockPrices=[[1, 2], [2, 4], [3, 6], [5, 8], [10, 14], [20, 22], [30, 30], [40, 40]]) == 5", "assert candidate(stockPrices=[[1, 1], [2, 2], [3, 5], [4, 4], [5, 5], [6, 6], [7...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(stockPrices=[[1, 5], [2, 5], [3, 5], [4, 6], [5, 6], [6, 6], [7, 7], [8, 7], [9, 7], [10, 8]]) == 6", "assert candidate(stockPrices=[[1, 2], [2, 4], [3, 6], [5, 8], [10, 14], [20, 22], [30, 30], [40, 40]]) == 5", "assert candidate(stockPrices=[[1, 1], [2, 2], [3, 5], [...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nAs the ruler of a kingdom, you have an army of wizards at your command.\nY...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: As the ruler of a kingdom, you have an army of wizards at your command. You are given a 0-indexed integer array strengt...
[ "assert candidate(strength=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) == 220", "assert candidate(strength=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100]) == 457600", "assert candidate(strength=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]) == 315315", "assert candidate(strength=[...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(strength=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) == 220", "assert candidate(strength=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100]) == 457600", "assert candidate(strength=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]) == 315315", "...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an m x n 0-indexed 2D array of positive integers heights whe...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given an m x n 0-indexed 2D array of positive integers heights where heights[i][j] is the height of the person ...
[ "assert candidate(heights=[[4, 5, 6, 7, 8], [3, 2, 1, 8, 7], [2, 3, 4, 7, 6], [1, 2, 3, 6, 5], [8, 7, 6, 5, 4]]) == [[3, 4, 4, 2, 1], [4, 3, 2, 2, 1], [3, 3, 3, 2, 1], [2, 2, 2, 2, 1], [1, 1, 1, 1, 0]]", "assert candidate(heights=[[1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1]]) == [[2, 2, 2, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(heights=[[4, 5, 6, 7, 8], [3, 2, 1, 8, 7], [2, 3, 4, 7, 6], [1, 2, 3, 6, 5], [8, 7, 6, 5, 4]]) == [[3, 4, 4, 2, 1], [4, 3, 2, 2, 1], [3, 3, 3, 2, 1], [2, 2, 2, 2, 1], [1, 1, 1, 1, 0]]", "assert candidate(heights=[[1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1,...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an integer n denoting the number of cities in a country. The...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given an integer n denoting the number of cities in a country. The cities are numbered from 0 to n - 1. You are...
[ "assert candidate(n=8, roads=[[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 0], [0, 4], [1, 5], [2, 6], [3, 7]]) == 108", "assert candidate(n=12, roads=[[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10], [10, 11], [0, 11]]) == 156", "assert candidate(n=10, roads=[[0, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=8, roads=[[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 0], [0, 4], [1, 5], [2, 6], [3, 7]]) == 108", "assert candidate(n=12, roads=[[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10], [10, 11], [0, 11]]) == 156", "assert ca...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed integer array nums. In one step, remove all elem...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 0-indexed integer array nums. In one step, remove all elements nums[i] where nums[i - 1] > nums[i] for ...
[ "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == 10", "assert candidate(nums=[1]) == 0", "assert candidate(nums=[1000000000, 999999999, 999999998, 999999997, 999999996, 999999995, 999999994]) == 1", "assert candidate(nums=[1, 3, 2, 4, 3, 5...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == 10", "assert candidate(nums=[1]) == 0", "assert candidate(nums=[1000000000, 999999999, 999999998, 999999997, 999999996, 999999995, 999999994]) == 1", "assert candi...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed 2D integer array grid of size m x n. Each cell h...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 0-indexed 2D integer array grid of size m x n. Each cell has one of two values: 0 represents an empty ...
[ "assert candidate(grid=[[0, 1, 1, 0, 1, 0, 0, 1], [1, 1, 1, 0, 1, 1, 0, 1], [1, 0, 0, 0, 1, 1, 0, 1], [0, 1, 1, 0, 0, 1, 0, 0], [0, 1, 1, 1, 0, 0, 0, 0]]) == 2", "assert candidate(grid=[[0, 1, 1, 1, 1, 1, 0], [1, 0, 1, 0, 1, 0, 1], [1, 0, 1, 0, 1, 0, 1], [1, 0, 1, 0, 1, 0, 1], [1, 0, 1, 0, 1, 0, 1], [0, 1, 1, 1, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(grid=[[0, 1, 1, 0, 1, 0, 0, 1], [1, 1, 1, 0, 1, 1, 0, 1], [1, 0, 0, 0, 1, 1, 0, 1], [0, 1, 1, 0, 0, 1, 0, 0], [0, 1, 1, 1, 0, 0, 0, 0]]) == 2", "assert candidate(grid=[[0, 1, 1, 1, 1, 1, 0], [1, 0, 1, 0, 1, 0, 1], [1, 0, 1, 0, 1, 0, 1], [1, 0, 1, 0, 1, 0, 1], [1, 0, 1, 0, ...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an integer array nums and an integer k. You may partition nu...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given an integer array nums and an integer k. You may partition nums into one or more subsequences such that ea...
[ "assert candidate(nums=[5, 10, 15, 20, 25, 30, 35, 40, 45, 50], k=5) == 5", "assert candidate(nums=[5, 5, 5, 5, 5], k=1) == 1", "assert candidate(nums=[1, 100, 101, 200, 201, 300, 301], k=1) == 4", "assert candidate(nums=[5, 2, 9, 1, 5, 6], k=4) == 2", "assert candidate(nums=[1, 3, 5, 7, 9, 11, 13, 15, 17, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[5, 10, 15, 20, 25, 30, 35, 40, 45, 50], k=5) == 5", "assert candidate(nums=[5, 5, 5, 5, 5], k=1) == 1", "assert candidate(nums=[1, 100, 101, 200, 201, 300, 301], k=1) == 4", "assert candidate(nums=[5, 2, 9, 1, 5, 6], k=4) == 2", "assert candidate(nums=[1,...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given two positive integer arrays spells and potions, of length n ...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given two positive integer arrays spells and potions, of length n and m respectively, where spells[i] represent...
[ "assert candidate(spells=[99999, 99998, 99997, 99996, 99995], potions=[99999, 99998, 99997, 99996, 99995, 99994, 99993, 99992, 99991, 99990], success=9999800001) == [1, 0, 0, 0, 0]", "assert candidate(spells=[5, 15, 25, 35, 45], potions=[2, 4, 6, 8, 10, 12, 14, 16, 18, 20], success=100) == [1, 7, 9, 9, 9]", "as...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(spells=[99999, 99998, 99997, 99996, 99995], potions=[99999, 99998, 99997, 99996, 99995, 99994, 99993, 99992, 99991, 99990], success=9999800001) == [1, 0, 0, 0, 0]", "assert candidate(spells=[5, 15, 25, 35, 45], potions=[2, 4, 6, 8, 10, 12, 14, 16, 18, 20], success=100) == ...