prompt
listlengths
1
1
query
stringlengths
578
3.33k
constraints
listlengths
10
10
data_source
stringclasses
1 value
extra_info
dict
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a positive integer days representing the total number of day...
You are an expert Python 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 days representing the total number of days an employee is available for work (starting...
[ "assert candidate(days=1000, meetings=[[1, 5], [2, 6], [3, 7], [4, 8], [5, 9], [6, 10], [7, 11], [8, 12], [9, 13], [10, 14]]) == 986", "assert candidate(days=1000000, meetings=[[1, 1000000], [100000, 200000], [200000, 300000], [300000, 400000], [400000, 500000], [500000, 600000], [600000, 700000], [700000, 800000...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(days=1000, meetings=[[1, 5], [2, 6], [3, 7], [4, 8], [5, 9], [6, 10], [7, 11], [8, 12], [9, 13], [10, 14]]) == 986", "assert candidate(days=1000000, meetings=[[1, 1000000], [100000, 200000], [200000, 300000], [300000, 400000], [400000, 500000], [500000, 600000], [600000, 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 string s. It may contain any number of '*' characters. You...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a string s. It may contain any number of '*' characters. Your task is to remove all '*' characters. While...
[ "assert candidate(s='abc*def*ghi*') == 'defghi'", "assert candidate(s='aaabbbccc***') == 'bbbccc'", "assert candidate(s='abc') == 'abc'", "assert candidate(s='abcabcabc***abc') == 'bcbcbcabc'", "assert candidate(s='z*z*z*z*z*z*z*z*z*z*z*z*z*z*z*z') == 'z'", "assert candidate(s='aabbccddeee***f***') == 'dd...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='abc*def*ghi*') == 'defghi'", "assert candidate(s='aaabbbccc***') == 'bbbccc'", "assert candidate(s='abc') == 'abc'", "assert candidate(s='abcabcabc***abc') == 'bcbcbcabc'", "assert candidate(s='z*z*z*z*z*z*z*z*z*z*z*z*z*z*z*z') == 'z'", "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 array nums and an integer k. You need to find a 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 an array nums and an integer k. You need to find a subarray of nums such that the absolute difference bet...
[ "assert candidate(nums=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100], k=55) == 3", "assert candidate(nums=[2, 4, 8, 16, 32, 64, 128, 256, 512, 1024], k=500) == 4", "assert candidate(nums=[3, 5, 7, 9, 11, 13, 15, 17, 19, 21], k=10) == 1", "assert candidate(nums=[2, 4, 6, 8, 10], k=7) == 1", "assert candidate(num...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100], k=55) == 3", "assert candidate(nums=[2, 4, 8, 16, 32, 64, 128, 256, 512, 1024], k=500) == 4", "assert candidate(nums=[3, 5, 7, 9, 11, 13, 15, 17, 19, 21], k=10) == 1", "assert candidate(nums=[2, 4, 6, 8, 10], k=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 an integer array nums and a non-negative integer k. A sequen...
You are an expert Python 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 a non-negative integer k. A sequence of integers seq is called good if there ar...
[ "assert candidate(nums=[5, 4, 3, 2, 1, 5, 4, 3, 2, 1, 5, 4, 3, 2, 1, 5, 4, 3, 2, 1, 5, 4, 3, 2, 1, 5, 4, 3, 2, 1, 5], k=5) == 11", "assert candidate(nums=[1, 1, 1, 2, 2, 3, 3, 3, 2, 2, 1, 1, 1], k=5) == 13", "assert candidate(nums=[1], k=0) == 1", "assert candidate(nums=[1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7,...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[5, 4, 3, 2, 1, 5, 4, 3, 2, 1, 5, 4, 3, 2, 1, 5, 4, 3, 2, 1, 5, 4, 3, 2, 1, 5, 4, 3, 2, 1, 5], k=5) == 11", "assert candidate(nums=[1, 1, 1, 2, 2, 3, 3, 3, 2, 2, 1, 1, 1], k=5) == 13", "assert candidate(nums=[1], k=0) == 1", "assert candidate(nums=[1, 1, 2, 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 two integers n and k.\nInitially, you start with an array 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 two integers n and k. Initially, you start with an array a of n integers where a[i] = 1 for all 0 <= i <=...
[ "assert candidate(n=50, k=50) == 769496025", "assert candidate(n=6, k=8) == 1287", "assert candidate(n=7, k=20) == 230230", "assert candidate(n=8, k=7) == 3432", "assert candidate(n=200, k=200) == 793946740", "assert candidate(n=6, k=15) == 15504", "assert candidate(n=100, k=50) == 475860182", "assert...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=50, k=50) == 769496025", "assert candidate(n=6, k=8) == 1287", "assert candidate(n=7, k=20) == 230230", "assert candidate(n=8, k=7) == 3432", "assert candidate(n=200, k=200) == 793946740", "assert candidate(n=6, k=15) == 15504", "assert candidate(n=10...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an integer array rewardValues of length n, representing the ...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given an integer array rewardValues of length n, representing the values of rewards. Initially, your total rewa...
[ "assert candidate(rewardValues=[10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10]) == 10", "assert candidate(rewardValues=[1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10]) == 19", "assert candidate(rewardValues=[1000, 500, 250, 125, 62, 31, 15, 7, 3, 1, 2, 4, 8, 16, 3...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(rewardValues=[10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10]) == 10", "assert candidate(rewardValues=[1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10]) == 19", "assert candidate(rewardValues=[1000, 500, 250, 125, 62, 31, 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 integer array rewardValues of length n, representing the ...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given an integer array rewardValues of length n, representing the values of rewards. Initially, your total rewa...
[ "assert candidate(rewardValues=[42, 35, 18, 27, 5, 14, 8, 23, 9, 22]) == 83", "assert candidate(rewardValues=[2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768]) == 65534", "assert candidate(rewardValues=[1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536])...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(rewardValues=[42, 35, 18, 27, 5, 14, 8, 23, 9, 22]) == 83", "assert candidate(rewardValues=[2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768]) == 65534", "assert candidate(rewardValues=[1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 81...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou have an infinite number of coins with values 1, 2, and 6, and only 2 c...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You have an infinite number of coins with values 1, 2, and 6, and only 2 coins with value 4. Given an integer n, return...
[ "assert candidate(n=125) == 1954", "assert candidate(n=40000) == 200010001", "assert candidate(n=60) == 466", "assert candidate(n=2) == 2", "assert candidate(n=100) == 1276", "assert candidate(n=5000) == 3126251", "assert candidate(n=5) == 4", "assert candidate(n=1000) == 125251", "assert candidate(...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=125) == 1954", "assert candidate(n=40000) == 200010001", "assert candidate(n=60) == 466", "assert candidate(n=2) == 2", "assert candidate(n=100) == 1276", "assert candidate(n=5000) == 3126251", "assert candidate(n=5) == 4", "assert candidate(n=100...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven an integer array hours representing times in hours, return 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: Given an integer array hours representing times in hours, return an integer denoting the number of pairs i, j where i <...
[ "assert candidate(hours=[123456789, 123456789, 246913578, 246913578, 370370370, 370370370, 493826958, 493826958, 617283546, 617283546, 740740134, 740740134]) == 24", "assert candidate(hours=[5, 19, 29, 35, 43, 59, 65, 77, 83, 95, 101, 113, 119, 131, 137, 149, 155, 167, 173, 185, 191, 203, 209, 221, 227]) == 14", ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(hours=[123456789, 123456789, 246913578, 246913578, 370370370, 370370370, 493826958, 493826958, 617283546, 617283546, 740740134, 740740134]) == 24", "assert candidate(hours=[5, 19, 29, 35, 43, 59, 65, 77, 83, 95, 101, 113, 119, 131, 137, 149, 155, 167, 173, 185, 191, 203, 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:\nA magician has various spells.\nYou are given an array power, where each 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: A magician has various spells. You are given an array power, where each element represents the damage of a spell. Multi...
[ "assert candidate(power=[1, 1, 1, 2, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15]) == 73", "assert candidate(power=[5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105, 110, 115, 120, 125, 130, 135, 140, 145, 150]) == 2325", "assert candidate(power=[5, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(power=[1, 1, 1, 2, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15]) == 73", "assert candidate(power=[5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105, 110, 115, 120, 125, 130, 135, 140, 145, 150]) == 2325", "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:\nA peak in an array arr is an element that is greater than its previous and...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: A peak in an array arr is an element that is greater than its previous and next element in arr. You are given an intege...
[ "assert candidate(nums=[10, 9, 8, 7, 6, 5, 4, 3, 2, 1], queries=[[1, 0, 9], [2, 1, 10], [1, 0, 8], [2, 3, 9], [1, 2, 7]]) == [0, 0, 1]", "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], queries=[[1, 0, 9], [2, 4, 5], [1, 0, 9], [2, 2, 3], [1, 0, 9], [2, 6, 7], [1, 0, 9]]) == [0, 0, 0, 0]", "assert candid...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[10, 9, 8, 7, 6, 5, 4, 3, 2, 1], queries=[[1, 0, 9], [2, 1, 10], [1, 0, 8], [2, 3, 9], [1, 2, 7]]) == [0, 0, 1]", "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], queries=[[1, 0, 9], [2, 4, 5], [1, 0, 9], [2, 2, 3], [1, 0, 9], [2, 6, 7], [1, 0, 9]]) == [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:\nGiven a 2D array rooks of length n, where rooks[i] = [xi, yi] indicates 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 a 2D array rooks of length n, where rooks[i] = [xi, yi] indicates the position of a rook on an n x n chess board....
[ "assert candidate(rooks=[[0, 4], [1, 2], [2, 0], [3, 3], [4, 1]]) == 0", "assert candidate(rooks=[[0, 1], [1, 3], [2, 4], [3, 2], [4, 0]]) == 0", "assert candidate(rooks=[[1, 1], [2, 2], [0, 3], [3, 0], [4, 4]]) == 0", "assert candidate(rooks=[[0, 0], [0, 1], [0, 2], [0, 3]]) == 6", "assert candidate(rooks=...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(rooks=[[0, 4], [1, 2], [2, 0], [3, 3], [4, 1]]) == 0", "assert candidate(rooks=[[0, 1], [1, 3], [2, 4], [3, 2], [4, 0]]) == 0", "assert candidate(rooks=[[1, 1], [2, 2], [0, 3], [3, 0], [4, 4]]) == 0", "assert candidate(rooks=[[0, 0], [0, 1], [0, 2], [0, 3]]) == 6",...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a binary array nums.\nYou can do the following operation on ...
You are an expert Python 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 binary array nums. You can do the following operation on the array any number of times (possibly zero):...
[ "assert candidate(nums=[1, 1, 1, 1, 1, 1, 1]) == 0", "assert candidate(nums=[0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1]) == -1", "assert candidate(nums=[1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0]) == 6", "assert candidate(nums=[0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0]) == 8", "assert candidate(nums=[1,...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[1, 1, 1, 1, 1, 1, 1]) == 0", "assert candidate(nums=[0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1]) == -1", "assert candidate(nums=[1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0]) == 6", "assert candidate(nums=[0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0]) == 8", ...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a binary array nums.\nYou can do the following operation on ...
You are an expert Python 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 binary array nums. You can do the following operation on the array any number of times (possibly zero):...
[ "assert candidate(nums=[1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1]) == 14", "assert candidate(nums=[1, 0, 1, 0, 1, 0]) == 5", "assert candidate(nums=[0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0]) == 3", "assert candidate(nums=[1, 1, 1, 1, 1, 0, 0, 0, 0, 0]) == 1", "assert candidate(nums=[1, 1, 1,...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1]) == 14", "assert candidate(nums=[1, 0, 1, 0, 1, 0]) == 5", "assert candidate(nums=[0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0]) == 3", "assert candidate(nums=[1, 1, 1, 1, 1, 0, 0, 0, 0, 0]) == 1", "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:\nYou are given an integer n and a 2D array requirements, where requirements...
You are an expert Python 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 and a 2D array requirements, where requirements[i] = [endi, cnti] represents the end index a...
[ "assert candidate(n=8, requirements=[[7, 10], [6, 5], [5, 2], [4, 1], [3, 0], [2, 0], [1, 0], [0, 0]]) == 1", "assert candidate(n=15, requirements=[[14, 105], [13, 84], [12, 63], [11, 42], [10, 28], [9, 21], [8, 15], [7, 10], [6, 6], [5, 4], [4, 2], [3, 1], [2, 1], [1, 0], [0, 0]]) == 0", "assert candidate(n=10...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=8, requirements=[[7, 10], [6, 5], [5, 2], [4, 1], [3, 0], [2, 0], [1, 0], [0, 0]]) == 1", "assert candidate(n=15, requirements=[[14, 105], [13, 84], [12, 63], [11, 42], [10, 28], [9, 21], [8, 15], [7, 10], [6, 6], [5, 4], [4, 2], [3, 1], [2, 1], [1, 0], [0, 0]]) == 0", ...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 2D binary array grid. Find a rectangle with horizontal and...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 2D binary array grid. Find a rectangle with horizontal and vertical sides with the smallest area, such ...
[ "assert candidate(grid=[[0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 1, 1, 1, 0, 0], [0, 0, 1, 0, 0, 1, 0, 0], [0, 0, 1, 0, 0, 1, 0, 0], [0, 0, 1, 1, 1, 1, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0]]) == 16", "assert candidate(grid=[[0, 0, 0, 0, 0, 0, 0, 1, 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, 0, 0, 0, 0], [0, 0, 1, 1, 1, 1, 0, 0], [0, 0, 1, 0, 0, 1, 0, 0], [0, 0, 1, 0, 0, 1, 0, 0], [0, 0, 1, 1, 1, 1, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0]]) == 16", "assert candidate(grid=[[0, 0, 0, 0, 0, 0, 0, 1, 0...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an integer array nums.\nA subsequence sub of nums with lengt...
You are an expert Python 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. A subsequence sub of nums with length x is called valid if it satisfies: (sub[0] ...
[ "assert candidate(nums=[1, 2, 1, 1, 2, 1, 2]) == 6", "assert candidate(nums=[2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11]) == 10", "assert candidate(nums=[2, 2, 2, 2, 2, 2, 2, 2, 2, 2]) == 10", "assert candidate(nums=[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[1, 2, 1, 1, 2, 1, 2]) == 6", "assert candidate(nums=[2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11]) == 10", "assert candidate(nums=[2, 2, 2, 2, 2, 2, 2, 2, 2, 2]) == 10", "assert candidate(nums=[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25,...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an integer array nums and a positive integer k.\nA subsequen...
You are an expert Python 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 a positive integer k. A subsequence sub of nums with length x is called valid i...
[ "assert candidate(nums=[10, 20, 30, 40, 50], k=10) == 5", "assert candidate(nums=[7, 14, 21, 28, 35, 42, 49, 56, 63, 70, 77, 84, 91, 98, 105], k=7) == 15", "assert candidate(nums=[1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 2097152], k=17)...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[10, 20, 30, 40, 50], k=10) == 5", "assert candidate(nums=[7, 14, 21, 28, 35, 42, 49, 56, 63, 70, 77, 84, 91, 98, 105], k=7) == 15", "assert candidate(nums=[1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288,...
[ { "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 exist two undirected trees with n and m nodes, numbered from 0 to 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: There exist two undirected trees with n and m nodes, numbered from 0 to n - 1 and from 0 to m - 1, respectively. You ar...
[ "assert candidate(edges1=[[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10]], edges2=[[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10], [10, 11]]) == 12", "assert candidate(edges1=[[0, 1], [0, 2], [1, 3], [1, 4], [2, 5], [2, 6], [5, 7], [6, 8], [8, 9], ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(edges1=[[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10]], edges2=[[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10], [10, 11]]) == 12", "assert candidate(edges1=[[0, 1], [0, 2], [1, 3], [1, 4], [2, 5], [2, 6], [...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven an array nums, you have to get the maximum score starting from index...
You are an expert Python 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 array nums, you have to get the maximum score starting from index 0 and hopping until you reach the last eleme...
[ "assert candidate(nums=[10, 20, 30, 40, 50]) == 200", "assert candidate(nums=[3, 4, 5, 6, 7]) == 28", "assert candidate(nums=[1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10]) == 110", "assert candidate(nums=[15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]) == 105", "assert candidate(nums=[10000, 5000, 7500, 25...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[10, 20, 30, 40, 50]) == 200", "assert candidate(nums=[3, 4, 5, 6, 7]) == 28", "assert candidate(nums=[1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10]) == 110", "assert candidate(nums=[15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]) == 105", "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 an integer array enemyEnergies denoting the energy values 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 integer array enemyEnergies denoting the energy values of various enemies. You are also given an integ...
[ "assert candidate(enemyEnergies=[5, 4, 3, 2, 1], currentEnergy=15) == 29", "assert candidate(enemyEnergies=[5, 3, 1, 2, 4, 6], currentEnergy=3) == 23", "assert candidate(enemyEnergies=[5, 3, 7, 2, 8, 1, 4], currentEnergy=10) == 39", "assert candidate(enemyEnergies=[20, 20, 20, 20, 20, 20, 20, 20, 20, 20], cur...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(enemyEnergies=[5, 4, 3, 2, 1], currentEnergy=15) == 29", "assert candidate(enemyEnergies=[5, 3, 1, 2, 4, 6], currentEnergy=3) == 23", "assert candidate(enemyEnergies=[5, 3, 7, 2, 8, 1, 4], currentEnergy=10) == 39", "assert candidate(enemyEnergies=[20, 20, 20, 20, 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 positive integer n.\nA binary string x is valid if all 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 positive integer n. A binary string x is valid if all substrings of x of length 2 contain at least one ...
[ "assert candidate(n=10) == ['0101010101', '0101010110', '0101010111', '0101011010', '0101011011', '0101011101', '0101011110', '0101011111', '0101101010', '0101101011', '0101101101', '0101101110', '0101101111', '0101110101', '0101110110', '0101110111', '0101111010', '0101111011', '0101111101', '0101111110', '0101111...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=10) == ['0101010101', '0101010110', '0101010111', '0101011010', '0101011011', '0101011101', '0101011110', '0101011111', '0101101010', '0101101011', '0101101101', '0101101110', '0101101111', '0101110101', '0101110110', '0101110111', '0101111010', '0101111011', '0101111101', '...
[ { "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 target, an array of strings words, and an integer 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 string target, an array of strings words, and an integer array costs, both arrays of the same length. I...
[ "assert candidate(target='xyzxyzxyzxyz', words=['xyz', 'xy', 'zxyz', 'zxy'], costs=[7, 5, 10, 8]) == 28", "assert candidate(target='hello', words=['h', 'he', 'hel', 'hell', 'hello'], costs=[5, 4, 3, 2, 1]) == 1", "assert candidate(target='abcabcabcabcabcabc', words=['abc', 'abcabc', 'abcabcabc', 'a', 'b', 'c'],...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(target='xyzxyzxyzxyz', words=['xyz', 'xy', 'zxyz', 'zxy'], costs=[7, 5, 10, 8]) == 28", "assert candidate(target='hello', words=['h', 'he', 'hel', 'hell', 'hello'], costs=[5, 4, 3, 2, 1]) == 1", "assert candidate(target='abcabcabcabcabcabc', words=['abc', 'abcabc', 'ab...
[ { "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 integer arrays a, b, and c, return the number of triplets (a[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: Given three integer arrays a, b, and c, return the number of triplets (a[i], b[j], c[k]), such that the bitwise XOR bet...
[ "assert candidate(a=[1, 2, 4, 8, 16, 32, 64, 128, 256, 512], b=[1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288], c=[1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 134217728, 268435456, 536870912]) == 0", "assert candidate(a=[2147483647, 1073741823, 536870911, 268435455, 134...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(a=[1, 2, 4, 8, 16, 32, 64, 128, 256, 512], b=[1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288], c=[1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 134217728, 268435456, 536870912]) == 0", "assert candidate(a=[2147483647, 1073741823, 53...
[ { "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 the head of a linked list. Ret...
You are an expert Python 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 the head of a linked list. Return the head of the modified linked list afte...
[ "assert is_same_list(candidate(nums=[1, 3, 5, 7, 9], head=list_node([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])), list_node([2, 4, 6, 8, 10]))", "assert is_same_list(candidate(nums=[5, 15, 25, 35, 45, 55, 65, 75, 85, 95], head=list_node([5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100])), list...
newfacade/LeetCodeDataset
{ "constraints": [ "assert is_same_list(candidate(nums=[1, 3, 5, 7, 9], head=list_node([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])), list_node([2, 4, 6, 8, 10]))", "assert is_same_list(candidate(nums=[5, 15, 25, 35, 45, 55, 65, 75, 85, 95], head=list_node([5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 8...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nThere is an m x n cake that needs to be cut into 1 x 1 pieces.\nYou 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 an m x n cake that needs to be cut into 1 x 1 pieces. You are given integers m, n, and two arrays: horizontal...
[ "assert candidate(m=20, n=15, horizontalCut=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], verticalCut=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]) == 1835", "assert candidate(m=10, n=8, horizontalCut=[10, 20, 30, 40, 50, 60, 70, 80, 90], verticalCut=[5, 15, 25, 35, 45, 55, 65, 75]) == 2...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(m=20, n=15, horizontalCut=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], verticalCut=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]) == 1835", "assert candidate(m=10, n=8, horizontalCut=[10, 20, 30, 40, 50, 60, 70, 80, 90], verticalCut=[5, 15, 25, 35...
[ { "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 m x n cake that needs to be cut into 1 x 1 pieces.\nYou 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 an m x n cake that needs to be cut into 1 x 1 pieces. You are given integers m, n, and two arrays: horizontal...
[ "assert candidate(m=15, n=10, horizontalCut=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], verticalCut=[1, 2, 3, 4, 5, 6, 7, 8, 9]) == 660", "assert candidate(m=3, n=2, horizontalCut=[1, 3], verticalCut=[5]) == 13", "assert candidate(m=7, n=8, horizontalCut=[10, 20, 30, 40, 50, 60], verticalCut=[5, 10, 15, 20...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(m=15, n=10, horizontalCut=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], verticalCut=[1, 2, 3, 4, 5, 6, 7, 8, 9]) == 660", "assert candidate(m=3, n=2, horizontalCut=[1, 3], verticalCut=[5]) == 13", "assert candidate(m=7, n=8, horizontalCut=[10, 20, 30, 40, 50, 60], v...
[ { "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 array nums, you have to get the maximum score starting from index...
You are an expert Python 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 array nums, you have to get the maximum score starting from index 0 and hopping until you reach the last eleme...
[ "assert candidate(nums=[5, 3, 7, 1, 9, 2, 8, 4, 6, 10]) == 90", "assert candidate(nums=[5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5]) == 70", "assert candidate(nums=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 100000]) == 1900000", "assert candidate(nums=[3, 1, 5, 2, 4, 6, 8, 7, 9, 10, 11]) == 11...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[5, 3, 7, 1, 9, 2, 8, 4, 6, 10]) == 90", "assert candidate(nums=[5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5]) == 70", "assert candidate(nums=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 100000]) == 1900000", "assert candidate(nums=[3, 1, 5, 2, 4,...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an integer array nums of size n where n is even, and an inte...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given an integer array nums of size n where n is even, and an integer k. You can perform some changes on the ar...
[ "assert candidate(nums=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160], k=160) == 7", "assert candidate(nums=[0, 1, 2, 3, 0, 1, 2, 3, 0, 1], k=3) == 0", "assert candidate(nums=[9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9], k=9) == 0", "assert candidate(nums=[2, 2, 2, 2, 2, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160], k=160) == 7", "assert candidate(nums=[0, 1, 2, 3, 0, 1, 2, 3, 0, 1], k=3) == 0", "assert candidate(nums=[9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9], k=9) == 0", "assert cand...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a binary string s.\nYou can perform the following operation ...
You are an expert Python 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 binary string s. You can perform the following operation on the string any number of times: Choose any...
[ "assert candidate(s='10101010101010101010') == 55", "assert candidate(s='1100011') == 2", "assert candidate(s='00000000001111111111') == 0", "assert candidate(s='1001001001001001001') == 21", "assert candidate(s='1001001001001001001001001001001001001001') == 91", "assert candidate(s='100000010000001') == ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='10101010101010101010') == 55", "assert candidate(s='1100011') == 2", "assert candidate(s='00000000001111111111') == 0", "assert candidate(s='1001001001001001001') == 21", "assert candidate(s='1001001001001001001001001001001001001001') == 91", "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 two positive integer arrays nums and target, of the same len...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given two positive integer arrays nums and target, of the same length. In a single operation, you can select an...
[ "assert candidate(nums=[1, 1, 2, 2, 3, 3, 4, 4], target=[4, 4, 3, 3, 2, 2, 1, 1]) == 6", "assert candidate(nums=[10, 20, 30, 40, 50], target=[50, 40, 30, 20, 10]) == 80", "assert candidate(nums=[1, 1, 1, 1, 1], target=[10, 10, 10, 10, 10]) == 9", "assert candidate(nums=[3, 5, 2, 8, 4], target=[6, 8, 7, 4, 3])...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[1, 1, 2, 2, 3, 3, 4, 4], target=[4, 4, 3, 3, 2, 2, 1, 1]) == 6", "assert candidate(nums=[10, 20, 30, 40, 50], target=[50, 40, 30, 20, 10]) == 80", "assert candidate(nums=[1, 1, 1, 1, 1], target=[10, 10, 10, 10, 10]) == 9", "assert candidate(nums=[3, 5, 2, 8, ...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given 2 positive integers l and r. For any number x, all positive ...
You are an expert Python 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 2 positive integers l and r. For any number x, all positive divisors of x except x are called the proper ...
[ "assert candidate(l=4, r=1000000) == 999829", "assert candidate(l=1000000, r=1000010) == 11", "assert candidate(l=100000000, r=100010000) == 10001", "assert candidate(l=97, r=101) == 5", "assert candidate(l=999999950, r=1000000000) == 51", "assert candidate(l=1, r=1000000) == 999832", "assert candidate(...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(l=4, r=1000000) == 999829", "assert candidate(l=1000000, r=1000010) == 11", "assert candidate(l=100000000, r=100010000) == 10001", "assert candidate(l=97, r=101) == 5", "assert candidate(l=999999950, r=1000000000) == 51", "assert candidate(l=1, r=1000000) =...
[ { "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 binary string s.\nReturn the number of substrings with dom...
You are an expert Python 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 binary string s. Return the number of substrings with dominant ones. A string has dominant ones if the ...
[ "assert candidate(s='111110000111100001111') == 58", "assert candidate(s='111000111000111000') == 33", "assert candidate(s='1001001001') == 10", "assert candidate(s='1010100000') == 10", "assert candidate(s='1111000000000000111111111111') == 118", "assert candidate(s='000111000111000111000') == 36", "as...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='111110000111100001111') == 58", "assert candidate(s='111000111000111000') == 33", "assert candidate(s='1001001001') == 10", "assert candidate(s='1010100000') == 10", "assert candidate(s='1111000000000000111111111111') == 118", "assert candidate(s='000111...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an m x n binary matrix grid.\nA row or column is considered ...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given an m x n binary matrix grid. A row or column is considered palindromic if its values read the same forwar...
[ "assert candidate(grid=[[0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0], [0, 1, 0, 1, 0, 1, 0, 1, 0, 1]]) == 0", "assert candidate(grid=[[0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0], [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0]]) == 24", ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(grid=[[0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0], [0, 1, 0, 1, 0, 1, 0, 1, 0, 1]]) == 0", "assert candidate(grid=[[0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0], [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [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:\nYou are given an m x n binary matrix grid.\nA row or column is considered ...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given an m x n binary matrix grid. A row or column is considered palindromic if its values read the same forwar...
[ "assert candidate(grid=[[1, 0, 0, 0, 0, 1], [0, 1, 0, 0, 1, 0], [0, 0, 1, 1, 0, 0], [0, 0, 1, 1, 0, 0], [0, 1, 0, 0, 1, 0], [1, 0, 0, 0, 0, 1]]) == 0", "assert candidate(grid=[[1, 1, 1, 0, 0, 0, 1, 1, 1], [1, 1, 0, 0, 0, 0, 0, 1, 1], [1, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 1, 1, 1, 1, 0, 0], [0, 0, 0, 1, 1, 1, 1, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(grid=[[1, 0, 0, 0, 0, 1], [0, 1, 0, 0, 1, 0], [0, 0, 1, 1, 0, 0], [0, 0, 1, 1, 0, 0], [0, 1, 0, 0, 1, 0], [1, 0, 0, 0, 0, 1]]) == 0", "assert candidate(grid=[[1, 1, 1, 0, 0, 0, 1, 1, 1], [1, 1, 0, 0, 0, 0, 0, 1, 1], [1, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 1, 1, 1, 1, 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 exists an undirected tree with n nodes numbered 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 exists an undirected tree with n nodes numbered 0 to n - 1. You are given a 2D integer array edges of length n - ...
[ "assert candidate(edges=[[0, 10], [0, 11], [0, 12], [10, 1], [11, 2], [12, 3], [1, 4], [2, 5], [3, 6], [4, 7], [5, 8], [6, 9]]) == [6, 10, 9, 10, 11, 11, 11, 13, 12, 13, 8, 8, 8]", "assert candidate(edges=[[25, 18], [25, 24], [25, 19], [25, 20], [25, 21], [25, 22], [25, 23], [25, 2], [25, 0], [25, 1], [25, 10], [...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(edges=[[0, 10], [0, 11], [0, 12], [10, 1], [11, 2], [12, 3], [1, 4], [2, 5], [3, 6], [4, 7], [5, 8], [6, 9]]) == [6, 10, 9, 10, 11, 11, 11, 13, 12, 13, 8, 8, 8]", "assert candidate(edges=[[25, 18], [25, 24], [25, 19], [25, 20], [25, 21], [25, 22], [25, 23], [25, 2], [25, 0...