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:\nSome robots are standing on an infinite number line with their initial coo...
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: Some robots are standing on an infinite number line with their initial coordinates given by a 0-indexed integer array n...
[ "assert candidate(nums=[0, 1, 2, 3, 4, 5], s='RRRRR', d=3) == 26", "assert candidate(nums=[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], s='RRRRRRRRRRLLLLLLLLLL', d=5) == 1101", "assert candidate(nums=[-2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9], s='RLLLLRLLLL', d=5) == 406", "asser...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[0, 1, 2, 3, 4, 5], s='RRRRR', d=3) == 26", "assert candidate(nums=[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], s='RRRRRRRRRRLLLLLLLLLL', d=5) == 1101", "assert candidate(nums=[-2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9], s='RLLLLRLLLL...
[ { "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.\nLet us call a non-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 a 0-indexed m x n binary matrix grid. Let us call a non-empty subset of rows good if the sum of each colu...
[ "assert candidate(grid=[[0, 1, 0, 1, 0], [1, 0, 1, 0, 1], [0, 0, 0, 0, 0], [1, 1, 1, 1, 1]]) == [2]", "assert candidate(grid=[[1, 1, 1, 1, 1], [0, 0, 0, 0, 0], [1, 0, 1, 0, 1], [0, 1, 0, 1, 0]]) == [1]", "assert candidate(grid=[[1, 0, 1], [0, 1, 0], [1, 0, 1], [0, 1, 0], [1, 0, 1], [0, 1, 0]]) == [4, 5]", "as...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(grid=[[0, 1, 0, 1, 0], [1, 0, 1, 0, 1], [0, 0, 0, 0, 0], [1, 1, 1, 1, 1]]) == [2]", "assert candidate(grid=[[1, 1, 1, 1, 1], [0, 0, 0, 0, 0], [1, 0, 1, 0, 1], [0, 1, 0, 1, 0]]) == [1]", "assert candidate(grid=[[1, 0, 1], [0, 1, 0], [1, 0, 1], [0, 1, 0], [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:\nGiven a string s consisting of lowercase English letters. Perform the foll...
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 string s consisting of lowercase English letters. Perform the following operation: Select any non-empty substr...
[ "assert candidate(s='mnopqrstu') == 'lmnopqrst'", "assert candidate(s='zyxzyxzyxzyx') == 'yxwyxwyxwyxw'", "assert candidate(s='abzabzabz') == 'aayabzabz'", "assert candidate(s='xyzyxzyzyxzyz') == 'wxyxwyxyxwyxy'", "assert candidate(s='zzzzzaa') == 'yyyyyaa'", "assert candidate(s='zaz') == 'yaz'", "asser...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='mnopqrstu') == 'lmnopqrst'", "assert candidate(s='zyxzyxzyxzyx') == 'yxwyxwyxwyxw'", "assert candidate(s='abzabzabz') == 'aayabzabz'", "assert candidate(s='xyzyxzyzyxzyz') == 'wxyxwyxyxwyxy'", "assert candidate(s='zzzzzaa') == 'yyyyyaa'", "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 a positive integer n which is the number of nodes of a 0-ind...
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 which is the number of nodes of a 0-indexed directed weighted graph and a 0-indexed ...
[ "assert candidate(n=12, edges=[[0, 1, 1], [1, 2, 2], [2, 0, 3], [0, 3, 4], [3, 4, 5], [4, 5, 6], [5, 3, 7], [1, 6, 8], [6, 7, 9], [7, 8, 10], [8, 9, 11], [9, 10, 12], [10, 11, 13], [11, 6, 14]], s=0, marked=[7, 9, 11]) == 18", "assert candidate(n=20, edges=[[0, 1, 1], [1, 2, 2], [2, 3, 3], [3, 4, 4], [4, 5, 5], [...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=12, edges=[[0, 1, 1], [1, 2, 2], [2, 0, 3], [0, 3, 4], [3, 4, 5], [4, 5, 6], [5, 3, 7], [1, 6, 8], [6, 7, 9], [7, 8, 10], [8, 9, 11], [9, 10, 12], [10, 11, 13], [11, 6, 14]], s=0, marked=[7, 9, 11]) == 18", "assert candidate(n=20, edges=[[0, 1, 1], [1, 2, 2], [2, 3, 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 a 0-indexed integer array nums containing n distinct positiv...
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 containing n distinct positive integers. A permutation of nums is called s...
[ "assert candidate(nums=[3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45]) == 0", "assert candidate(nums=[1, 3, 9, 27, 81, 243, 729, 2187, 6561, 19683, 59049, 177147, 531441, 1594323]) == 178290591", "assert candidate(nums=[2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28]) == 0", "assert candidate(n...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45]) == 0", "assert candidate(nums=[1, 3, 9, 27, 81, 243, 729, 2187, 6561, 19683, 59049, 177147, 531441, 1594323]) == 178290591", "assert candidate(nums=[2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28]) == ...
[ { "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, cost and time, of size n repre...
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, cost and time, of size n representing the costs and the time taken to paint...
[ "assert candidate(cost=[10, 15, 10], time=[2, 3, 2]) == 10", "assert candidate(cost=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200], time=[20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]) == 10", "assert candidate(cost=[10, 20, 30, 40, 50, 60, 7...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(cost=[10, 15, 10], time=[2, 3, 2]) == 10", "assert candidate(cost=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200], time=[20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]) == 10", "assert candidate(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:\nYou are given three integers x, y, and z.\nYou have x strings equal to \"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 three integers x, y, and z. You have x strings equal to "AA", y strings equal to "BB", and z strings equa...
[ "assert candidate(x=10, y=10, z=30) == 100", "assert candidate(x=10, y=35, z=5) == 52", "assert candidate(x=20, y=20, z=20) == 120", "assert candidate(x=25, y=25, z=10) == 120", "assert candidate(x=45, y=5, z=5) == 32", "assert candidate(x=10, y=20, z=15) == 72", "assert candidate(x=30, y=20, z=30) == 1...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(x=10, y=10, z=30) == 100", "assert candidate(x=10, y=35, z=5) == 52", "assert candidate(x=20, y=20, z=20) == 120", "assert candidate(x=25, y=25, z=10) == 120", "assert candidate(x=45, y=5, z=5) == 32", "assert candidate(x=10, y=20, z=15) == 72", "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 0-indexed array words containing n strings.\nLet's define ...
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 words containing n strings. Let's define a join operation join(x, y) between two string...
[ "assert candidate(words=['abc', 'cba', 'bca', 'acb']) == 9", "assert candidate(words=['abcdefghijklmnopqrstuvwxyz', 'zyxwvutsrqponmlkjihgfedcba', 'mnopqrstuvwxyzabcdefghijkl', 'pqonmlkjihgfedcbazyxwvutsr']) == 103", "assert candidate(words=['zzzz', 'zzzz', 'zzzz', 'zzzz', 'zzzz', 'zzzz', 'zzzz', 'zzzz', 'zzzz',...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(words=['abc', 'cba', 'bca', 'acb']) == 9", "assert candidate(words=['abcdefghijklmnopqrstuvwxyz', 'zyxwvutsrqponmlkjihgfedcba', 'mnopqrstuvwxyzabcdefghijkl', 'pqonmlkjihgfedcbazyxwvutsr']) == 103", "assert candidate(words=['zzzz', 'zzzz', 'zzzz', 'zzzz', 'zzzz', 'zzzz'...
[ { "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 total number of servers and a 2D 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: You are given an integer n denoting the total number of servers and a 2D 0-indexed integer array logs, where logs[i] = ...
[ "assert candidate(n=10, logs=[[1, 5], [2, 6], [3, 7], [4, 8], [5, 9], [6, 10], [7, 11], [8, 12], [9, 13], [10, 14]], x=5, queries=[10, 15, 20]) == [4, 5, 10]", "assert candidate(n=10, logs=[[1, 1], [2, 2], [3, 3], [4, 4], [5, 5], [6, 6], [7, 7], [8, 8], [9, 9], [10, 10]], x=5, queries=[6, 7, 8, 9, 10, 11, 12, 13,...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=10, logs=[[1, 5], [2, 6], [3, 7], [4, 8], [5, 9], [6, 10], [7, 11], [8, 12], [9, 13], [10, 14]], x=5, queries=[10, 15, 20]) == [4, 5, 10]", "assert candidate(n=10, logs=[[1, 1], [2, 2], [3, 3], [4, 4], [5, 5], [6, 6], [7, 7], [8, 8], [9, 9], [10, 10]], x=5, queries=[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 two integers num1 and num2.\nIn one operation, you can choos...
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 num1 and num2. In one operation, you can choose integer i in the range [0, 60] and subtract ...
[ "assert candidate(num1=987654321, num2=-98765432) == 12", "assert candidate(num1=500000000, num2=500000000) == -1", "assert candidate(num1=1023, num2=-512) == 11", "assert candidate(num1=2147483647, num2=-2147483647) == 31", "assert candidate(num1=1024, num2=-128) == 2", "assert candidate(num1=127, num2=-...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(num1=987654321, num2=-98765432) == 12", "assert candidate(num1=500000000, num2=500000000) == -1", "assert candidate(num1=1023, num2=-512) == 11", "assert candidate(num1=2147483647, num2=-2147483647) == 31", "assert candidate(num1=1024, num2=-128) == 2", "as...
[ { "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 1-indexed robots, each having a position on a line, health, 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: There are n 1-indexed robots, each having a position on a line, health, and movement direction. You are given 0-indexed...
[ "assert candidate(positions=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], healths=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100], directions='RRRRRRRRRR') == [10, 20, 30, 40, 50, 60, 70, 80, 90, 100]", "assert candidate(positions=[3, 6, 9, 12, 15, 18], healths=[100, 200, 300, 400, 500, 600], directions='RLRLRL') == [199, 399, 599]...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(positions=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], healths=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100], directions='RRRRRRRRRR') == [10, 20, 30, 40, 50, 60, 70, 80, 90, 100]", "assert candidate(positions=[3, 6, 9, 12, 15, 18], healths=[100, 200, 300, 400, 500, 600], directions='RLRL...
[ { "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. We say that two integers x and y form a prime ...
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. We say that two integers x and y form a prime number pair if: 1 <= x <= y <= n x + y == n ...
[ "assert candidate(n=56789) == []", "assert candidate(n=89) == []", "assert candidate(n=8) == [[3, 5]]", "assert candidate(n=23) == []", "assert candidate(n=10000) == [[59, 9941], [71, 9929], [113, 9887], [149, 9851], [167, 9833], [197, 9803], [233, 9767], [251, 9749], [257, 9743], [281, 9719], [311, 9689], ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=56789) == []", "assert candidate(n=89) == []", "assert candidate(n=8) == [[3, 5]]", "assert candidate(n=23) == []", "assert candidate(n=10000) == [[59, 9941], [71, 9929], [113, 9887], [149, 9851], [167, 9833], [197, 9803], [233, 9767], [251, 9749], [257, 9743...
[ { "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 imbalance number of a 0-indexed integer array arr of length n is defin...
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 imbalance number of a 0-indexed integer array arr of length n is defined as the number of indices in sarr = sorted(...
[ "assert candidate(nums=[3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3]) == 0", "assert candidate(nums=[7, 3, 5, 9, 1, 4, 6, 8, 2, 10]) == 91", "assert candidate(nums=[3, 5, 7, 9, 11]) == 20", "assert candidate(nums=[1, 3, 3, 3, 5]) == 8", "assert candidate(nums=[1, 2, 3, 2, 1]) == 0", "assert...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3]) == 0", "assert candidate(nums=[7, 3, 5, 9, 1, 4, 6, 8, 2, 10]) == 91", "assert candidate(nums=[3, 5, 7, 9, 11]) == 20", "assert candidate(nums=[1, 3, 3, 3, 5]) == 8", "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:\nGiven a 0-indexed integer 2D array nodes, your task is to determine if 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: Given a 0-indexed integer 2D array nodes, your task is to determine if the given array represents the preorder traversa...
[ "assert candidate(nodes=[[0, -1], [1, 0], [5, 1], [6, 1], [2, 0], [3, 2], [4, 2], [7, 3], [8, 3], [9, 4], [10, 9]]) == False", "assert candidate(nodes=[[0, -1], [1, 0], [2, 0], [3, 2], [4, 2], [5, 4], [6, 4], [7, 5], [8, 5], [9, 6], [10, 6], [11, 0], [12, 11], [13, 12], [14, 12]]) == False", "assert candidate(n...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nodes=[[0, -1], [1, 0], [5, 1], [6, 1], [2, 0], [3, 2], [4, 2], [7, 3], [8, 3], [9, 4], [10, 9]]) == False", "assert candidate(nodes=[[0, -1], [1, 0], [2, 0], [3, 2], [4, 2], [5, 4], [6, 4], [7, 5], [8, 5], [9, 6], [10, 6], [11, 0], [12, 11], [13, 12], [14, 12]]) == False"...
[ { "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 initial 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 a 0-indexed integer array nums representing the initial positions of some marbles. You are also given two...
[ "assert candidate(nums=[1, 3, 5, 7, 9, 11, 13, 15, 17, 19], moveFrom=[1, 3, 5, 7, 9], moveTo=[3, 5, 7, 9, 11]) == [11, 13, 15, 17, 19]", "assert candidate(nums=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100], moveFrom=[10, 30, 50, 70, 90], moveTo=[15, 45, 65, 85, 105]) == [15, 20, 40, 45, 60, 65, 80, 85, 100, 105]", ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[1, 3, 5, 7, 9, 11, 13, 15, 17, 19], moveFrom=[1, 3, 5, 7, 9], moveTo=[3, 5, 7, 9, 11]) == [11, 13, 15, 17, 19]", "assert candidate(nums=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100], moveFrom=[10, 30, 50, 70, 90], moveTo=[15, 45, 65, 85, 105]) == [15, 20, 40, 45, 60, 65,...
[ { "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 binary string s, partition the string into one or more substrings ...
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 binary string s, partition the string into one or more substrings such that each substring is beautiful. A stri...
[ "assert candidate(s='1111000011110000111') == -1", "assert candidate(s='1111111111111111111') == 19", "assert candidate(s='1100100110001') == -1", "assert candidate(s='1100001') == -1", "assert candidate(s='11001') == 1", "assert candidate(s='11001001001001001') == -1", "assert candidate(s='100000100000...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='1111000011110000111') == -1", "assert candidate(s='1111111111111111111') == 19", "assert candidate(s='1100100110001') == -1", "assert candidate(s='1100001') == -1", "assert candidate(s='11001') == 1", "assert candidate(s='11001001001001001') == -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 array nums of n integers and an integer target.\...
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 of n integers and an integer target. You are initially positioned at index 0. In o...
[ "assert candidate(nums=[1, 3, 5, 7, 9, 11, 13, 15, 17, 19], target=1) == -1", "assert candidate(nums=[10, 9, 8, 7, 6, 5, 4, 3, 2, 1], target=1) == 9", "assert candidate(nums=[100, 90, 80, 70, 60, 50, 40, 30, 20, 10], target=15) == 9", "assert candidate(nums=[1, 4, 9, 16, 25, 36, 49, 64, 81, 100], target=30) =...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[1, 3, 5, 7, 9, 11, 13, 15, 17, 19], target=1) == -1", "assert candidate(nums=[10, 9, 8, 7, 6, 5, 4, 3, 2, 1], target=1) == 9", "assert candidate(nums=[100, 90, 80, 70, 60, 50, 40, 30, 20, 10], target=15) == 9", "assert candidate(nums=[1, 4, 9, 16, 25, 36, 49,...
[ { "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.\nL...
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. Let's define another 0-indexed integer array, n...
[ "assert candidate(nums1=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1], nums2=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) == 10", "assert candidate(nums1=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], nums2=[2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]) == 15", "assert candidate(nums1=[8, 4, 6, 2], nums2=[7, 3, 5, 1]) == 2", "assert can...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums1=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1], nums2=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) == 10", "assert candidate(nums1=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], nums2=[2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]) == 15", "assert candidate(nums1=[8, 4, 6, 2], nums2=[7, 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:\nYou are given a 0-indexed integer array nums and a positive integer k.\nYo...
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 and a positive integer k. You can apply the following operation on the arr...
[ "assert candidate(nums=[5, 5, 5, 5, 5, 5, 5, 5, 5, 5], k=5) == True", "assert candidate(nums=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9], k=5) == False", "assert candidate(nums=[0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0], k=3) == True", "assert candidate(nums=[5, 5, 5, 5, 5, 5, 5, 5, 5, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[5, 5, 5, 5, 5, 5, 5, 5, 5, 5], k=5) == True", "assert candidate(nums=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9], k=5) == False", "assert candidate(nums=[0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0], k=3) == True", "assert candidate(nums=[...
[ { "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 root, which is the root of a special binary tree with n no...
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 root, which is the root of a special binary tree with n nodes. The nodes of the special binary tree are...
[ "assert candidate(root=tree_node([1, 2, 3, None, 4, None, 5, None, 6, None, 7, None, 8, None, 9, None, 10, None, 11, None, 12, None, 13, None, 14, None, 15, None, 16, None, 17])) == 8", "assert candidate(root=tree_node([1, 2, None, 3, None, 4, None, 5, None, 6, None, 7, None, 8, None, 9])) == 8", "assert candid...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(root=tree_node([1, 2, 3, None, 4, None, 5, None, 6, None, 7, None, 8, None, 9, None, 10, None, 11, None, 12, None, 13, None, 14, None, 15, None, 16, None, 17])) == 8", "assert candidate(root=tree_node([1, 2, None, 3, None, 4, None, 5, None, 6, None, 7, None, 8, 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:\nYou are given a 0-indexed array nums and a non-negative integer k.\nIn one...
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 and a non-negative integer k. In one operation, you can do the following: Choose ...
[ "assert candidate(nums=[100, 200, 300, 400, 500, 600, 700, 800, 900, 1000], k=100) == 3", "assert candidate(nums=[1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5], k=2) == 15", "assert candidate(nums=[90000, 80000, 70000, 60000, 50000, 40000, 30000, 20000, 10000], k=25000) == 6", "assert candidate(nums=[1, 1, 2, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[100, 200, 300, 400, 500, 600, 700, 800, 900, 1000], k=100) == 3", "assert candidate(nums=[1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5], k=2) == 15", "assert candidate(nums=[90000, 80000, 70000, 60000, 50000, 40000, 30000, 20000, 10000], k=25000) == 6", "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:\nAn element x of an integer array arr of length m is dominant if more than ...
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: An element x of an integer array arr of length m is dominant if more than half the elements of arr have a value of x. Y...
[ "assert candidate(nums=[5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5]) == 0", "assert candidate(nums=[2, 1, 3, 1, 1, 1, 7, 1, 2, 1]) ==...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5]) == 0", "assert candidate(nums=[2, 1, 3, 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 string word and an array of strings forbidden.\nA string 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 string word and an array of strings forbidden. A string is called valid if none of its substrings are p...
[ "assert candidate(word='abacabacabacaba', forbidden=['aba', 'aca', 'bab']) == 3", "assert candidate(word='xyzxyzxyzxyz', forbidden=['xy', 'yz', 'zx', 'xyz']) == 1", "assert candidate(word='abcdefghijabcdefghij', forbidden=['abc', 'def', 'ghi', 'jij', 'fed', 'cba']) == 5", "assert candidate(word='abcdefghij', ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(word='abacabacabacaba', forbidden=['aba', 'aca', 'bab']) == 3", "assert candidate(word='xyzxyzxyzxyz', forbidden=['xy', 'yz', 'zx', 'xyz']) == 1", "assert candidate(word='abcdefghijabcdefghij', forbidden=['abc', 'def', 'ghi', 'jij', 'fed', 'cba']) == 5", "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:\nGiven a 0-indexed string s, permute s to get a new string t such that:\n\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: Given a 0-indexed string s, permute s to get a new string t such that: All consonants remain in their original places....
[ "assert candidate(s='MixedWithVowelsAndConsonants') == 'MAxadWethVewilsindConsononts'", "assert candidate(s='tRiUmPh') == 'tRUimPh'", "assert candidate(s='aeiouAEIOUbcdfghjklmnpqrstvwxyz') == 'AEIOUaeioubcdfghjklmnpqrstvwxyz'", "assert candidate(s='aAbBcCdDeEfFgGiImMoOnNpPrRsStTuUvVwWxXyYzZ') == 'AEbBcCdDIOfF...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='MixedWithVowelsAndConsonants') == 'MAxadWethVewilsindConsononts'", "assert candidate(s='tRiUmPh') == 'tRUimPh'", "assert candidate(s='aeiouAEIOUbcdfghjklmnpqrstvwxyz') == 'AEIOUaeioubcdfghjklmnpqrstvwxyz'", "assert candidate(s='aAbBcCdDeEfFgGiImMoOnNpPrRsStTuUvV...
[ { "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 and a positive integer x.\nYo...
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 and a positive integer x. You are initially at position 0 in the array and...
[ "assert candidate(nums=[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29], x=1) == 225", "assert candidate(nums=[2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30], x=3) == 240", "assert candidate(nums=[2, 3, 5, 7, 11, 13, 17, 19, 23], x=10) == 90", "assert candidate(nums=[1000000, 999999, 999998, 9...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29], x=1) == 225", "assert candidate(nums=[2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30], x=3) == 240", "assert candidate(nums=[2, 3, 5, 7, 11, 13, 17, 19, 23], x=10) == 90", "assert candidate(nums=...
[ { "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 two positive integers n and x.\nReturn the number of ways n can be e...
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 two positive integers n and x. Return the number of ways n can be expressed as the sum of the xth power of unique...
[ "assert candidate(n=8, x=3) == 1", "assert candidate(n=30, x=1) == 296", "assert candidate(n=81, x=4) == 1", "assert candidate(n=17, x=4) == 1", "assert candidate(n=3, x=1) == 2", "assert candidate(n=125, x=2) == 5", "assert candidate(n=100, x=2) == 3", "assert candidate(n=280, x=3) == 1", "assert c...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=8, x=3) == 1", "assert candidate(n=30, x=1) == 296", "assert candidate(n=81, x=4) == 1", "assert candidate(n=17, x=4) == 1", "assert candidate(n=3, x=1) == 2", "assert candidate(n=125, x=2) == 5", "assert candidate(n=100, x=2) == 3", "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 array nums consisting of positive integers.\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: You are given a 0-indexed array nums consisting of positive integers. You can do the following operation on the array a...
[ "assert candidate(nums=[5, 3, 3]) == 11", "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == 55", "assert candidate(nums=[2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5]) == 56", "assert candidate(nums=[1, 3, 2, 4, 3, 5, 4, 6, 5, 7]) == 40", "assert candidate(nums=[1, 1000000, 1]) == 1000001", "as...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[5, 3, 3]) == 11", "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == 55", "assert candidate(nums=[2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5]) == 56", "assert candidate(nums=[1, 3, 2, 4, 3, 5, 4, 6, 5, 7]) == 40", "assert candidate(nums=[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 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, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 0, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 0, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 0, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(parent=[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 0, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 0, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 0, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69...
[ { "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 root to a binary tree and an integer k. A node of this tre...
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 root to a binary tree and an integer k. A node of this tree is called great enough if the followings ho...
[ "assert candidate(root=tree_node([50, 25, 75, 12, 37, 56, 92, 6, 18, 29, 41, 52, 67, 85, 95, 3, 9, 15, 21, 26, 31, 35, 45, 53, 61, 70, 73, 80, 87, 90, 93, 98]), k=10) == 1", "assert candidate(root=tree_node([15, 10, 20, 5, 12, 17, 25, 3, 7, 11, 13, 16, 19, 23, 27]), k=5) == 1", "assert candidate(root=tree_node(...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(root=tree_node([50, 25, 75, 12, 37, 56, 92, 6, 18, 29, 41, 52, 67, 85, 95, 3, 9, 15, 21, 26, 31, 35, 45, 53, 61, 70, 73, 80, 87, 90, 93, 98]), k=10) == 1", "assert candidate(root=tree_node([15, 10, 20, 5, 12, 17, 25, 3, 7, 11, 13, 16, 19, 23, 27]), k=5) == 1", "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:\nGiven three strings a, b, and c, your task is to find a string that has th...
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 three strings a, b, and c, your task is to find a string that has the minimum length and contains all three strin...
[ "assert candidate(a='pneumonoultramicroscopicsilicovolcanoconiosis', b='microscopicsilicovolcanoconiosis', c='silicovolcanoconiosis') == 'pneumonoultramicroscopicsilicovolcanoconiosis'", "assert candidate(a='aaaab', b='bbbbb', c='ccccd') == 'aaaabbbbbccccd'", "assert candidate(a='abcdef', b='defabc', c='efabcd'...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(a='pneumonoultramicroscopicsilicovolcanoconiosis', b='microscopicsilicovolcanoconiosis', c='silicovolcanoconiosis') == 'pneumonoultramicroscopicsilicovolcanoconiosis'", "assert candidate(a='aaaab', b='bbbbb', c='ccccd') == 'aaaabbbbbccccd'", "assert candidate(a='abcdef...
[ { "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 two positive integers low and high represented as strings, find 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: Given two positive integers low and high represented as strings, find the count of stepping numbers in the inclusive ra...
[ "assert candidate(low='987654321', high='9876543211') == 2931", "assert candidate(low='10', high='1111111111') == 3311", "assert candidate(low='1', high='12345678901234567890') == 2358711", "assert candidate(low='321098765432109876543210987', high='432109876543210987654321098') == 25767582", "assert candida...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(low='987654321', high='9876543211') == 2931", "assert candidate(low='10', high='1111111111') == 3311", "assert candidate(low='1', high='12345678901234567890') == 2358711", "assert candidate(low='321098765432109876543210987', high='432109876543210987654321098') == 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:\nWe know that 4 and 7 are lucky digits. Also, a number is called lucky if 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: We know that 4 and 7 are lucky digits. Also, a number is called lucky if it contains only lucky digits. You are given a...
[ "assert candidate(k=1125899906842623) == '44444444444444444444444444444444444444444444444444'", "assert candidate(k=576460752303423487) == '44444444444444444444444444444444444444444444444444444444444'", "assert candidate(k=4503599627370495) == '4444444444444444444444444444444444444444444444444444'", "assert c...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(k=1125899906842623) == '44444444444444444444444444444444444444444444444444'", "assert candidate(k=576460752303423487) == '44444444444444444444444444444444444444444444444444444444444'", "assert candidate(k=4503599627370495) == '444444444444444444444444444444444444444444...
[ { "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 head of a linked list head, in which each node contains an integ...
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 head of a linked list head, in which each node contains an integer value. Between every pair of adjacent node...
[ "assert is_same_list(candidate(head=list_node([210, 231, 252, 273, 294])), list_node([210, 21, 231, 21, 252, 21, 273, 21, 294]))", "assert is_same_list(candidate(head=list_node([60, 45, 30, 15])), list_node([60, 15, 45, 15, 30, 15, 15]))", "assert is_same_list(candidate(head=list_node([84, 56, 42, 28, 14])), li...
newfacade/LeetCodeDataset
{ "constraints": [ "assert is_same_list(candidate(head=list_node([210, 231, 252, 273, 294])), list_node([210, 21, 231, 21, 252, 21, 273, 21, 294]))", "assert is_same_list(candidate(head=list_node([60, 45, 30, 15])), list_node([60, 15, 45, 15, 30, 15, 15]))", "assert is_same_list(candidate(head=list_node([...
[ { "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 containing n integers.\nAt each secon...
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 containing n integers. At each second, you perform the following operation on the ...
[ "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]) == 10", "assert candidate(nums=[1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 0, 0]) == 9", "assert candidate(nums=[6, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6]) == 1", "assert candidate(nums=[5, 6, 5, 7, 5...
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, 20]) == 10", "assert candidate(nums=[1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 0, 0]) == 9", "assert candidate(nums=[6, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6]) == 1", "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 an array nums of length n and an integer m. You need to dete...
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 nums of length n and an integer m. You need to determine if it is possible to split the array in...
[ "assert candidate(nums=[1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100], m=101) == True", "assert candidate(nums=[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21], m=10) == True", "assert candidate(nums=[100, 99, 98, 97, 96, 95, 94, 93, 92, 91], m=190) == True", "assert candidate(nums=[1...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100], m=101) == True", "assert candidate(nums=[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21], m=10) == True", "assert candidate(nums=[100, 99, 98, 97, 96, 95, 94, 93, 92, 91], m=190) == True", ...
[ { "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 matrix grid of size n x n, where (r, c) repre...
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 matrix grid of size n x n, where (r, c) represents: A cell containing a thief if grid[r][...
[ "assert candidate(grid=[[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(grid=[[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [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:\nYou are given a 0-indexed 2D integer array items of length n and an 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 a 0-indexed 2D integer array items of length n and an integer k. items[i] = [profiti, categoryi], where p...
[ "assert candidate(items=[[1, 1], [2, 1], [3, 1], [4, 1], [5, 1], [6, 2], [7, 2], [8, 2], [9, 2], [10, 2]], k=4) == 36", "assert candidate(items=[[1, 1], [1, 2], [1, 3], [1, 4], [1, 5], [1, 6], [1, 7], [1, 8], [1, 9], [1, 10]], k=5) == 30", "assert candidate(items=[[1000000000, 1], [900000000, 2], [800000000, 3]...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(items=[[1, 1], [2, 1], [3, 1], [4, 1], [5, 1], [6, 2], [7, 2], [8, 2], [9, 2], [10, 2]], k=4) == 36", "assert candidate(items=[[1, 1], [1, 2], [1, 3], [1, 4], [1, 5], [1, 6], [1, 7], [1, 8], [1, 9], [1, 10]], k=5) == 30", "assert candidate(items=[[1000000000, 1], [9000...
[ { "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 n * m 0-indexed grid of string land. Right now, you are s...
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 n * m 0-indexed grid of string land. Right now, you are standing at the cell that contains "S", and yo...
[ "assert candidate(land=[['D', '.', 'X', '.'], ['.', '.', '.', '.'], ['.', 'S', '.', '*']]) == 3", "assert candidate(land=[['.', '.', 'S'], ['.', '.', '.'], ['D', '.', '*']]) == -1", "assert candidate(land=[['D', 'X', '*'], ['.', '.', '.'], ['.', '.', 'S']]) == -1", "assert candidate(land=[['.', '.', '.', '.',...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(land=[['D', '.', 'X', '.'], ['.', '.', '.', '.'], ['.', 'S', '.', '*']]) == 3", "assert candidate(land=[['.', '.', 'S'], ['.', '.', '.'], ['D', '.', '*']]) == -1", "assert candidate(land=[['D', 'X', '*'], ['.', '.', '.'], ['.', '.', 'S']]) == -1", "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 the head of a non-empty linked list representing a non-negat...
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 non-empty linked list representing a non-negative integer without leading zeroes. Return th...
[ "assert is_same_list(candidate(head=list_node([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1])), list_node([2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]))", "assert is_same_list(candidate(head=list_node([9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9])), list_node([1, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,...
newfacade/LeetCodeDataset
{ "constraints": [ "assert is_same_list(candidate(head=list_node([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1])), list_node([2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]))", "assert is_same_list(candidate(head=list_node([9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9])), list_node([1, 9, 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:\nYou are given a 0-indexed integer array nums and an integer x.\nFind the m...
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 and an integer x. Find the minimum absolute difference between two element...
[ "assert candidate(nums=[10, 20, 30, 40, 50], x=4) == 40", "assert candidate(nums=[19, 17, 15, 13, 11, 9, 7, 5, 3, 1], x=3) == 6", "assert candidate(nums=[100, 200, 300, 400, 500, 100, 200, 300], x=3) == 0", "assert candidate(nums=[5, 3, 2, 10, 15], x=1) == 1", "assert candidate(nums=[1, 1, 2, 2, 3, 3, 4, 4,...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[10, 20, 30, 40, 50], x=4) == 40", "assert candidate(nums=[19, 17, 15, 13, 11, 9, 7, 5, 3, 1], x=3) == 6", "assert candidate(nums=[100, 200, 300, 400, 500, 100, 200, 300], x=3) == 0", "assert candidate(nums=[5, 3, 2, 10, 15], x=1) == 1", "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 an integer array prices, which shows the chocolate prices 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: You are given an integer array prices, which shows the chocolate prices and a 2D integer array queries, where queries[i...
[ "assert candidate(prices=[1000000000, 500000000, 250000000, 125000000, 62500000, 31250000, 15625000, 7812500, 3906250, 1953125], queries=[[500000000, 5], [1000000000, 10], [1953125, 10]]) == [29296875, 1998046875, -1958984375]", "assert candidate(prices=[10, 20, 30, 40, 50], queries=[[25, 3], [35, 2], [15, 4]]) =...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(prices=[1000000000, 500000000, 250000000, 125000000, 62500000, 31250000, 15625000, 7812500, 3906250, 1953125], queries=[[500000000, 5], [1000000000, 10], [1953125, 10]]) == [29296875, 1998046875, -1958984375]", "assert candidate(prices=[10, 20, 30, 40, 50], queries=[[25, 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 integer array nums. Each element in nums is 1, 2 or 3. 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 integer array nums. Each element in nums is 1, 2 or 3. In each operation, you can remove an element fr...
[ "assert candidate(nums=[2, 1, 2, 1, 2, 1, 2]) == 3", "assert candidate(nums=[1, 2, 3, 3, 3, 2, 1]) == 2", "assert candidate(nums=[3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1]) == 13", "assert candidate(nums=[2, 2, 2, 2, 2, 1, 1, 1, 1, 1]) == 5", "assert candidate(nums=[3, 2, 1, 2, 1, 3, 1]) =...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[2, 1, 2, 1, 2, 1, 2]) == 3", "assert candidate(nums=[1, 2, 3, 3, 3, 2, 1]) == 2", "assert candidate(nums=[3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1]) == 13", "assert candidate(nums=[2, 2, 2, 2, 2, 1, 1, 1, 1, 1]) == 5", "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 positive integers low, high, and k.\nA number is beautiful 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 positive integers low, high, and k. A number is beautiful if it meets both of the following conditions: ...
[ "assert candidate(low=500000, high=600000, k=20) == 1875", "assert candidate(low=10000000, high=20000000, k=5) == 546875", "assert candidate(low=100, high=200, k=4) == 0", "assert candidate(low=987654321, high=987654321, k=19) == 0", "assert candidate(low=10000000, high=20000000, k=9) == 306040", "assert ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(low=500000, high=600000, k=20) == 1875", "assert candidate(low=10000000, high=20000000, k=5) == 546875", "assert candidate(low=100, high=200, k=4) == 0", "assert candidate(low=987654321, high=987654321, k=19) == 0", "assert candidate(low=10000000, high=20000000...
[ { "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, n and k.\nAn array of distinct positive 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 two integers, n and k. An array of distinct positive integers is called a k-avoiding array if there does ...
[ "assert candidate(n=5, k=10) == 15", "assert candidate(n=15, k=8) == 153", "assert candidate(n=45, k=47) == 1541", "assert candidate(n=10, k=18) == 63", "assert candidate(n=15, k=3) == 134", "assert candidate(n=28, k=28) == 588", "assert candidate(n=30, k=25) == 681", "assert candidate(n=18, k=7) == 2...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=5, k=10) == 15", "assert candidate(n=15, k=8) == 153", "assert candidate(n=45, k=47) == 1541", "assert candidate(n=10, k=18) == 63", "assert candidate(n=15, k=3) == 134", "assert candidate(n=28, k=28) == 588", "assert candidate(n=30, k=25) == 681", ...
[ { "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 houses on a number l...
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 houses on a number line, numbered from 0 to n - 1. Additionally, ...
[ "assert candidate(n=50, offers=[[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, 10, 100], [0, 10, 350], [10, 20, 400], [20, 30, 450], [30, 40, 500], [40, 50, 550]]) == 1350", "assert candidate(n=100, offers=[[0, 49, 500], [50, 99, 1000]]) == 1500", ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=50, offers=[[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, 10, 100], [0, 10, 350], [10, 20, 400], [20, 30, 450], [30, 40, 500], [40, 50, 550]]) == 1350", "assert candidate(n=100, offers=[[0, 49, 500], [50, ...
[ { "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 and an integer k.\nA subarray...
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 and an integer k. A subarray is called equal if all of its elements are eq...
[ "assert candidate(nums=[4, 4, 4, 1, 1], k=2) == 3", "assert candidate(nums=[1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 1, 1, 2, 2, 3, 3, 4, 4], k=8) == 4", "assert candidate(nums=[5, 5, 5, 5, 5], k=0) == 5", "assert candidate(nums=[1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5], k=7) == 5", "assert candidate(nums=[1, 2], ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[4, 4, 4, 1, 1], k=2) == 3", "assert candidate(nums=[1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 1, 1, 2, 2, 3, 3, 4, 4], k=8) == 4", "assert candidate(nums=[5, 5, 5, 5, 5], k=0) == 5", "assert candidate(nums=[1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5], k=7) == 5", "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 array nums of distinct integers.\nLet us define ...
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 of distinct integers. Let us define a 0-indexed array ans of the same length as nu...
[ "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]) == [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]", "assert candidate(nums=[2, 1]) == [2, 1]", "assert candidate(nums=[7, 1, 3, 2, 6, 5, 4, 8, 10, 9, 11, 13, 12, 15, 14, 16, 17, 18, 19, 20]) == [7, 1, 3, 1, 6, 2, 1, 8, 10, 1, 11, 1...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]) == [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]", "assert candidate(nums=[2, 1]) == [2, 1]", "assert candidate(nums=[7, 1, 3, 2, 6, 5, 4, 8, 10, 9, 11, 13, 12, 15, 14, 16, 17, 18, 19, 20]) == [7, 1, 3, 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 positive integers n and target.\nAn 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 positive integers n and target. An array nums is beautiful if it meets the following conditions: nums.le...
[ "assert candidate(n=25000000, target=75000000) == 10312500", "assert candidate(n=20, target=15) == 301", "assert candidate(n=1000000000, target=1) == 21", "assert candidate(n=1000, target=100) == 547050", "assert candidate(n=5000, target=5001) == 18752500", "assert candidate(n=999999999, target=999999999)...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=25000000, target=75000000) == 10312500", "assert candidate(n=20, target=15) == 301", "assert candidate(n=1000000000, target=1) == 21", "assert candidate(n=1000, target=100) == 547050", "assert candidate(n=5000, target=5001) == 18752500", "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 array nums consisting of non-negative powers 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 nums consisting of non-negative powers of 2, and an integer target. In one operation, y...
[ "assert candidate(nums=[2, 4, 8, 16, 32, 64, 128, 256], target=255) == 8", "assert candidate(nums=[1, 1, 1, 2, 2, 2, 4, 4, 4, 8, 8, 8, 16, 16, 16, 32, 32, 32, 64, 64, 64, 128, 128, 128, 256, 256, 256, 512, 512, 512, 1024, 1024, 1024], target=2047) == 0", "assert candidate(nums=[1024, 512, 256, 128, 64, 32, 16, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[2, 4, 8, 16, 32, 64, 128, 256], target=255) == 8", "assert candidate(nums=[1, 1, 1, 2, 2, 2, 4, 4, 4, 8, 8, 8, 16, 16, 16, 32, 32, 32, 64, 64, 64, 128, 128, 128, 256, 256, 256, 512, 512, 512, 1024, 1024, 1024], target=2047) == 0", "assert candidate(nums=[1024, 51...
[ { "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 a battle and n heroes are trying to defeat m monsters. 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: There is a battle and n heroes are trying to defeat m monsters. You are given two 1-indexed arrays of positive integers...
[ "assert candidate(heroes=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100], monsters=[5, 10, 15, 20, 25, 30, 35, 40, 45, 50], coins=[50, 40, 30, 20, 10, 5, 4, 3, 2, 1]) == [90, 140, 155, 162, 165, 165, 165, 165, 165, 165]", "assert candidate(heroes=[1, 1, 1, 1, 1], monsters=[1, 1, 1, 1, 1], coins=[1, 2, 3, 4, 5]) == [15,...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(heroes=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100], monsters=[5, 10, 15, 20, 25, 30, 35, 40, 45, 50], coins=[50, 40, 30, 20, 10, 5, 4, 3, 2, 1]) == [90, 140, 155, 162, 165, 165, 165, 165, 165, 165]", "assert candidate(heroes=[1, 1, 1, 1, 1], monsters=[1, 1, 1, 1, 1], coins=[...
[ { "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 strings s1 and s2, both of length n, consisting of lower...
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 strings s1 and s2, both of length n, consisting of lowercase English letters. You can apply the follo...
[ "assert candidate(s1='abababab', s2='babababa') == False", "assert candidate(s1='aabbcc', s2='bbaacc') == True", "assert candidate(s1='xyxzyzyx', s2='yxzyxzyz') == False", "assert candidate(s1='abcdefghijklmnopqrstuvwxyzyxwvutsrqponmlkjihgfedcba', s2='abcdefghijklmnopqrstuvwxyzzyxwvutsrqponmlkjihgfedcba') == ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s1='abababab', s2='babababa') == False", "assert candidate(s1='aabbcc', s2='bbaacc') == True", "assert candidate(s1='xyxzyzyx', s2='yxzyxzyz') == False", "assert candidate(s1='abcdefghijklmnopqrstuvwxyzyxwvutsrqponmlkjihgfedcba', s2='abcdefghijklmnopqrstuvwxyzzyxwv...
[ { "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 two positive integers m and k.\nRe...
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 two positive integers m and k. Return the maximum sum out of all almost unique ...
[ "assert candidate(nums=[2, 3, 3, 2, 3, 2, 2, 3, 2, 3, 2, 3], m=2, k=4) == 11", "assert candidate(nums=[5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[2, 3, 3, 2, 3, 2, 2, 3, 2, 3, 2, 3], m=2, k=4) == 11", "assert candidate(nums=[5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 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 a 0-indexed integer array nums, an integer modulo, and an 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 a 0-indexed integer array nums, an integer modulo, and an integer k. Your task is to find the count of su...
[ "assert candidate(nums=[13, 26, 39, 52, 65, 78, 91, 104, 117, 130], modulo=13, k=2) == 0", "assert candidate(nums=[9, 8, 7, 6, 5, 4, 3, 2, 1], modulo=4, k=3) == 0", "assert candidate(nums=[15, 25, 35, 45, 55, 65, 75, 85, 95, 105], modulo=5, k=0) == 7", "assert candidate(nums=[5, 15, 25, 35, 45, 55, 65, 75, 85...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[13, 26, 39, 52, 65, 78, 91, 104, 117, 130], modulo=13, k=2) == 0", "assert candidate(nums=[9, 8, 7, 6, 5, 4, 3, 2, 1], modulo=4, k=3) == 0", "assert candidate(nums=[15, 25, 35, 45, 55, 65, 75, 85, 95, 105], modulo=5, k=0) == 7", "assert candidate(nums=[5, 15,...
[ { "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 tree with n nodes labeled 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: There is an undirected tree with n nodes labeled from 0 to n - 1. You are given the integer n and a 2D integer array ed...
[ "assert candidate(n=25, 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], [19, 20, 20], [20, 21, 21], [21, 22, 22], [22, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=25, 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], [19, 20, 20], [20, 21, 21]...
[ { "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 positive integer n, return a string representing the smallest 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: Given a positive integer n, return a string representing the smallest positive integer such that the product of its dig...
[ "assert candidate(n=2222222222) == '-1'", "assert candidate(n=10) == '25'", "assert candidate(n=1836934518575681) == '-1'", "assert candidate(n=270) == '569'", "assert candidate(n=123456789) == '-1'", "assert candidate(n=7) == '7'", "assert candidate(n=86400000) == '5555568889'", "assert candidate(n=2...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=2222222222) == '-1'", "assert candidate(n=10) == '25'", "assert candidate(n=1836934518575681) == '-1'", "assert candidate(n=270) == '569'", "assert candidate(n=123456789) == '-1'", "assert candidate(n=7) == '7'", "assert candidate(n=86400000) == '5555...
[ { "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 four integers sx, sy, fx, fy, and a non-negative integer 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 four integers sx, sy, fx, fy, and a non-negative integer t. In an infinite 2D grid, you start at the cell...
[ "assert candidate(sx=3, sy=3, fx=1, fy=1, t=4) == True", "assert candidate(sx=10, sy=10, fx=5, fy=5, t=9) == True", "assert candidate(sx=1, sy=1, fx=2, fy=1, t=1) == True", "assert candidate(sx=1, sy=1, fx=10, fy=10, t=14) == True", "assert candidate(sx=100, sy=100, fx=105, fy=105, t=10) == True", "assert...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(sx=3, sy=3, fx=1, fy=1, t=4) == True", "assert candidate(sx=10, sy=10, fx=5, fy=5, t=9) == True", "assert candidate(sx=1, sy=1, fx=2, fy=1, t=1) == True", "assert candidate(sx=1, sy=1, fx=10, fy=10, t=14) == True", "assert candidate(sx=100, sy=100, fx=105, fy=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 matrix grid of size 3 * 3, representi...
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 matrix grid of size 3 * 3, representing the number of stones in each cell. The gri...
[ "assert candidate(grid=[[1, 3, 0], [1, 0, 0], [1, 0, 3]]) == 4", "assert candidate(grid=[[0, 0, 0], [0, 0, 0], [0, 0, 9]]) == 18", "assert candidate(grid=[[1, 2, 0], [0, 1, 2], [2, 0, 1]]) == 4", "assert candidate(grid=[[3, 0, 0], [0, 3, 0], [0, 0, 3]]) == 8", "assert candidate(grid=[[2, 2, 1], [1, 0, 1], [...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(grid=[[1, 3, 0], [1, 0, 0], [1, 0, 3]]) == 4", "assert candidate(grid=[[0, 0, 0], [0, 0, 0], [0, 0, 9]]) == 18", "assert candidate(grid=[[1, 2, 0], [0, 1, 2], [2, 0, 1]]) == 4", "assert candidate(grid=[[3, 0, 0], [0, 3, 0], [0, 0, 3]]) == 8", "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 two strings s and t of equal length n. You can perform the f...
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 strings s and t of equal length n. You can perform the following operation on the string s: Remove a...
[ "assert candidate(s='xyzxyz', t='xyzxyz', k=5) == 1041", "assert candidate(s='thisthisthisthisthisthisthis', t='histhisthisthisthisthisthist', k=10000000000000) == 937749612", "assert candidate(s='repeatedpatternrepeatedpattern', t='atedpatternrepeatedpatternrepe', k=99999999999999) == 849771837", "assert can...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='xyzxyz', t='xyzxyz', k=5) == 1041", "assert candidate(s='thisthisthisthisthisthisthis', t='histhisthisthisthisthisthist', k=10000000000000) == 937749612", "assert candidate(s='repeatedpatternrepeatedpattern', t='atedpatternrepeatedpatternrepe', k=99999999999999) == ...
[ { "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 num sorted in non-decreasing order.\nYou can perfor...
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 num sorted in non-decreasing order. You can perform the following operation any number of times:...
[ "assert candidate(nums=[1, 2, 3, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7]) == 1", "assert candidate(nums=[1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 7, 7, 7]) == 0", "assert candidate(nums=...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[1, 2, 3, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7]) == 1", "assert candidate(nums=[1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 7, 7, 7]) == 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 coordinates and an integer k, where coord...
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 coordinates and an integer k, where coordinates[i] = [xi, yi] are the coordinates of t...
[ "assert candidate(coordinates=[[1000000, 1000000], [0, 0], [500000, 500000], [250000, 250000]], k=1000000) == 1", "assert candidate(coordinates=[[500000, 500000], [500001, 500001], [500002, 500002], [500003, 500003], [500004, 500004]], k=1) == 0", "assert candidate(coordinates=[[0, 0], [1, 1], [2, 2], [3, 3], [...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(coordinates=[[1000000, 1000000], [0, 0], [500000, 500000], [250000, 250000]], k=1000000) == 1", "assert candidate(coordinates=[[500000, 500000], [500001, 500001], [500002, 500002], [500003, 500003], [500004, 500004]], k=1) == 0", "assert candidate(coordinates=[[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:\nThere is a simple directed graph with n nodes labeled from 0 to n - 1. 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: There is a simple directed graph with n nodes labeled from 0 to n - 1. The graph would form a tree if its edges were bi...
[ "assert candidate(n=10, edges=[[0, 1], [0, 2], [1, 3], [1, 4], [2, 5], [2, 6], [3, 7], [3, 8], [4, 9]]) == [0, 1, 1, 2, 2, 2, 2, 3, 3, 3]", "assert candidate(n=20, 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], [1...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=10, edges=[[0, 1], [0, 2], [1, 3], [1, 4], [2, 5], [2, 6], [3, 7], [3, 8], [4, 9]]) == [0, 1, 1, 2, 2, 2, 2, 3, 3, 3]", "assert candidate(n=20, 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],...
[ { "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 where n is the to...
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 where n is the total number of students in the class. The clas...
[ "assert candidate(nums=[7, 3, 1, 8, 5, 4, 9, 6, 2, 0, 10, 11, 12, 13, 14]) == 1", "assert candidate(nums=[10, 1, 10, 2, 10, 3, 10, 4, 10, 5, 10, 6, 10, 7, 10, 8, 10, 9, 10, 10]) == 2", "assert candidate(nums=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) == 2", "assert candidate(nums=[30, 28, 2...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[7, 3, 1, 8, 5, 4, 9, 6, 2, 0, 10, 11, 12, 13, 14]) == 1", "assert candidate(nums=[10, 1, 10, 2, 10, 3, 10, 4, 10, 5, 10, 6, 10, 7, 10, 8, 10, 9, 10, 10]) == 2", "assert candidate(nums=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) == 2", "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 the owner of a company that creates alloys using various types 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 the owner of a company that creates alloys using various types of metals. There are n different types of metals...
[ "assert candidate(n=5, k=2, budget=1000, composition=[[10, 10, 10, 10, 10], [1, 1, 1, 1, 1]], stock=[100, 100, 100, 100, 100], cost=[1, 2, 3, 4, 5]) == 166", "assert candidate(n=2, k=5, budget=50, composition=[[1, 1], [2, 1], [1, 2], [2, 2], [3, 3]], stock=[5, 5], cost=[10, 20]) == 6", "assert candidate(n=3, k=...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=5, k=2, budget=1000, composition=[[10, 10, 10, 10, 10], [1, 1, 1, 1, 1]], stock=[100, 100, 100, 100, 100], cost=[1, 2, 3, 4, 5]) == 166", "assert candidate(n=2, k=5, budget=50, composition=[[1, 1], [2, 1], [1, 2], [2, 2], [3, 3]], stock=[5, 5], cost=[10, 20]) == 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.\nReturn the length of the longest sem...
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. Return the length of the longest semi-decreasing subarray of nums, and 0 if there ...
[ "assert candidate(nums=[9, 8, 7, 6, 5, 6, 7, 8, 9]) == 8", "assert candidate(nums=[10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 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]) == 19", "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 14, 13, 12, 11, 10, 9, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[9, 8, 7, 6, 5, 6, 7, 8, 9]) == 8", "assert candidate(nums=[10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 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]) == 19", "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15...
[ { "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 heights of n integers representing the number of br...
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 heights of n integers representing the number of bricks in n consecutive towers. Your task is to...
[ "assert candidate(heights=[1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000]) == 6000000000", "assert candidate(heights=[1, 3, 5, 7, 9, 7, 5, 3, 1]) == 41", "assert candidate(heights=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) == 10", "assert candidate(heights=[100, 90, 80, 70, 60, 50, 40, 30, 20, 1...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(heights=[1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000]) == 6000000000", "assert candidate(heights=[1, 3, 5, 7, 9, 7, 5, 3, 1]) == 41", "assert candidate(heights=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) == 10", "assert candidate(heights=[100, 90, 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 array maxHeights of n integers.\nYou are tasked ...
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 maxHeights of n integers. You are tasked with building n towers in the coordinate line....
[ "assert candidate(maxHeights=[10, 10, 10, 10, 10]) == 50", "assert candidate(maxHeights=[1, 2, 3, 4, 5, 4, 3, 4, 5, 4, 3, 4, 5, 4, 3]) == 46", "assert candidate(maxHeights=[1, 1, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]) == 103", "assert candidate(maxHeights=[9, 8, 7, 6, 5, 4, 3, 2, 1, 2, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(maxHeights=[10, 10, 10, 10, 10]) == 50", "assert candidate(maxHeights=[1, 2, 3, 4, 5, 4, 3, 4, 5, 4, 3, 4, 5, 4, 3]) == 46", "assert candidate(maxHeights=[1, 1, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]) == 103", "assert candidate(maxHeights=[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 undirected tree with n nodes labeled from 1 to n. You are give...
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 tree with n nodes labeled from 1 to n. You are given the integer n and a 2D integer array edges ...
[ "assert candidate(n=20, edges=[[1, 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], [10, 20]]) == 47", "assert candidate(n=6, edges=[[1, 2], [1, 3], [2, 4], [3, 5], [3, 6]]) == 6", "assert candidate(n=12, edges=...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=20, edges=[[1, 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], [10, 20]]) == 47", "assert candidate(n=6, edges=[[1, 2], [1, 3], [2, 4], [3, 5], [3, 6]]) == 6", "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:\nYou are given a 0-indexed array nums consisting of positive integers.\nThe...
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 positive integers. There are two types of operations that you can ap...
[ "assert candidate(nums=[43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45]) == 24", "asse...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,...
[ { "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 nums consisting of non-negative integers.\nWe defin...
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 nums consisting of non-negative integers. We define the score of subarray nums[l..r] such that l...
[ "assert candidate(nums=[8, 4, 2, 1, 8, 4, 2, 1, 8, 4]) == 5", "assert candidate(nums=[255, 127, 63, 31, 15, 7, 3, 1, 0, 1, 3, 7, 15, 31, 63, 127, 255]) == 1", "assert candidate(nums=[15, 14, 13, 12, 11, 10, 9]) == 1", "assert candidate(nums=[7, 14, 21, 28, 35, 42, 49, 56, 63, 70, 77, 84, 91, 98, 105]) == 2", ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[8, 4, 2, 1, 8, 4, 2, 1, 8, 4]) == 5", "assert candidate(nums=[255, 127, 63, 31, 15, 7, 3, 1, 0, 1, 3, 7, 15, 31, 63, 127, 255]) == 1", "assert candidate(nums=[15, 14, 13, 12, 11, 10, 9]) == 1", "assert candidate(nums=[7, 14, 21, 28, 35, 42, 49, 56, 63, 70, 77...
[ { "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 tree with n nodes labeled 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: There is an undirected tree with n nodes labeled from 0 to n - 1. You are given the integer n and a 2D integer array ed...
[ "assert candidate(n=10, edges=[[0, 1], [0, 2], [1, 3], [1, 4], [2, 5], [2, 6], [3, 7], [4, 8], [5, 9]], values=[12, 15, 3, 6, 9, 18, 21, 12, 15, 9], k=3) == 10", "assert candidate(n=15, edges=[[0, 1], [0, 2], [0, 3], [1, 4], [1, 5], [2, 6], [2, 7], [3, 8], [3, 9], [4, 10], [5, 11], [6, 12], [7, 13], [8, 14]], val...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=10, edges=[[0, 1], [0, 2], [1, 3], [1, 4], [2, 5], [2, 6], [3, 7], [4, 8], [5, 9]], values=[12, 15, 3, 6, 9, 18, 21, 12, 15, 9], k=3) == 10", "assert candidate(n=15, edges=[[0, 1], [0, 2], [0, 3], [1, 4], [1, 5], [2, 6], [2, 7], [3, 8], [3, 9], [4, 10], [5, 11], [6, 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 integer array nums.\nReturn the maximum value ov...
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. Return the maximum value over all triplets of indices (i, j, k) such that...
[ "assert candidate(nums=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150]) == 0", "assert candidate(nums=[1000000, 500000, 250000, 125000, 62500, 31250, 15625, 7812, 3906, 1953, 976, 488, 244, 122, 61, 30, 15, 7, 3, 1]) == 125000000000", "assert candidate(nums=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150]) == 0", "assert candidate(nums=[1000000, 500000, 250000, 125000, 62500, 31250, 15625, 7812, 3906, 1953, 976, 488, 244, 122, 61, 30, 15, 7, 3, 1]) == 125000000000", "assert candidate(nums=[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 a 0-indexed array nums and an integer target.\nA 0-indexed 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 array nums and an integer target. A 0-indexed array infinite_nums is generated by infinitely ...
[ "assert candidate(nums=[1, 2, 4, 8, 16, 32], target=127) == 13", "assert candidate(nums=[1, 3, 5, 7], target=15) == 3", "assert candidate(nums=[1, 10, 100, 1000, 10000], target=11111) == 5", "assert candidate(nums=[1, 1, 2, 2, 3, 3, 4, 4, 5, 5], target=30) == 10", "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[1, 2, 4, 8, 16, 32], target=127) == 13", "assert candidate(nums=[1, 3, 5, 7], target=15) == 3", "assert candidate(nums=[1, 10, 100, 1000, 10000], target=11111) == 5", "assert candidate(nums=[1, 1, 2, 2, 3, 3, 4, 4, 5, 5], target=30) == 10", "assert candid...
[ { "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 a directed graph consisting of n nodes numbered from 0 to n - 1 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: There is a directed graph consisting of n nodes numbered from 0 to n - 1 and n directed edges. You are given a 0-indexe...
[ "assert candidate(edges=[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, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(edges=[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, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,...
[ { "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 an integer k, you can perform the followin...
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 an integer k, you can perform the following operation on the array any number of times:...
[ "assert candidate(nums=[2, 4, 8, 16, 32, 64], k=1024) == 3", "assert candidate(nums=[1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10], k=36) == 12", "assert candidate(nums=[1, 0, 1, 0, 1, 0, 1, 0, 1, 0], k=1) == 1", "assert candidate(nums=[1, 10, 1, 10, 1, 10, 1, 10, 1, 10], k=100) == 3", "asse...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[2, 4, 8, 16, 32, 64], k=1024) == 3", "assert candidate(nums=[1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10], k=36) == 12", "assert candidate(nums=[1, 0, 1, 0, 1, 0, 1, 0, 1, 0], k=1) == 1", "assert candidate(nums=[1, 10, 1, 10, 1, 10, 1, 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 two 0-indexed binary strings s1 and s2, both of length n, 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: You are given two 0-indexed binary strings s1 and s2, both of length n, and a positive integer x. You can perform any o...
[ "assert candidate(s1='1111', s2='1111', x=3) == 0", "assert candidate(s1='10101010101010', s2='01010101010101', x=8) == 7", "assert candidate(s1='1100101010101010', s2='0110010101010101', x=5) == 8", "assert candidate(s1='111000111', s2='111111111', x=5) == -1", "assert candidate(s1='01010101010101', s2='10...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s1='1111', s2='1111', x=3) == 0", "assert candidate(s1='10101010101010', s2='01010101010101', x=8) == 7", "assert candidate(s1='1100101010101010', s2='0110010101010101', x=5) == 8", "assert candidate(s1='111000111', s2='111111111', x=5) == -1", "assert candidat...
[ { "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 and a positive integer k.\nYo...
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 and a positive integer k. You can do the following operation on the array ...
[ "assert candidate(nums=[65535, 65534, 65533, 65532, 65531, 65530, 65529, 65528, 65527, 65526, 65525, 65524, 65523, 65522, 65521], k=10) == 944430306", "assert candidate(nums=[134217728, 268435456, 536870912, 1073741824, 67108864, 134217728, 268435456, 536870912, 1073741824, 67108864], k=10) == 214664351", "asse...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[65535, 65534, 65533, 65532, 65531, 65530, 65529, 65528, 65527, 65526, 65525, 65524, 65523, 65522, 65521], k=10) == 944430306", "assert candidate(nums=[134217728, 268435456, 536870912, 1073741824, 67108864, 134217728, 268435456, 536870912, 1073741824, 67108864], k=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:\nGiven a 1-indexed integer array prices, where prices[i] is the price 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: Given a 1-indexed integer array prices, where prices[i] is the price of a particular stock on the ith day, your task is...
[ "assert candidate(prices=[2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24]) == 24", "assert candidate(prices=[7, 4, 1, 8, 5, 2, 9, 6, 3, 10]) == 15", "assert candidate(prices=[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39]) == 39", "assert candidate(prices=[10, 9, 8, 7, 6, 5, 4, 3, 2, 1...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(prices=[2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24]) == 24", "assert candidate(prices=[7, 4, 1, 8, 5, 2, 9, 6, 3, 10]) == 15", "assert candidate(prices=[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39]) == 39", "assert candidate(prices=[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 string array words, and an array groups, both arrays havin...
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 string array words, and an array groups, both arrays having length n. The hamming distance between two ...
[ "assert candidate(words=['same', 'sane', 'same'], groups=[1, 2, 1]) == ['same', 'sane', 'same']", "assert candidate(words=['abcd', 'abce', 'abcf', 'abcg', 'abch', 'abcx'], groups=[1, 2, 3, 4, 5, 6]) == ['abcd', 'abce', 'abcf', 'abcg', 'abch', 'abcx']", "assert candidate(words=['apple', 'appla', 'applu', 'applp'...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(words=['same', 'sane', 'same'], groups=[1, 2, 1]) == ['same', 'sane', 'same']", "assert candidate(words=['abcd', 'abce', 'abcf', 'abcg', 'abch', 'abcx'], groups=[1, 2, 3, 4, 5, 6]) == ['abcd', 'abce', 'abcf', 'abcg', 'abch', 'abcx']", "assert candidate(words=['apple', ...
[ { "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 having length n, an integer 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 integer array nums having length n, an integer indexDifference, and an integer valueDifferenc...
[ "assert candidate(nums=[9, 8, 7, 6, 5, 4, 3, 2, 1, 0], indexDifference=5, valueDifference=4) == [0, 5]", "assert candidate(nums=[10, 1, 20, 2, 30, 3, 40, 4, 50, 5], indexDifference=5, valueDifference=18) == [1, 6]", "assert candidate(nums=[100, 200, 150, 300, 250, 400, 350, 500], indexDifference=2, valueDiffere...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[9, 8, 7, 6, 5, 4, 3, 2, 1, 0], indexDifference=5, valueDifference=4) == [0, 5]", "assert candidate(nums=[10, 1, 20, 2, 30, 3, 40, 4, 50, 5], indexDifference=5, valueDifference=18) == [1, 6]", "assert candidate(nums=[100, 200, 150, 300, 250, 400, 350, 500], indexD...
[ { "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 2D integer matrix grid of size n * m, we define a 0-inde...
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 2D integer matrix grid of size n * m, we define a 0-indexed 2D matrix p of size n * m as the product ...
[ "assert candidate(grid=[[1000000, 2000000, 3000000], [4000000, 5000000, 6000000]]) == [[2145, 7245, 4830], [9795, 10305, 2415]]", "assert candidate(grid=[[123, 456, 789], [101, 202, 303], [404, 505, 606], [707, 808, 909]]) == [[6930, 6255, 9060], [7095, 9720, 6480], [4860, 6357, 3240], [11595, 2430, 2160]]", "a...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(grid=[[1000000, 2000000, 3000000], [4000000, 5000000, 6000000]]) == [[2145, 7245, 4830], [9795, 10305, 2415]]", "assert candidate(grid=[[123, 456, 789], [101, 202, 303], [404, 505, 606], [707, 808, 909]]) == [[6930, 6255, 9060], [7095, 9720, 6480], [4860, 6357, 3240], [115...
[ { "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 0-indexed arrays prices and profits of length n. There are n ite...
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 0-indexed arrays prices and profits of length n. There are n items in an store where the ith item has a price...
[ "assert candidate(prices=[100, 10, 20, 30, 40, 50], profits=[1, 100, 200, 300, 400, 500]) == 1200", "assert candidate(prices=[8, 6, 7, 5, 3, 0, 9], profits=[1, 2, 3, 4, 5, 6, 7]) == 12", "assert candidate(prices=[100, 200, 150, 300, 250, 400, 350, 500, 450, 600], profits=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(prices=[100, 10, 20, 30, 40, 50], profits=[1, 100, 200, 300, 400, 500]) == 1200", "assert candidate(prices=[8, 6, 7, 5, 3, 0, 9], profits=[1, 2, 3, 4, 5, 6, 7]) == 12", "assert candidate(prices=[100, 200, 150, 300, 250, 400, 350, 500, 450, 600], profits=[10, 20, 30, 40...
[ { "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 of integers.\nA triplet of indices (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 array nums of integers. A triplet of indices (i, j, k) is a mountain if: i < j < k nums[i] <...
[ "assert candidate(nums=[10, 20, 30, 15, 25, 35, 40, 10]) == 35", "assert candidate(nums=[8, 6, 1, 5, 3, 7, 2, 4, 9, 10, 11]) == 6", "assert candidate(nums=[7, 1, 5, 3, 6, 4, 2, 8, 10, 1, 12]) == 4", "assert candidate(nums=[3, 3, 3, 3, 3, 3, 3]) == -1", "assert candidate(nums=[1, 2, 3, 4, 5, 10, 1, 2, 3, 4, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[10, 20, 30, 15, 25, 35, 40, 10]) == 35", "assert candidate(nums=[8, 6, 1, 5, 3, 7, 2, 4, 9, 10, 11]) == 6", "assert candidate(nums=[7, 1, 5, 3, 6, 4, 2, 8, 10, 1, 12]) == 4", "assert candidate(nums=[3, 3, 3, 3, 3, 3, 3]) == -1", "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:\nGiven a string s and an integer k, partition s into k substrings such that...
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 string s and an integer k, partition s into k substrings such that the letter changes needed to make each subst...
[ "assert candidate(s='xyxyxyxyxyxyxy', k=3) == 0", "assert candidate(s='abcdcba', k=3) == 2", "assert candidate(s='mnopqrnopqr', k=3) == 4", "assert candidate(s='abracadabraabracadabra', k=4) == 5", "assert candidate(s='racecar', k=2) == 3", "assert candidate(s='abcabcabc', k=3) == 3", "assert candidate(...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='xyxyxyxyxyxyxy', k=3) == 0", "assert candidate(s='abcdcba', k=3) == 2", "assert candidate(s='mnopqrnopqr', k=3) == 4", "assert candidate(s='abracadabraabracadabra', k=4) == 5", "assert candidate(s='racecar', k=2) == 3", "assert candidate(s='abcabcabc', k...
[ { "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.\nThe distinct count of a sub...
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 distinct count of a subarray of nums is defined as: Let nums[i..j] b...
[ "assert candidate(nums=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200]) == 16170", "assert candidate(nums=[1, 1, 1, 2, 2, 2, 3, 3, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3]) == 1026", "assert candidate(nums=[10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 10, 9, 8, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200]) == 16170", "assert candidate(nums=[1, 1, 1, 2, 2, 2, 3, 3, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3]) == 1026", "assert candidate(nums=[10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 10, 9, 8, 7, 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:\nThere exists an undirected tree rooted at node 0 with n nodes labeled from...
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 exists an undirected tree rooted at node 0 with n nodes labeled from 0 to n - 1. You are given a 2D integer array...
[ "assert candidate(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]], coins=[100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500], k=50) == 11250", "assert candidate(edges=[[0, 1], [1, 2], [1, 3], [3, 4], [3, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(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]], coins=[100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500], k=50) == 11250", "assert candidate(edges=[[0, 1], [1, 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 the 0-indexed arrays prices and profits of length n. There are n ite...
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 0-indexed arrays prices and profits of length n. There are n items in an store where the ith item has a price...
[ "assert candidate(prices=[5000, 5000, 5000, 5000], profits=[500000, 400000, 300000, 200000]) == -1", "assert candidate(prices=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], profits=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]) == 57", "assert candidate(prices...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(prices=[5000, 5000, 5000, 5000], profits=[500000, 400000, 300000, 200000]) == -1", "assert candidate(prices=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], profits=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]) == 57", ...
[ { "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 tree with n nodes labeled from 0 to n - 1, and root...
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 tree with n nodes labeled from 0 to n - 1, and rooted at node 0. You are given a 2D integer arra...
[ "assert candidate(edges=[[0, 1], [0, 2], [1, 3], [1, 4], [2, 5], [2, 6]], values=[20, 10, 9, 7, 4, 3, 5]) == 40", "assert candidate(edges=[[0, 1], [1, 2], [1, 3], [2, 4], [2, 5], [3, 6], [3, 7], [4, 8], [4, 9], [5, 10], [5, 11], [6, 12], [6, 13]], values=[9, 8, 7, 6, 5, 4, 3, 2, 1, 9, 8, 7, 6, 5]) == 72", "asse...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(edges=[[0, 1], [0, 2], [1, 3], [1, 4], [2, 5], [2, 6]], values=[20, 10, 9, 7, 4, 3, 5]) == 40", "assert candidate(edges=[[0, 1], [1, 2], [1, 3], [2, 4], [2, 5], [3, 6], [3, 7], [4, 8], [4, 9], [5, 10], [5, 11], [6, 12], [6, 13]], values=[9, 8, 7, 6, 5, 4, 3, 2, 1, 9, 8, 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.\nA subsequence of nums havin...
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. A subsequence of nums having length k and consisting of indices i0 < i1 <...
[ "assert candidate(nums=[-10, -9, -8, -7, -6, -5, -4, -3, -2, -1]) == -1", "assert candidate(nums=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120]) == 780", "assert candidate(nums=[100, 200, 300, 400, 500, -100, -200, -300, -400, -500, 150, 250, 350, 450, 550]) == 2050", "assert candidate(nums=[-2, -1]) == ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[-10, -9, -8, -7, -6, -5, -4, -3, -2, -1]) == -1", "assert candidate(nums=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120]) == 780", "assert candidate(nums=[100, 200, 300, 400, 500, -100, -200, -300, -400, -500, 150, 250, 350, 450, 550]) == 2050", "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 two positive integers n and limit.\nReturn the total 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 two positive integers n and limit. Return the total number of ways to distribute n candies among 3 childr...
[ "assert candidate(n=150, limit=40) == 0", "assert candidate(n=99, limit=99) == 5050", "assert candidate(n=99999999, limit=33333333) == 1", "assert candidate(n=175, limit=50) == 0", "assert candidate(n=15, limit=5) == 1", "assert candidate(n=100000000, limit=100000000) == 5000000150000001", "assert candi...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=150, limit=40) == 0", "assert candidate(n=99, limit=99) == 5050", "assert candidate(n=99999999, limit=33333333) == 1", "assert candidate(n=175, limit=50) == 0", "assert candidate(n=15, limit=5) == 1", "assert candidate(n=100000000, limit=100000000) == 500...
[ { "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 integers n and limit.\nReturn the total 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 two positive integers n and limit. Return the total number of ways to distribute n candies among 3 childr...
[ "assert candidate(n=9, limit=3) == 1", "assert candidate(n=5, limit=2) == 3", "assert candidate(n=500, limit=10) == 0", "assert candidate(n=789012, limit=12345) == 0", "assert candidate(n=999, limit=100) == 0", "assert candidate(n=1000, limit=25) == 0", "assert candidate(n=500000, limit=150000) == 0", ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=9, limit=3) == 1", "assert candidate(n=5, limit=2) == 3", "assert candidate(n=500, limit=10) == 0", "assert candidate(n=789012, limit=12345) == 0", "assert candidate(n=999, limit=100) == 0", "assert candidate(n=1000, limit=25) == 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 an integer n.\nA string s is called good if it contains only...
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. A string s is called good if it contains only lowercase English characters and it is possib...
[ "assert candidate(n=20) == 291395991", "assert candidate(n=5) == 1460", "assert candidate(n=80) == 974106352", "assert candidate(n=3) == 0", "assert candidate(n=9) == 947613240", "assert candidate(n=4) == 12", "assert candidate(n=15) == 430509685", "assert candidate(n=125) == 558399309", "assert can...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=20) == 291395991", "assert candidate(n=5) == 1460", "assert candidate(n=80) == 974106352", "assert candidate(n=3) == 0", "assert candidate(n=9) == 947613240", "assert candidate(n=4) == 12", "assert candidate(n=15) == 430509685", "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 m * n integer matrix values, representing the va...
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 * n integer matrix values, representing the values of m * n different items in m different ...
[ "assert candidate(values=[[5, 3, 1], [4, 2, 0], [6, 4, 2], [7, 5, 3]]) == 354", "assert candidate(values=[[1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10]]) == 1176", "assert candidate(values=[[9, 7, 5, 3, 1], [8, 6, 4, 2, 0], [11, 9, 7, 5, 3], [10, 8, 6, 4, 2]]) == 1504", "assert candi...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(values=[[5, 3, 1], [4, 2, 0], [6, 4, 2], [7, 5, 3]]) == 354", "assert candidate(values=[[1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10]]) == 1176", "assert candidate(values=[[9, 7, 5, 3, 1], [8, 6, 4, 2, 0], [11, 9, 7, 5, 3], [10, 8, 6, 4, 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 2D 0-indexed array of strings, access_times, with size 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 2D 0-indexed array of strings, access_times, with size n. For each i where 0 <= i <= n - 1, access_time...
[ "assert candidate(access_times=[['v', '0900'], ['v', '0915'], ['v', '0930'], ['v', '0945'], ['v', '1000']]) == ['v']", "assert candidate(access_times=[['alice', '0800'], ['bob', '0801'], ['alice', '0830'], ['bob', '0900'], ['alice', '0930'], ['bob', '0931'], ['alice', '1000'], ['bob', '1030']]) == []", "assert ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(access_times=[['v', '0900'], ['v', '0915'], ['v', '0930'], ['v', '0945'], ['v', '1000']]) == ['v']", "assert candidate(access_times=[['alice', '0800'], ['bob', '0801'], ['alice', '0830'], ['bob', '0900'], ['alice', '0930'], ['bob', '0931'], ['alice', '1000'], ['bob', '1030...
[ { "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, both having l...
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, both having length n. You are allowed to perform a series ...
[ "assert candidate(nums1=[1000000000, 1, 1, 1, 1], nums2=[1, 1000000000, 1, 1, 1]) == -1", "assert candidate(nums1=[7, 3, 5, 8, 6], nums2=[2, 4, 1, 9, 5]) == -1", "assert candidate(nums1=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100], nums2=[100, 90, 80, 70, 60, 50, 40, 30, 20, 10]) == -1", "assert candidate(nums1=...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums1=[1000000000, 1, 1, 1, 1], nums2=[1, 1000000000, 1, 1, 1]) == -1", "assert candidate(nums1=[7, 3, 5, 8, 6], nums2=[2, 4, 1, 9, 5]) == -1", "assert candidate(nums1=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100], nums2=[100, 90, 80, 70, 60, 50, 40, 30, 20, 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. A pair of integers x and y 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 integer array nums. A pair of integers x and y is called a strong pair if it satisfies the co...
[ "assert candidate(nums=[1, 1000000, 2000000, 3000000, 4000000, 5000000, 6000000, 7000000, 8000000, 9000000, 10000000]) == 1558208", "assert candidate(nums=[2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30]) == 30", "assert candidate(nums=[1048575, 524287, 262143, 131071, 65535, 32767, 16383, 8191, 4095, 2...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[1, 1000000, 2000000, 3000000, 4000000, 5000000, 6000000, 7000000, 8000000, 9000000, 10000000]) == 1558208", "assert candidate(nums=[2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30]) == 30", "assert candidate(nums=[1048575, 524287, 262143, 131071, 65535, 32...
[ { "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 balls on a table, each ball has a color black or white.\nYou 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: There are n balls on a table, each ball has a color black or white. You are given a 0-indexed binary string s of length...
[ "assert candidate(s='00000000000000000000000000000000111111') == 0", "assert candidate(s='10000000001111111111100000000000111111111111100000000000') == 416", "assert candidate(s='000111111100000000') == 56", "assert candidate(s='01010101') == 6", "assert candidate(s='0101010101010101010101010101010101010101...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='00000000000000000000000000000000111111') == 0", "assert candidate(s='10000000001111111111100000000000111111111111100000000000') == 416", "assert candidate(s='000111111100000000') == 56", "assert candidate(s='01010101') == 6", "assert candidate(s='01010101010...
[ { "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 three integers a, b, and n, return the maximum value of (a XOR x) * ...
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 three integers a, b, and n, return the maximum value of (a XOR x) * (b XOR x) where 0 <= x < 2n. Since the answer...
[ "assert candidate(a=3, b=12, n=4) == 56", "assert candidate(a=2147483647, b=1, n=30) == 536396503", "assert candidate(a=123, b=456, n=10) == 647348", "assert candidate(a=123456789, b=987654321, n=35) == 251423918", "assert candidate(a=50, b=50, n=10) == 1046529", "assert candidate(a=7, b=3, n=3) == 21", ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(a=3, b=12, n=4) == 56", "assert candidate(a=2147483647, b=1, n=30) == 536396503", "assert candidate(a=123, b=456, n=10) == 647348", "assert candidate(a=123456789, b=987654321, n=35) == 251423918", "assert candidate(a=50, b=50, n=10) == 1046529", "assert can...
[ { "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 heights of positive integers, where height...
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 heights of positive integers, where heights[i] represents the height of the ith buildin...
[ "assert candidate(heights=[100, 200, 150, 250, 300, 100, 150, 200, 250, 300], queries=[[0, 9], [1, 8], [2, 7], [3, 6], [4, 5], [5, 4], [6, 3], [7, 2], [8, 1], [9, 0]]) == [9, 8, 7, 9, -1, -1, 9, 7, 8, 9]", "assert candidate(heights=[100, 90, 80, 70, 60, 50, 40, 30, 20, 10], queries=[[0, 1], [1, 2], [2, 3], [3, 4]...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(heights=[100, 200, 150, 250, 300, 100, 150, 200, 250, 300], queries=[[0, 9], [1, 8], [2, 7], [3, 6], [4, 5], [5, 4], [6, 3], [7, 2], [8, 1], [9, 0]]) == [9, 8, 7, 9, -1, -1, 9, 7, 8, 9]", "assert candidate(heights=[100, 90, 80, 70, 60, 50, 40, 30, 20, 10], queries=[[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 an array of integers nums and an integer k.\nThe gcd-sum 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 integers nums and an integer k. The gcd-sum of an array a is calculated as follows: Let s be...
[ "assert candidate(nums=[100000, 200000, 300000, 400000, 500000, 600000, 700000, 800000, 900000, 1000000], k=5) == 550000000000", "assert candidate(nums=[1000000, 1000000, 1000000, 1000000], k=4) == 4000000000000", "assert candidate(nums=[1000000, 1000000, 1000000, 1000000, 1000000, 1000000, 1000000, 1000000, 10...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[100000, 200000, 300000, 400000, 500000, 600000, 700000, 800000, 900000, 1000000], k=5) == 550000000000", "assert candidate(nums=[1000000, 1000000, 1000000, 1000000], k=4) == 4000000000000", "assert candidate(nums=[1000000, 1000000, 1000000, 1000000, 1000000, 1000...
[ { "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 two integers, n and m and two integer arrays, hBars 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 the two integers, n and m and two integer arrays, hBars and vBars. The grid has n + 2 horizontal and m + ...
[ "assert candidate(n=7, m=7, hBars=[2, 3, 5, 6], vBars=[2, 4, 5, 7]) == 9", "assert candidate(n=10, m=20, hBars=[2, 3, 4, 5, 6], vBars=[5, 10, 15, 20]) == 4", "assert candidate(n=2, m=3, hBars=[2, 3], vBars=[2, 4]) == 4", "assert candidate(n=150, m=100, hBars=[10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=7, m=7, hBars=[2, 3, 5, 6], vBars=[2, 4, 5, 7]) == 9", "assert candidate(n=10, m=20, hBars=[2, 3, 4, 5, 6], vBars=[5, 10, 15, 20]) == 4", "assert candidate(n=2, m=3, hBars=[2, 3], vBars=[2, 4]) == 4", "assert candidate(n=150, m=100, hBars=[10, 12, 14, 16, 18, 20,...