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 two strings s and sub. You are also given a 2D character arr...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given two strings s and sub. You are also given a 2D character array mappings where mappings[i] = [oldi, newi] ...
[ "assert candidate(s='aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ0123456789', sub='abcdef', mappings=[['a', 'A'], ['b', 'B'], ['c', 'C'], ['d', 'D'], ['e', 'E'], ['f', 'F'], ['0', 'a'], ['1', 'b']]) == False", "assert candidate(s='abcXYZ123defGHI456', sub='xyz', mappings=[['x', 'X'], ['y', 'Y'], ['z', 'Z'...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ0123456789', sub='abcdef', mappings=[['a', 'A'], ['b', 'B'], ['c', 'C'], ['d', 'D'], ['e', 'E'], ['f', 'F'], ['0', 'a'], ['1', 'b']]) == False", "assert candidate(s='abcXYZ123defGHI456', sub='xyz', mappings=[['x', 'X']...
[ { "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 integer matrix grid consisting of distinct...
You are an expert Python 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 integer matrix grid consisting of distinct integers from 0 to m * n - 1. You can move i...
[ "assert candidate(grid=[[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]], moveCost=[[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]]) == 61", "assert candidate(grid=[[1, 3, 5], [2, 4, 6], [7, 8, 9]], moveCo...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(grid=[[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]], moveCost=[[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]]) == 61", "assert candidate(grid=[[1, 3, 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 cookies, where cookies[i] denotes the numbe...
You are an expert Python 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 cookies, where cookies[i] denotes the number of cookies in the ith bag. You are also giv...
[ "assert candidate(cookies=[10, 20, 30, 40, 50, 60, 70, 80, 90], k=3) == 150", "assert candidate(cookies=[1, 2, 3, 4, 5, 6, 7, 8], k=7) == 8", "assert candidate(cookies=[1, 1, 1, 1, 1, 1, 1, 1], k=3) == 3", "assert candidate(cookies=[10, 20, 30, 40, 50, 60, 70, 80], k=8) == 80", "assert candidate(cookies=[8,...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(cookies=[10, 20, 30, 40, 50, 60, 70, 80, 90], k=3) == 150", "assert candidate(cookies=[1, 2, 3, 4, 5, 6, 7, 8], k=7) == 8", "assert candidate(cookies=[1, 1, 1, 1, 1, 1, 1, 1], k=3) == 3", "assert candidate(cookies=[10, 20, 30, 40, 50, 60, 70, 80], k=8) == 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:\nGiven two integers num and k, consider a set of positive integers with 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 integers num and k, consider a set of positive integers with the following properties: The units digit of ea...
[ "assert candidate(num=54321, k=1) == 1", "assert candidate(num=400, k=6) == 5", "assert candidate(num=0, k=7) == 0", "assert candidate(num=2500, k=0) == 1", "assert candidate(num=243, k=7) == 9", "assert candidate(num=2875, k=7) == 5", "assert candidate(num=2345, k=9) == 5", "assert candidate(num=256,...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(num=54321, k=1) == 1", "assert candidate(num=400, k=6) == 5", "assert candidate(num=0, k=7) == 0", "assert candidate(num=2500, k=0) == 1", "assert candidate(num=243, k=7) == 9", "assert candidate(num=2875, k=7) == 5", "assert candidate(num=2345, k=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 binary string s and a positive integer k.\nReturn the leng...
You are an expert Python 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 and a positive integer k. Return the length of the longest subsequence of s that makes ...
[ "assert candidate(s='1111111111111111111111111111111111111111', k=1024) == 10", "assert candidate(s='00101001', k=1) == 6", "assert candidate(s='11001100110011001100110011001100', k=2048) == 21", "assert candidate(s='000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', k=0...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='1111111111111111111111111111111111111111', k=1024) == 10", "assert candidate(s='00101001', k=1) == 6", "assert candidate(s='11001100110011001100110011001100', k=2048) == 21", "assert candidate(s='000000000000000000000000000000000000000000000000000000000000000000...
[ { "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. There is an undirected graph with n nodes, num...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given an integer n. There is an undirected graph with n nodes, numbered from 0 to n - 1. You are given a 2D int...
[ "assert candidate(n=15, 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]]) == 0", "assert candidate(n=10, edges=[[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 0]]) == 0", "assert candidate(n=25, edges=[[0...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=15, 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]]) == 0", "assert candidate(n=10, edges=[[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 0]]) == 0", "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 integer array nums. In one operation, select any...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 0-indexed integer array nums. In one operation, select any non-negative integer x and an index i, then ...
[ "assert candidate(nums=[987654321, 123456789, 987654322, 123456790, 987654323, 123456791]) == 1071639991", "assert candidate(nums=[1, 0, 3, 2, 5, 4, 7, 6, 9, 8]) == 15", "assert candidate(nums=[1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288]) == 104857...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[987654321, 123456789, 987654322, 123456790, 987654323, 123456791]) == 1071639991", "assert candidate(nums=[1, 0, 3, 2, 5, 4, 7, 6, 9, 8]) == 15", "assert candidate(nums=[1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 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 an integer n. You roll a fair 6-sided dice n times. Determin...
You are an expert Python 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. You roll a fair 6-sided dice n times. Determine the total number of distinct sequences of r...
[ "assert candidate(n=5) == 516", "assert candidate(n=2) == 22", "assert candidate(n=2000) == 784558903", "assert candidate(n=5000) == 798977852", "assert candidate(n=1000) == 497171723", "assert candidate(n=10) == 93120", "assert candidate(n=6) == 1472", "assert candidate(n=15) == 16706688", "assert ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=5) == 516", "assert candidate(n=2) == 22", "assert candidate(n=2000) == 784558903", "assert candidate(n=5000) == 798977852", "assert candidate(n=1000) == 497171723", "assert candidate(n=10) == 93120", "assert candidate(n=6) == 1472", "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:\nThere is a street with n * 2 plots, where there are n plots on each side o...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: There is a street with n * 2 plots, where there are n plots on each side of the street. The plots on each side are numb...
[ "assert candidate(n=10) == 20736", "assert candidate(n=7000) == 750848153", "assert candidate(n=4000) == 984988507", "assert candidate(n=10000) == 402613600", "assert candidate(n=1) == 4", "assert candidate(n=2000) == 329423452", "assert candidate(n=8) == 3025", "assert candidate(n=6) == 441", "asse...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=10) == 20736", "assert candidate(n=7000) == 750848153", "assert candidate(n=4000) == 984988507", "assert candidate(n=10000) == 402613600", "assert candidate(n=1) == 4", "assert candidate(n=2000) == 329423452", "assert candidate(n=8) == 3025", "ass...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given two 0-indexed integer arrays nums1 and nums2, both of length...
You are an expert Python 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 of length n. You can choose two integers left and righ...
[ "assert candidate(nums1=[3, 3, 3, 3, 3, 3, 3, 3, 3, 3], nums2=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == 58", "assert candidate(nums1=[100, 100, 100, 100, 100, 100, 100, 100, 100, 100], nums2=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) == 1000", "assert candidate(nums1=[5, 10, 15, 20, 25, 30, 35, 40, 45, 50], nums2=[50, 45, 40, 3...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums1=[3, 3, 3, 3, 3, 3, 3, 3, 3, 3], nums2=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == 58", "assert candidate(nums1=[100, 100, 100, 100, 100, 100, 100, 100, 100, 100], nums2=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) == 1000", "assert candidate(nums1=[5, 10, 15, 20, 25, 30, 35, 40, 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:\nThere is an undirected connected tree with n nodes labeled from 0 to n - 1...
You are an expert Python 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 connected tree with n nodes labeled from 0 to n - 1 and n - 1 edges. You are given a 0-indexed i...
[ "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 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], [16, 17], [17, 18], [18, 19]]) == 1", "assert candidate(nums=[1, 1, 1,...
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], edges=[[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10], [10, 11], [11, 12], [12, 13], [13, 14], [14, 15], [15, 16], [16, 17], [17, 18], [18, 19]]) == 1", "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 0-indexed integer arrays jobs and workers of equal 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 two 0-indexed integer arrays jobs and workers of equal length, where jobs[i] is the amount of time needed...
[ "assert candidate(jobs=[100000, 100000, 100000, 100000, 100000], workers=[100000, 100000, 100000, 100000, 100000]) == 1", "assert candidate(jobs=[1000, 2000, 3000, 4000, 5000], workers=[100, 200, 300, 400, 500]) == 10", "assert candidate(jobs=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100], workers=[100, 90, 80, 70, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(jobs=[100000, 100000, 100000, 100000, 100000], workers=[100000, 100000, 100000, 100000, 100000]) == 1", "assert candidate(jobs=[1000, 2000, 3000, 4000, 5000], workers=[100, 200, 300, 400, 500]) == 10", "assert candidate(jobs=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100], w...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given two integers m and n, which represent the dimensions of a ma...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given two integers m and n, which represent the dimensions of a matrix. You are also given the head of a linked...
[ "assert candidate(m=10, n=2, head=list_node([9, 8, 7, 6, 5, 4, 3, 2, 1])) == [[9, 8], [-1, 7], [-1, 6], [-1, 5], [-1, 4], [-1, 3], [-1, 2], [-1, 1], [-1, -1], [-1, -1]]", "assert candidate(m=7, n=5, head=list_node([1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51])...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(m=10, n=2, head=list_node([9, 8, 7, 6, 5, 4, 3, 2, 1])) == [[9, 8], [-1, 7], [-1, 6], [-1, 5], [-1, 4], [-1, 3], [-1, 2], [-1, 1], [-1, -1], [-1, -1]]", "assert candidate(m=7, n=5, head=list_node([1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 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:\nOn day 1, one person discovers a secret.\nYou are given an integer delay, ...
You are an expert Python 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: On day 1, one person discovers a secret. You are given an integer delay, which means that each person will share the se...
[ "assert candidate(n=450, delay=90, forget=360) == 3944850", "assert candidate(n=500, delay=200, forget=400) == 5250", "assert candidate(n=600, delay=150, forget=450) == 619250", "assert candidate(n=1000, delay=1, forget=10) == 694661098", "assert candidate(n=950, delay=400, forget=850) == 11775", "assert ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=450, delay=90, forget=360) == 3944850", "assert candidate(n=500, delay=200, forget=400) == 5250", "assert candidate(n=600, delay=150, forget=450) == 619250", "assert candidate(n=1000, delay=1, forget=10) == 694661098", "assert candidate(n=950, delay=400, forg...
[ { "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 integer matrix grid, where you can move from a cell...
You are an expert Python 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 integer matrix grid, where you can move from a cell to any adjacent cell in all 4 directions. Re...
[ "assert candidate(grid=[[1, 2, 3], [6, 5, 4], [7, 8, 9], [12, 11, 10], [13, 14, 15]]) == 476", "assert candidate(grid=[[1, 10, 100, 1000], [10, 100, 1000, 10000], [100, 1000, 10000, 100000], [1000, 10000, 100000, 1000000]]) == 226", "assert candidate(grid=[[10, 9, 8, 7, 6], [9, 8, 7, 6, 5], [8, 7, 6, 5, 4], [7,...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(grid=[[1, 2, 3], [6, 5, 4], [7, 8, 9], [12, 11, 10], [13, 14, 15]]) == 476", "assert candidate(grid=[[1, 10, 100, 1000], [10, 100, 1000, 10000], [100, 1000, 10000, 100000], [1000, 10000, 100000, 1000000]]) == 226", "assert candidate(grid=[[10, 9, 8, 7, 6], [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:\nYou are given a 0-indexed string s consisting of only lowercase English le...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 0-indexed string s consisting of only lowercase English letters. In one operation, you can change any c...
[ "assert candidate(s='aabbccddeeeeddccbaa') == False", "assert candidate(s='detartrated') == True", "assert candidate(s='abcdefg') == False", "assert candidate(s='abcaacb') == False", "assert candidate(s='abc') == True", "assert candidate(s='abcdefghijklmnopqrstuvwxyzzyxwvutsrqponmlkjihgfedcba') == True", ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='aabbccddeeeeddccbaa') == False", "assert candidate(s='detartrated') == True", "assert candidate(s='abcdefg') == False", "assert candidate(s='abcaacb') == False", "assert candidate(s='abc') == True", "assert candidate(s='abcdefghijklmnopqrstuvwxyzzyxwvuts...
[ { "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 buses of length n, where buses[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 buses of length n, where buses[i] represents the departure time of the ith bus....
[ "assert candidate(buses=[15, 25, 35, 45, 55], passengers=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200], capacity=5) == 55", "assert candidate(buses=[1000, 2000, 3000], passengers=[500, 1500, 2500, 3500, 4500], capacity=2) == 3000", "assert candidate(buses=[10, 20, 3...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(buses=[15, 25, 35, 45, 55], passengers=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200], capacity=5) == 55", "assert candidate(buses=[1000, 2000, 3000], passengers=[500, 1500, 2500, 3500, 4500], capacity=2) == 3000", "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 0-indexed integer arrays nums1 and nums2, both ...
You are an expert Python 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 0-indexed integer arrays nums1 and nums2, both of length n. The sum of squared difference of...
[ "assert candidate(nums1=[100000, 90000, 80000, 70000, 60000], nums2=[1, 2, 3, 4, 5], k1=1000000, k2=1000000) == 0", "assert candidate(nums1=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], nums2=[10, 9, 8, 7, 6, 5, 4, 3, 2, 1], k1=20, k2=20) == 10", "assert candidate(nums1=[100, 200, 300, 400], nums2=[105, 205, 305, 405], k1=1...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums1=[100000, 90000, 80000, 70000, 60000], nums2=[1, 2, 3, 4, 5], k1=1000000, k2=1000000) == 0", "assert candidate(nums1=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], nums2=[10, 9, 8, 7, 6, 5, 4, 3, 2, 1], k1=20, k2=20) == 10", "assert candidate(nums1=[100, 200, 300, 400], nums2=[...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an integer array nums and an integer threshold.\nFind any su...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given an integer array nums and an integer threshold. Find any subarray of nums of length k such that every ele...
[ "assert candidate(nums=[5, 5, 5, 5, 5, 5, 5, 5, 5, 5], threshold=5) == 2", "assert candidate(nums=[19, 17, 15, 13, 11, 9, 7, 5, 3, 1], threshold=50) == 4", "assert candidate(nums=[1, 2, 3, 4, 5], threshold=15) == -1", "assert candidate(nums=[5, 5, 5, 5, 5, 5, 5, 5, 5, 5], threshold=25) == 6", "assert candid...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[5, 5, 5, 5, 5, 5, 5, 5, 5, 5], threshold=5) == 2", "assert candidate(nums=[19, 17, 15, 13, 11, 9, 7, 5, 3, 1], threshold=50) == 4", "assert candidate(nums=[1, 2, 3, 4, 5], threshold=15) == -1", "assert candidate(nums=[5, 5, 5, 5, 5, 5, 5, 5, 5, 5], threshold=...
[ { "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 start and target, both of length n. Each string ...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given two strings start and target, both of length n. Each string consists only of the characters 'L', 'R', and...
[ "assert candidate(start='_L___R_L_R', target='L_____RR__') == False", "assert candidate(start='L_____R__L', target='L_________RL') == False", "assert candidate(start='R____L_____', target='_____R____L') == False", "assert candidate(start='_L_R__L__R', target='__LR____R') == False", "assert candidate(start='...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(start='_L___R_L_R', target='L_____RR__') == False", "assert candidate(start='L_____R__L', target='L_________RL') == False", "assert candidate(start='R____L_____', target='_____R____L') == False", "assert candidate(start='_L_R__L__R', target='__LR____R') == 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 array nums consisting of positive integers. You ...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 0-indexed array nums consisting of positive integers. You can choose two indices i and j, such that i !...
[ "assert candidate(nums=[123456789, 987654321, 234567891, 345678912, 456789123, 567891234, 678912345, 789123456, 891234567]) == 1878888888", "assert candidate(nums=[9, 99, 999, 9999]) == -1", "assert candidate(nums=[123, 321, 213, 111, 222, 333]) == 543", "assert candidate(nums=[123, 321, 213, 132, 231, 312, 4...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[123456789, 987654321, 234567891, 345678912, 456789123, 567891234, 678912345, 789123456, 891234567]) == 1878888888", "assert candidate(nums=[9, 99, 999, 9999]) == -1", "assert candidate(nums=[123, 321, 213, 111, 222, 333]) == 543", "assert candidate(nums=[123,...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed array of strings nums, where each string is of 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: You are given a 0-indexed array of strings nums, where each string is of equal length and consists of only digits. You ...
[ "assert candidate(nums=['111', '222', '333', '444'], queries=[[1, 1], [2, 2], [3, 3], [4, 4]]) == [0, 1, 2, 3]", "assert candidate(nums=['00001', '00002', '00003', '00004', '00005'], queries=[[1, 1], [2, 1], [3, 1], [4, 1], [5, 1], [1, 2], [2, 2], [3, 2], [4, 2], [5, 2]]) == [0, 1, 2, 3, 4, 0, 1, 2, 3, 4]", "as...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=['111', '222', '333', '444'], queries=[[1, 1], [2, 2], [3, 3], [4, 4]]) == [0, 1, 2, 3]", "assert candidate(nums=['00001', '00002', '00003', '00004', '00005'], queries=[[1, 1], [2, 1], [3, 1], [4, 1], [5, 1], [1, 2], [2, 2], [3, 2], [4, 2], [5, 2]]) == [0, 1, 2, 3, 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 two positive integer arrays nums and numsDivide. You can del...
You are an expert Python 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 numsDivide. You can delete any number of elements from nums. Return ...
[ "assert candidate(nums=[8, 16, 24, 32, 40], numsDivide=[40, 80, 120, 160]) == 0", "assert candidate(nums=[13, 26, 39, 52, 65], numsDivide=[78, 156, 234, 312]) == 0", "assert candidate(nums=[2, 4, 6, 8, 10], numsDivide=[20, 40, 60, 80, 100]) == 0", "assert candidate(nums=[11, 22, 33, 44, 55], numsDivide=[66, 7...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[8, 16, 24, 32, 40], numsDivide=[40, 80, 120, 160]) == 0", "assert candidate(nums=[13, 26, 39, 52, 65], numsDivide=[78, 156, 234, 312]) == 0", "assert candidate(nums=[2, 4, 6, 8, 10], numsDivide=[20, 40, 60, 80, 100]) == 0", "assert candidate(nums=[11, 22, 33,...
[ { "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, return the number of subarrays filled with 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: Given an integer array nums, return the number of subarrays filled with 0. A subarray is a contiguous non-empty sequenc...
[ "assert candidate(nums=[9, 0, 0, 0, 0, 8, 0, 0, 7, 0, 0, 0, 6, 0, 5, 0, 0, 4, 0, 0, 0, 3, 0, 0, 2, 0, 0, 1, 0]) == 36", "assert candidate(nums=[0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0]) == 54", "assert candidate(nums=[1, 2, 3, 4, 5, 0, 0, 0, 0, 0, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[9, 0, 0, 0, 0, 8, 0, 0, 7, 0, 0, 0, 6, 0, 5, 0, 0, 4, 0, 0, 0, 3, 0, 0, 2, 0, 0, 1, 0]) == 36", "assert candidate(nums=[0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0]) == 54", "assert candidate(nums=[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:\nYou are given an integer array rolls of length n and an integer k. You rol...
You are an expert Python 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 rolls of length n and an integer k. You roll a k sided dice numbered from 1 to k, n time...
[ "assert candidate(rolls=[1, 1, 1, 2, 2, 2, 3, 3, 3, 1, 1, 2, 2, 3, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3], k=3) == 9", "assert candidate(rolls=[1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4], k=4) == 2", "assert candidate(rolls=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(rolls=[1, 1, 1, 2, 2, 2, 3, 3, 3, 1, 1, 2, 2, 3, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3], k=3) == 9", "assert candidate(rolls=[1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4], k=4) == 2", "assert candidate(rolls=[1, 2, 3, 4, 5, 6, 7, 8, 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 positive integer array nums and a positive 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: You are given a 0-indexed positive integer array nums and a positive integer k. A pair of numbers (num1, num2) is calle...
[ "assert candidate(nums=[2147483647, 1073741823, 536870911, 268435455, 134217727, 67108863, 33554431], k=25) == 49", "assert candidate(nums=[2147483647, 2147483646, 2147483645, 2147483644, 2147483643, 2147483642, 2147483641, 2147483640, 2147483639, 2147483638], k=30) == 100", "assert candidate(nums=[5, 3, 9, 7, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[2147483647, 1073741823, 536870911, 268435455, 134217727, 67108863, 33554431], k=25) == 49", "assert candidate(nums=[2147483647, 2147483646, 2147483645, 2147483644, 2147483643, 2147483642, 2147483641, 2147483640, 2147483639, 2147483638], k=30) == 100", "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 integer array books of length n where books[i] d...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 0-indexed integer array books of length n where books[i] denotes the number of books on the ith shelf o...
[ "assert candidate(books=[10, 10, 10, 10, 1, 1, 1, 1, 1, 1]) == 34", "assert candidate(books=[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) == 0", "assert candidate(books=[1, 3, 5, 7, 9, 11, 13, 15, 17, 19]) == 100", "assert candidate(books=[0, 100000, 0, 100000, 0, 100000, 0, 100000, 0, 100000]...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(books=[10, 10, 10, 10, 1, 1, 1, 1, 1, 1]) == 34", "assert candidate(books=[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) == 0", "assert candidate(books=[1, 3, 5, 7, 9, 11, 13, 15, 17, 19]) == 100", "assert candidate(books=[0, 100000, 0, 100000, 0, 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 positive integer array grades which represents the grades ...
You are an expert Python 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 array grades which represents the grades of students in a university. You would like t...
[ "assert candidate(grades=[100000, 90000, 80000, 70000, 60000, 50000, 40000, 30000, 20000, 10000]) == 4", "assert candidate(grades=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100]) == 4", "assert candidate(grades=[1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(grades=[100000, 90000, 80000, 70000, 60000, 50000, 40000, 30000, 20000, 10000]) == 4", "assert candidate(grades=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100]) == 4", "assert candidate(grades=[1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 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 directed graph of n nodes numbered from 0 to n - 1, where ...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a directed graph of n nodes numbered from 0 to n - 1, where each node has at most one outgoing edge. The ...
[ "assert candidate(edges=[1, 2, 3, 4, 0, 5, 6, 7, 8, 9, -1], node1=0, node2=10) == -1", "assert candidate(edges=[3, 1, 1, 4, 1], node1=1, node2=2) == 1", "assert candidate(edges=[1, 2, 3, 4, -1], node1=0, node2=4) == 4", "assert candidate(edges=[4, 4, 8, -1, 9, 8, 4, 4, 1, 1], node1=5, node2=6) == 1", "asser...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(edges=[1, 2, 3, 4, 0, 5, 6, 7, 8, 9, -1], node1=0, node2=10) == -1", "assert candidate(edges=[3, 1, 1, 4, 1], node1=1, node2=2) == 1", "assert candidate(edges=[1, 2, 3, 4, -1], node1=0, node2=4) == 4", "assert candidate(edges=[4, 4, 8, -1, 9, 8, 4, 4, 1, 1], node1=...
[ { "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 train line going through a city has two routes, the regular route and 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: A train line going through a city has two routes, the regular route and the express route. Both routes go through the s...
[ "assert candidate(regular=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], express=[20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1], expressCost=15) == [1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 104, 110, 115, 119, 122, 124, 125]", "assert candidate(regular=[2...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(regular=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], express=[20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1], expressCost=15) == [1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 104, 110, 115, 119, 122, 124, 125]", "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 integer array nums. A pair of indices (i, j) is ...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 0-indexed integer array nums. A pair of indices (i, j) is a bad pair if i < j and j - i != nums[j] - nu...
[ "assert candidate(nums=[1, 3, 2, 4, 5, 3, 2, 1]) == 25", "assert candidate(nums=[1, 2, 5, 10, 17, 26, 37, 50, 65, 82, 101, 122, 145, 170, 197, 226, 257, 290, 325, 362, 401, 442, 485, 530, 577, 626, 677, 730, 785, 842]) == 434", "assert candidate(nums=[1, 2, 3, 4, 3, 4, 5, 6, 5, 6]) == 32", "assert candidate(n...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[1, 3, 2, 4, 5, 3, 2, 1]) == 25", "assert candidate(nums=[1, 2, 5, 10, 17, 26, 37, 50, 65, 82, 101, 122, 145, 170, 197, 226, 257, 290, 325, 362, 401, 442, 485, 530, 577, 626, 677, 730, 785, 842]) == 434", "assert candidate(nums=[1, 2, 3, 4, 3, 4, 5, 6, 5, 6]) == 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 array of positive integers tasks, representing t...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 0-indexed array of positive integers tasks, representing tasks that need to be completed in order, wher...
[ "assert candidate(tasks=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], space=1) == 10", "assert candidate(tasks=[1, 2, 3, 4, 5], space=5) == 5", "assert candidate(tasks=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], space=10) == 32", "assert candidate(tasks=[1, 2, 3, 4, 5, 6,...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(tasks=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], space=1) == 10", "assert candidate(tasks=[1, 2, 3, 4, 5], space=5) == 5", "assert candidate(tasks=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], space=10) == 32", "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 0-indexed integer array nums. In one operation you can rep...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 0-indexed integer array nums. In one operation you can replace any element of the array with any two el...
[ "assert candidate(nums=[100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67, 66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28,...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67, 66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33...
[ { "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 n - 1...
You are an expert Python 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 n - 1 edges. You are given a 2D integer array edge...
[ "assert candidate(n=7, edges=[[0, 1], [1, 2], [3, 1], [4, 0], [0, 5], [5, 6]], restricted=[4, 5]) == 4", "assert candidate(n=25, edges=[[0, 1], [0, 2], [1, 3], [1, 4], [2, 5], [2, 6], [3, 7], [3, 8], [4, 9], [5, 10], [5, 11], [6, 12], [6, 13], [7, 14], [7, 15], [8, 16], [8, 17], [9, 18], [9, 19], [10, 20], [10, 2...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=7, edges=[[0, 1], [1, 2], [3, 1], [4, 0], [0, 5], [5, 6]], restricted=[4, 5]) == 4", "assert candidate(n=25, edges=[[0, 1], [0, 2], [1, 3], [1, 4], [2, 5], [2, 6], [3, 7], [3, 8], [4, 9], [5, 10], [5, 11], [6, 12], [6, 13], [7, 14], [7, 15], [8, 16], [8, 17], [9, 18], [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. You have to partition the ar...
You are an expert Python 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. You have to partition the array into one or more contiguous subarrays. We...
[ "assert candidate(nums=[1, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10]) == False", "assert candidate(nums=[2, 2, 2, 3, 3, 4, 4, 4, 5, 5, 6, 6, 6, 7, 7, 8, 8, 9, 9, 9, 10, 10, 11, 11, 11, 12, 12, 13, 13]) == True", "assert candidate(nums=[1, 2, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 10]...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[1, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10]) == False", "assert candidate(nums=[2, 2, 2, 3, 3, 4, 4, 4, 5, 5, 6, 6, 6, 7, 7, 8, 8, 9, 9, 9, 10, 10, 11, 11, 11, 12, 12, 13, 13]) == True", "assert candidate(nums=[1, 2, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 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 consisting of lowercase letters and an integer k....
You are an expert Python 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 consisting of lowercase letters and an integer k. We call a string t ideal if the following co...
[ "assert candidate(s='abcdabcdabcdabcdabcdabcdabcdabcd', k=3) == 32", "assert candidate(s='abcdefghijklmnopqrstuvwxyz', k=1) == 26", "assert candidate(s='abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz', k=3) == 30", "assert candidate(s='zyxwvutsrqponmlkjihgfedcba', k=1) == 26", "assert candidate(s='thi...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='abcdabcdabcdabcdabcdabcdabcdabcd', k=3) == 32", "assert candidate(s='abcdefghijklmnopqrstuvwxyz', k=1) == 26", "assert candidate(s='abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz', k=3) == 30", "assert candidate(s='zyxwvutsrqponmlkjihgfedcba', k=1) == 26",...
[ { "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 integer matrix grid containing distinct positive 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 m x n integer matrix grid containing distinct positive integers. You have to replace each integer in t...
[ "assert candidate(grid=[[1000, 999, 998], [997, 996, 995], [994, 993, 992], [991, 990, 989], [988, 987, 986]]) == [[7, 6, 5], [6, 5, 4], [5, 4, 3], [4, 3, 2], [3, 2, 1]]", "assert candidate(grid=[[20, 15, 10, 5], [30, 25, 20, 15], [40, 35, 30, 25], [50, 45, 40, 35]]) == [[4, 3, 2, 1], [5, 4, 3, 2], [6, 5, 4, 3], ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(grid=[[1000, 999, 998], [997, 996, 995], [994, 993, 992], [991, 990, 989], [988, 987, 986]]) == [[7, 6, 5], [6, 5, 4], [5, 4, 3], [4, 3, 2], [3, 2, 1]]", "assert candidate(grid=[[20, 15, 10, 5], [30, 25, 20, 15], [40, 35, 30, 25], [50, 45, 40, 35]]) == [[4, 3, 2, 1], [5, 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 a 0-indexed string pattern of length n consisting of the cha...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 0-indexed string pattern of length n consisting of the characters 'I' meaning increasing and 'D' meanin...
[ "assert candidate(pattern='IDDDIIDI') == '154326879'", "assert candidate(pattern='DDIIDDID') == '321476598'", "assert candidate(pattern='IIDIDIDDD') == None", "assert candidate(pattern='IIIIIDDD') == '123459876'", "assert candidate(pattern='DDDDDDI') == '76543218'", "assert candidate(pattern='IIDDDDDDII')...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(pattern='IDDDIIDI') == '154326879'", "assert candidate(pattern='DDIIDDID') == '321476598'", "assert candidate(pattern='IIDIDIDDD') == None", "assert candidate(pattern='IIIIIDDD') == '123459876'", "assert candidate(pattern='DDDDDDI') == '76543218'", "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:\nWe call a positive integer special if all of its digits are distinct.\nGiv...
You are an expert Python 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 call a positive integer special if all of its digits are distinct. Given a positive integer n, return the number of ...
[ "assert candidate(n=9999999) == 712890", "assert candidate(n=1122334455) == 5652090", "assert candidate(n=111222333) == 2386170", "assert candidate(n=210) == 171", "assert candidate(n=1000000000) == 5611770", "assert candidate(n=111111111) == 2386170", "assert candidate(n=9876543210) == 8877690", "ass...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=9999999) == 712890", "assert candidate(n=1122334455) == 5652090", "assert candidate(n=111222333) == 2386170", "assert candidate(n=210) == 171", "assert candidate(n=1000000000) == 5611770", "assert candidate(n=111111111) == 2386170", "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 weighted tree consisting of n 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: You are given a weighted tree consisting of n nodes numbered from 0 to n - 1. The tree is rooted at node 0 and represen...
[ "assert candidate(edges=[[-1, -1], [0, 1000], [-1, -1], [1, 500], [1, -300], [2, 600], [2, 400], [5, 100], [5, 200]]) == 1000", "assert candidate(edges=[[-1, -1], [0, 1000], [0, -1000], [0, 2000], [1, -500], [1, 500], [3, 3000], [3, -3000]]) == 4000", "assert candidate(edges=[[-1, -1], [0, 1000], [1, 500], [1, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(edges=[[-1, -1], [0, 1000], [-1, -1], [1, 500], [1, -300], [2, 600], [2, 400], [5, 100], [5, 200]]) == 1000", "assert candidate(edges=[[-1, -1], [0, 1000], [0, -1000], [0, 2000], [1, -500], [1, 500], [3, 3000], [3, -3000]]) == 4000", "assert candidate(edges=[[-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 string s of lowercase English letters and a 2D integer arr...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a string s of lowercase English letters and a 2D integer array shifts where shifts[i] = [starti, endi, di...
[ "assert candidate(s='aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz', shifts=[[0, 51, 1], [10, 40, 0], [20, 30, 1], [30, 40, 0]]) == 'bbccddeeffffgghhiijjllmmnnoopppoppqqrrsstvwwxxyyzzaa'", "assert candidate(s='abcdef', shifts=[[1, 4, 1], [2, 3, 0]]) == 'accdff'", "assert candidate(s='zzzzzzzzzz', shifts=...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz', shifts=[[0, 51, 1], [10, 40, 0], [20, 30, 1], [30, 40, 0]]) == 'bbccddeeffffgghhiijjllmmnnoopppoppqqrrsstvwwxxyyzzaa'", "assert candidate(s='abcdef', shifts=[[1, 4, 1], [2, 3, 0]]) == 'accdff'", "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 two 0-indexed integer arrays nums and removeQueries, both 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 two 0-indexed integer arrays nums and removeQueries, both of length n. For the ith query, the element in ...
[ "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], removeQueries=[19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]) == [190, 171, 153, 136, 120, 105, 91, 78, 66, 55, 45, 36, 28, 21, 15, 10, 6, 3, 1, 0]", "assert candidate(nums=[1, 2, 5, 6, 1], remo...
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], removeQueries=[19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]) == [190, 171, 153, 136, 120, 105, 91, 78, 66, 55, 45, 36, 28, 21, 15, 10, 6, 3, 1, 0]", "assert candidate(num...
[ { "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 num consisting of digits only.\nReturn the largest ...
You are an expert Python 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 num consisting of digits only. Return the largest palindromic integer (in the form of a string) ...
[ "assert candidate(num='1001001001001001') == '1110000000000111'", "assert candidate(num='987654321111111111111111111111111111111111111111111987654321') == '987654321111111111111111111111111111111111111111111123456789'", "assert candidate(num='999999999999999999999999999') == '999999999999999999999999999'", "a...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(num='1001001001001001') == '1110000000000111'", "assert candidate(num='987654321111111111111111111111111111111111111111111987654321') == '987654321111111111111111111111111111111111111111111123456789'", "assert candidate(num='999999999999999999999999999') == '9999999999...
[ { "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 root of a binary tree with unique values, and an integer...
You are an expert Python 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 root of a binary tree with unique values, and an integer start. At minute 0, an infection starts from...
[ "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]), start=1) == 7", "assert candidate(root=tree_node([1, 2, 3, 4, None, 5, 6, 7, None, None, None, None, 8, 9, 10, 11, 12, None, None, 13, 14, 15, None, None, ...
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]), start=1) == 7", "assert candidate(root=tree_node([1, 2, 3, 4, None, 5, 6, 7, None, None, None, None, 8, 9, 10, 11, 12, None, None, 1...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an integer array nums and a positive integer k. You can choo...
You are an expert Python 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. You can choose any subsequence of the array and sum all o...
[ "assert candidate(nums=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1], k=500) == 5", "assert candidate(nums=[-10, 20, -30, 40, -50, 60, -70, 80, -90, 100, -110, 120, -130, 140, -150, 160, -170, 180, -190, 200], k=1000) == 840", "assert candidate(nums=[9, 8, 7, 6, 5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5, -6, -7, -8, -9], k=1000) =...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1], k=500) == 5", "assert candidate(nums=[-10, 20, -30, 40, -50, 60, -70, 80, -90, 100, -110, 120, -130, 140, -150, 160, -170, 180, -190, 200], k=1000) == 840", "assert candidate(nums=[9, 8, 7, 6, 5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -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:\nGiven an m x n matrix grid containing an odd number of integers where each...
You are an expert Python 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 m x n matrix grid containing an odd number of integers where each row is sorted in non-decreasing order, retur...
[ "assert candidate(grid=[[1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5]]) == 3", "assert candidate(grid=[[5, 8, 12], [6, 9, 13], [7, 10, 14], [8, 11, 15], [9, 12, 16]]) == 10", "assert candidate(grid=[[1, 3, 5, 7, 9, 11, 13], [2, 4, 6, 8, 10, 12, 14], [15, 17, 19, 21, 23, 25,...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(grid=[[1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5]]) == 3", "assert candidate(grid=[[5, 8, 12], [6, 9, 13], [7, 10, 14], [8, 11, 15], [9, 12, 16]]) == 10", "assert candidate(grid=[[1, 3, 5, 7, 9, 11, 13], [2, 4, 6, 8, 10, 12, 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 string s, which contains stars *.\nIn one operation, you c...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a string s, which contains stars *. In one operation, you can: Choose a star in s. Remove the closest no...
[ "assert candidate(s='abc*def*ghi*jkl*mno*pqr*stu*vwx*y*z') == 'abdeghjkmnpqstvwz'", "assert candidate(s='abcde*fg*hij*k*lmnop*qrs*tuvw*x*y*z*') == 'abcdfhilmnoqrtuv'", "assert candidate(s='abcdefghijklmnopqrstuvwxyz*a*b*c*d*e*f*g*h*i*j*k*l*m*n*o*p*q*r*s*t*u*v*w*x*y*z') == 'abcdefghijklmnopqrstuvwxyz'", "asser...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='abc*def*ghi*jkl*mno*pqr*stu*vwx*y*z') == 'abdeghjkmnpqstvwz'", "assert candidate(s='abcde*fg*hij*k*lmnop*qrs*tuvw*x*y*z*') == 'abcdfhilmnoqrtuv'", "assert candidate(s='abcdefghijklmnopqrstuvwxyz*a*b*c*d*e*f*g*h*i*j*k*l*m*n*o*p*q*r*s*t*u*v*w*x*y*z') == 'abcdefghijklm...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed array of strings garbage where garbage[i] repres...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 0-indexed array of strings garbage where garbage[i] represents the assortment of garbage at the ith hou...
[ "assert candidate(garbage=['MGP', 'MGP', 'MGP', 'MGP', 'MGP', 'MGP', 'MGP', 'MGP', 'MGP', 'MGP'], travel=[10, 10, 10, 10, 10, 10, 10, 10, 10]) == 300", "assert candidate(garbage=['GGP', 'PGM', 'MG', 'PG', 'GM', 'MP', 'GG', 'PP', 'MM'], travel=[3, 3, 3, 3, 3, 3, 3, 3]) == 83", "assert candidate(garbage=['MGP', '...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(garbage=['MGP', 'MGP', 'MGP', 'MGP', 'MGP', 'MGP', 'MGP', 'MGP', 'MGP', 'MGP'], travel=[10, 10, 10, 10, 10, 10, 10, 10, 10]) == 300", "assert candidate(garbage=['GGP', 'PGM', 'MG', 'PG', 'GM', 'MP', 'GG', 'PP', 'MM'], travel=[3, 3, 3, 3, 3, 3, 3, 3]) == 83", "assert ca...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a positive integer k. You are also given:\n\na 2D integer ar...
You are an expert Python 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 k. You are also given: a 2D integer array rowConditions of size n where rowConditions...
[ "assert candidate(k=10, rowConditions=[[1, 5], [2, 6], [3, 7], [4, 8], [5, 9], [6, 10]], colConditions=[[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]]) == [[1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 2, 0, 0, 0, 0], [0, 3, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 4, 0, 0, 0], [0, 0, 5, 0, 0, 0, 0, 0, 0, 0], [0, 0,...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(k=10, rowConditions=[[1, 5], [2, 6], [3, 7], [4, 8], [5, 9], [6, 10]], colConditions=[[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]]) == [[1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 2, 0, 0, 0, 0], [0, 3, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 4, 0, 0, 0], [0, 0, 5, 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 an array nums consisting of positive integers.\nReturn the 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 an array nums consisting of positive integers. Return the number of subarrays of nums that are in strictl...
[ "assert candidate(nums=[1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]) == 12", "assert candidate(nums=[1, 3, 5, 7, 9, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20]) == 70", "assert candidate(nums=[33, 31, 29, 27, 25, 23, 21, 19, 17, 15, 13, 11, 9, 7, 5, 3, 1]) == 17", "assert candidate(nums=[1, 2, 3, 2, 3, 4, 5, 4, 5, 6, 7, 8, 7, 8...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]) == 12", "assert candidate(nums=[1, 3, 5, 7, 9, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20]) == 70", "assert candidate(nums=[33, 31, 29, 27, 25, 23, 21, 19, 17, 15, 13, 11, 9, 7, 5, 3, 1]) == 17", "assert candidate(nums=[1, 2, 3, 2, 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:\nAn integer n is strictly palindromic if, for every base b between 2 and 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: An integer n is strictly palindromic if, for every base b between 2 and n - 2 (inclusive), the string representation of...
[ "assert candidate(n=4321) == False", "assert candidate(n=255) == False", "assert candidate(n=32) == False", "assert candidate(n=100) == False", "assert candidate(n=4096) == False", "assert candidate(n=50000) == False", "assert candidate(n=54321) == False", "assert candidate(n=1000) == False", "asser...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=4321) == False", "assert candidate(n=255) == False", "assert candidate(n=32) == False", "assert candidate(n=100) == False", "assert candidate(n=4096) == False", "assert candidate(n=50000) == False", "assert candidate(n=54321) == False", "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 m x n binary matrix matrix and an integer numSelect.\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 an m x n binary matrix matrix and an integer numSelect. Your goal is to select exactly numSelect distinct...
[ "assert candidate(matrix=[[1, 1, 0, 0, 0], [1, 1, 0, 1, 0], [0, 0, 1, 0, 1], [1, 0, 0, 1, 1], [0, 0, 0, 1, 1], [1, 1, 0, 0, 1]], numSelect=3) == 2", "assert candidate(matrix=[[1, 1, 1, 1, 1], [0, 0, 0, 0, 0], [1, 1, 1, 1, 1], [0, 0, 0, 0, 0]], numSelect=2) == 2", "assert candidate(matrix=[[1, 0, 1, 1, 1, 1, 0, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(matrix=[[1, 1, 0, 0, 0], [1, 1, 0, 1, 0], [0, 0, 1, 0, 1], [1, 0, 0, 1, 1], [0, 0, 0, 1, 1], [1, 1, 0, 0, 1]], numSelect=3) == 2", "assert candidate(matrix=[[1, 1, 1, 1, 1], [0, 0, 0, 0, 0], [1, 1, 1, 1, 1], [0, 0, 0, 0, 0]], numSelect=2) == 2", "assert candidate(matri...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou have n robots. You are given two 0-indexed integer arrays, chargeTimes...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You have n robots. You are given two 0-indexed integer arrays, chargeTimes and runningCosts, both of length n. The ith ...
[ "assert candidate(chargeTimes=[3, 7, 9, 8, 5, 6, 2, 4], runningCosts=[10, 8, 5, 3, 9, 6, 7, 2], budget=50) == 2", "assert candidate(chargeTimes=[5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5], runningCosts=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], budget=100) == 5", "assert candidate(chargeTimes=[3, 6,...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(chargeTimes=[3, 7, 9, 8, 5, 6, 2, 4], runningCosts=[10, 8, 5, 3, 9, 6, 7, 2], budget=50) == 2", "assert candidate(chargeTimes=[5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5], runningCosts=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], budget=100) == 5", "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 integers startPos and endPos. Initially, you ar...
You are an expert Python 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 startPos and endPos. Initially, you are standing at position startPos on an infinit...
[ "assert candidate(startPos=-1, endPos=1, k=2) == 1", "assert candidate(startPos=0, endPos=0, k=0) == 1", "assert candidate(startPos=-10, endPos=10, k=20) == 1", "assert candidate(startPos=-100, endPos=100, k=200) == 1", "assert candidate(startPos=100, endPos=50, k=150) == 713790273", "assert candidate(sta...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(startPos=-1, endPos=1, k=2) == 1", "assert candidate(startPos=0, endPos=0, k=0) == 1", "assert candidate(startPos=-10, endPos=10, k=20) == 1", "assert candidate(startPos=-100, endPos=100, k=200) == 1", "assert candidate(startPos=100, endPos=50, k=150) == 713790...
[ { "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 positive integers.\nWe call a su...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given an array nums consisting of positive integers. We call a subarray of nums nice if the bitwise AND of ever...
[ "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, 4194304, 8388608, 16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824, 2147483647]) == 31", "assert candidate(nums=[1, 6, 10, 18, 33, 66, 132,...
newfacade/LeetCodeDataset
{ "constraints": [ "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, 4194304, 8388608, 16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824, 2147483647]) == 31", "assert candidate(nums=[1, ...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an integer array power where power[i] is the power of the it...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given an integer array power where power[i] is the power of the ith monster. You start with 0 mana points, and ...
[ "assert candidate(power=[7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7]) == 31", "assert candidate(power=[1000000000, 1, 1000000000, 1, 1000000000, 1, 1000000000]) == 759523813", "assert candidate(power=[1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584]) == 457", "assert candidate(po...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(power=[7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7]) == 31", "assert candidate(power=[1000000000, 1, 1000000000, 1, 1000000000, 1, 1000000000]) == 759523813", "assert candidate(power=[1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584]) == 457...
[ { "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, partition the string into one or more substrings such 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 string s, partition the string into one or more substrings such that the characters in each substring are uniqu...
[ "assert candidate(s='abc') == 1", "assert candidate(s='mnopqrsmnopqrsmnopqrsmnopqrs') == 4", "assert candidate(s='characters') == 2", "assert candidate(s='abacabadabacabaeabacabafabacabadabacabaeabacabafabacabadabacabaeabacabafabacabadabacabaeabacabafabacabadabacabaeabacabaf') == 60", "assert candidate(s='u...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='abc') == 1", "assert candidate(s='mnopqrsmnopqrsmnopqrsmnopqrs') == 4", "assert candidate(s='characters') == 2", "assert candidate(s='abacabadabacabaeabacabafabacabadabacabaeabacabafabacabadabacabaeabacabafabacabadabacabaeabacabafabacabadabacabaeabacabaf') == 60...
[ { "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 intervals where intervals[i] = [lefti, ri...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 2D integer array intervals where intervals[i] = [lefti, righti] represents the inclusive interval [left...
[ "assert candidate(intervals=[[1, 50], [2, 49], [3, 48], [4, 47], [5, 46], [6, 45], [7, 44], [8, 43], [9, 42], [10, 41], [11, 40], [12, 39], [13, 38], [14, 37], [15, 36], [16, 35], [17, 34], [18, 33], [19, 32], [20, 31], [21, 30], [22, 29], [23, 28], [24, 27], [25, 26]]) == 25", "assert candidate(intervals=[[1, 1]...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(intervals=[[1, 50], [2, 49], [3, 48], [4, 47], [5, 46], [6, 45], [7, 44], [8, 43], [9, 42], [10, 41], [11, 40], [12, 39], [13, 38], [14, 37], [15, 36], [16, 35], [17, 34], [18, 33], [19, 32], [20, 31], [21, 30], [22, 29], [23, 28], [24, 27], [25, 26]]) == 25", "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 an integer array nums and an integer k.\nFind the longest su...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given an integer array nums and an integer k. Find the longest subsequence of nums that meets the following req...
[ "assert candidate(nums=[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39], k=1) == 1", "assert candidate(nums=[1, 10, 19, 28, 37, 46, 55, 64, 73, 82, 91, 100, 92, 83, 74, 65, 56, 47, 38, 29], k=9) == 12", "assert candidate(nums=[5, 5, 5, 5, 5, 5, 5, 5, 5, 5], k=0) == 1", "assert candi...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39], k=1) == 1", "assert candidate(nums=[1, 10, 19, 28, 37, 46, 55, 64, 73, 82, 91, 100, 92, 83, 74, 65, 56, 47, 38, 29], k=9) == 12", "assert candidate(nums=[5, 5, 5, 5, 5, 5, 5, 5, 5, 5], 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 players, where players[i] represen...
You are an expert Python 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 players, where players[i] represents the ability of the ith player. You are als...
[ "assert candidate(players=[5, 10, 15, 20, 25, 30], trainers=[25, 10, 5, 30, 20, 15]) == 6", "assert candidate(players=[1, 1, 1, 1, 1], trainers=[1, 2, 3, 4, 5]) == 5", "assert candidate(players=[10, 20, 30], trainers=[1, 2, 3]) == 0", "assert candidate(players=[1, 10, 100], trainers=[10, 100, 1000]) == 3", ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(players=[5, 10, 15, 20, 25, 30], trainers=[25, 10, 5, 30, 20, 15]) == 6", "assert candidate(players=[1, 1, 1, 1, 1], trainers=[1, 2, 3, 4, 5]) == 5", "assert candidate(players=[10, 20, 30], trainers=[1, 2, 3]) == 0", "assert candidate(players=[1, 10, 100], trainers...
[ { "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 length n, consisting of non-negati...
You are an expert Python 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 length n, consisting of non-negative integers. For each index i from 0 to n - 1...
[ "assert candidate(nums=[5, 5, 5, 5, 5, 5, 5, 5, 5, 5]) == [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]", "assert candidate(nums=[1000000000, 500000000, 250000000, 125000000, 62500000, 31250000, 15625000, 7812500, 3906250, 1953125]) == [10, 9, 8, 7, 6, 5, 4, 3, 2, 1]", "assert candidate(nums=[31, 15, 7, 3, 1, 1, 3, 7, 15, 31]...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[5, 5, 5, 5, 5, 5, 5, 5, 5, 5]) == [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]", "assert candidate(nums=[1000000000, 500000000, 250000000, 125000000, 62500000, 31250000, 15625000, 7812500, 3906250, 1953125]) == [10, 9, 8, 7, 6, 5, 4, 3, 2, 1]", "assert candidate(nums=[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 a 0-indexed 2D integer array transactions, where transaction...
You are an expert Python 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 transactions, where transactions[i] = [costi, cashbacki]. The array describe...
[ "assert candidate(transactions=[[100, 0], [50, 100], [25, 50], [10, 25], [5, 10], [1, 5]]) == 150", "assert candidate(transactions=[[9, 8], [7, 6], [5, 4], [3, 2], [1, 0]]) == 13", "assert candidate(transactions=[[10, 10], [9, 9], [8, 8], [7, 7], [6, 6], [5, 5], [4, 4], [3, 3], [2, 2], [1, 1]]) == 10", "asser...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(transactions=[[100, 0], [50, 100], [25, 50], [10, 25], [5, 10], [1, 5]]) == 150", "assert candidate(transactions=[[9, 8], [7, 6], [5, 4], [3, 2], [1, 0]]) == 13", "assert candidate(transactions=[[10, 10], [9, 9], [8, 8], [7, 7], [6, 6], [5, 5], [4, 4], [3, 3], [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:\nAn alphabetical continuous string is a string consisting of consecutive le...
You are an expert Python 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 alphabetical continuous string is a string consisting of consecutive letters in the alphabet. In other words, it is ...
[ "assert candidate(s='mnopqrstuvwxyzmnopqrstu') == 14", "assert candidate(s='xyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyz') == 3", "assert candidate(s='abcxyzab') == 3", "assert candidate(s='pqrstuvwxyzabc') == 11", "assert candidate(s='qrstuvwxyza') == 10", "assert candidate(s='defghijklmnopqrst...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='mnopqrstuvwxyzmnopqrstu') == 14", "assert candidate(s='xyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyz') == 3", "assert candidate(s='abcxyzab') == 3", "assert candidate(s='pqrstuvwxyzabc') == 11", "assert candidate(s='qrstuvwxyza') == 10", "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 the root of a perfect binary tree, reverse the node values at each o...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given the root of a perfect binary tree, reverse the node values at each odd level of the tree. For example, suppose t...
[ "assert is_same_tree(candidate(root=tree_node([1, 3, 2, 7, 6, 5, 4, 15, 14, 13, 12, 11, 10, 9, 8, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4])), tree_node([1, 2, 3, 7, 6, 5, 4, 8, 9, 10, 11, 12, 13, 14, 15, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20,...
newfacade/LeetCodeDataset
{ "constraints": [ "assert is_same_tree(candidate(root=tree_node([1, 3, 2, 7, 6, 5, 4, 15, 14, 13, 12, 11, 10, 9, 8, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4])), tree_node([1, 2, 3, 7, 6, 5, 4, 8, 9, 10, 11, 12, 13, 14, 15, 31, 30, 29, 28, 27, 26, 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 array words of size n consisting of non-empty strings.\nW...
You are an expert Python 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 words of size n consisting of non-empty strings. We define the score of a string term as the num...
[ "assert candidate(words=['a', 'b', 'c', 'd']) == [1, 1, 1, 1]", "assert candidate(words=['interspecies', 'inter', 'interstellar', 'interact', 'interaction', 'interference', 'internet', 'interim']) == [48, 40, 48, 46, 49, 47, 43, 42]", "assert candidate(words=['xyz', 'xy', 'x', 'xyzabc']) == [9, 7, 4, 12]", "a...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(words=['a', 'b', 'c', 'd']) == [1, 1, 1, 1]", "assert candidate(words=['interspecies', 'inter', 'interstellar', 'interact', 'interaction', 'interference', 'internet', 'interim']) == [48, 40, 48, 46, 49, 47, 43, 42]", "assert candidate(words=['xyz', 'xy', 'x', 'xyzabc']...
[ { "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.\nConsider a non-empty subar...
You are an expert Python 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. Consider a non-empty subarray from nums that has the maximum possible bi...
[ "assert candidate(nums=[1, 2, 3, 4]) == 1", "assert candidate(nums=[1048576, 1048576, 1048576, 1048575, 1048574]) == 3", "assert candidate(nums=[2, 2, 2, 3, 3, 3, 2, 2, 2, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2]) == 6", "assert candidate(nums=[2, 1, 2, 3, 2, 3, 4, 5, 4, 5, 6, 7, 8, 7, 6, 5, 4, 3, 2, 1]) == 1", "as...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[1, 2, 3, 4]) == 1", "assert candidate(nums=[1048576, 1048576, 1048576, 1048575, 1048574]) == 3", "assert candidate(nums=[2, 2, 2, 3, 3, 3, 2, 2, 2, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2]) == 6", "assert candidate(nums=[2, 1, 2, 3, 2, 3, 4, 5, 4, 5, 6, 7, 8, 7, 6, 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 of size n and a positive 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 a 0-indexed integer array nums of size n and a positive integer k. We call an index i in the range k <= i...
[ "assert candidate(nums=[1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1], k=2) == [3, 5, 7, 9, 11]", "assert candidate(nums=[5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5], k=2) == [3, 4, 5, 6, 13, 14, 15, 16]", "assert candidate(nums=[1, 3, 2, 1, 2, 3, 4, 3, 2, 1, 2], k=3) == []", "assert candidate(...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1], k=2) == [3, 5, 7, 9, 11]", "assert candidate(nums=[5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5], k=2) == [3, 4, 5, 6, 13, 14, 15, 16]", "assert candidate(nums=[1, 3, 2, 1, 2, 3, 4, 3, 2, 1, 2], k=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:\nThere is a tree (i.e. a connected, undirected graph with no cycles) consis...
You are an expert Python 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 tree (i.e. a connected, undirected graph with no cycles) consisting of n nodes numbered from 0 to n - 1 and ...
[ "assert candidate(vals=[3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3], edges=[[0, 1], [0, 2], [1, 3], [1, 4], [2, 5], [2, 6], [3, 7], [3, 8], [4, 9], [4, 10]]) == 66", "assert candidate(vals=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], edges=[[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9]]) == 10", "assert candi...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(vals=[3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3], edges=[[0, 1], [0, 2], [1, 3], [1, 4], [2, 5], [2, 6], [3, 7], [3, 8], [4, 9], [4, 10]]) == 66", "assert candidate(vals=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], edges=[[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 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 an array nums consisting of positive integers.\nYou can perf...
You are an expert Python 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 positive integers. You can perform the following operation on the array any n...
[ "assert candidate(nums=[10, 20, 30, 40, 50, 40, 30, 20, 10, 10, 20, 30, 40, 50, 40, 30, 20, 10, 10, 20, 30, 40, 50, 40, 30, 20, 10, 10, 20, 30, 40, 50]) == 25", "assert candidate(nums=[2, 3, 4, 5, 6, 7, 8, 9, 10, 9, 8, 7, 6, 5, 4, 3, 2]) == 0", "assert candidate(nums=[5, 5, 5, 5, 5, 1, 1, 1, 1, 1]) == 4", "as...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[10, 20, 30, 40, 50, 40, 30, 20, 10, 10, 20, 30, 40, 50, 40, 30, 20, 10, 10, 20, 30, 40, 50, 40, 30, 20, 10, 10, 20, 30, 40, 50]) == 25", "assert candidate(nums=[2, 3, 4, 5, 6, 7, 8, 9, 10, 9, 8, 7, 6, 5, 4, 3, 2]) == 0", "assert candidate(nums=[5, 5, 5, 5, 5, 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 arrays, nums1 and nums2, consisting of non-neg...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given two 0-indexed arrays, nums1 and nums2, consisting of non-negative integers. Let there be another array, n...
[ "assert candidate(nums1=[100, 200, 300, 400], nums2=[50, 60, 70]) == 16", "assert candidate(nums1=[1, 3, 5, 7], nums2=[2, 4, 6, 8]) == 0", "assert candidate(nums1=[13, 29, 37, 41, 53], nums2=[67, 71, 73, 79, 83, 89, 97, 101]) == 12", "assert candidate(nums1=[1, 1, 1], nums2=[1, 1, 1]) == 0", "assert candida...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums1=[100, 200, 300, 400], nums2=[50, 60, 70]) == 16", "assert candidate(nums1=[1, 3, 5, 7], nums2=[2, 4, 6, 8]) == 0", "assert candidate(nums1=[13, 29, 37, 41, 53], nums2=[67, 71, 73, 79, 83, 89, 97, 101]) == 12", "assert candidate(nums1=[1, 1, 1], nums2=[1, 1, 1...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an m x n integer matrix grid.\nWe define an hourglass as a p...
You are an expert Python 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 integer matrix grid. We define an hourglass as a part of the matrix with the following form: Re...
[ "assert candidate(grid=[[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]]) == 371", "assert candidate(grid=...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(grid=[[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]]) == 371", ...
[ { "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 num1 and num2, find the positive integer x suc...
You are an expert Python 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 num1 and num2, find the positive integer x such that: x has the same number of set bits as...
[ "assert candidate(num1=1073741823, num2=1) == 536870912", "assert candidate(num1=2147483647, num2=1073741823) == 2147483646", "assert candidate(num1=1000000000, num2=100000000) == 999999488", "assert candidate(num1=123, num2=987654321) == 131071", "assert candidate(num1=16777215, num2=8388607) == 16777214",...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(num1=1073741823, num2=1) == 536870912", "assert candidate(num1=2147483647, num2=1073741823) == 2147483646", "assert candidate(num1=1000000000, num2=100000000) == 999999488", "assert candidate(num1=123, num2=987654321) == 131071", "assert candidate(num1=16777215...
[ { "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 consisting of only lowercase English letters. 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 string s consisting of only lowercase English letters. In one operation, you can: Delete the entire st...
[ "assert candidate(s='abcabcabcabcabcabcabcabcabcabcd') == 10", "assert candidate(s='abacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabad') == 14", "assert candidate(s='aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzabacabadabacabadabacabadabacabad...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='abcabcabcabcabcabcabcabcabcabcd') == 10", "assert candidate(s='abacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabad') == 14", "assert candidate(s='aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzabacaba...
[ { "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 non-negative integer arrays price and tastiness, both ar...
You are an expert Python 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 non-negative integer arrays price and tastiness, both arrays have the same length n. You are also giv...
[ "assert candidate(price=[1000, 500, 250, 125, 62, 31, 15, 7, 3, 1], tastiness=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], maxAmount=1000, maxCoupons=5) == 54", "assert candidate(price=[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, 3...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(price=[1000, 500, 250, 125, 62, 31, 15, 7, 3, 1], tastiness=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], maxAmount=1000, maxCoupons=5) == 54", "assert candidate(price=[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...
[ { "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 pref of size n. Find and return the 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 an integer array pref of size n. Find and return the array arr of size n that satisfies: pref[i] = arr[0...
[ "assert candidate(pref=[100, 200, 300, 400, 500, 600, 700, 800, 900, 1000]) == [100, 172, 484, 188, 100, 940, 228, 412, 164, 108]", "assert candidate(pref=[1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765]) == [1, 0, 3, 1, 6, 13, 5, 24, 55, 21, 110, 201, 121, 400, 795, 441, 15...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(pref=[100, 200, 300, 400, 500, 600, 700, 800, 900, 1000]) == [100, 172, 484, 188, 100, 940, 228, 412, 164, 108]", "assert candidate(pref=[1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765]) == [1, 0, 3, 1, 6, 13, 5, 24, 55, 21, 110, 201,...
[ { "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 and a robot that currently holds an empty string ...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a string s and a robot that currently holds an empty string t. Apply one of the following operations unti...
[ "assert candidate(s='abcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcde') == 'aaaaaaaaaabcdedcbedcbedcbedcbedcbedcbedcbedcbedcbe'", "assert candidate(s='abcdefghijklmnopqrstuvwxyzzyxwvutsrqponmlkjihgfedcba') == 'aabcdefghijklmnopqrstuvwxyzzyxwvutsrqponmlkjihgfedcb'", "assert candidate(s='leetcode') == 'cdeoteel...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='abcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcde') == 'aaaaaaaaaabcdedcbedcbedcbedcbedcbedcbedcbedcbedcbe'", "assert candidate(s='abcdefghijklmnopqrstuvwxyzzyxwvutsrqponmlkjihgfedcba') == 'aabcdefghijklmnopqrstuvwxyzzyxwvutsrqponmlkjihgfedcb'", "assert candidate(s...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nThere is an undirected tree with n nodes labeled from 0 to n - 1.\nYou 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 a 0-indexed integer array nums of lengt...
[ "assert candidate(nums=[5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5], edges=[[0, 1], [1, 2], [1, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10], [10, 11], [11, 12], [12, 13], [13, 14], [14, 15], [15, 16], [16, 17], [17, 18], [18, 19]]) == 19", "assert candidate(nums=[1, 1, 1, 1, 1, 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], edges=[[0, 1], [1, 2], [1, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10], [10, 11], [11, 12], [12, 13], [13, 14], [14, 15], [15, 16], [16, 17], [17, 18], [18, 19]]) == 19", "assert candidate(n...
[ { "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 positive integers.\nYou have 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 an array nums consisting of positive integers. You have to take each integer in the array, reverse its di...
[ "assert candidate(nums=[123456, 654321, 111222, 222111, 1001]) == 5", "assert candidate(nums=[123, 321, 120, 210, 102, 201, 132, 231, 312, 321, 123, 213]) == 12", "assert candidate(nums=[123456, 654321, 111111, 222222, 333333, 444444]) == 6", "assert candidate(nums=[123, 321, 132, 213, 231, 312, 456, 654, 465...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[123456, 654321, 111222, 222111, 1001]) == 5", "assert candidate(nums=[123, 321, 120, 210, 102, 201, 132, 231, 312, 321, 123, 213]) == 12", "assert candidate(nums=[123456, 654321, 111111, 222222, 333333, 444444]) == 6", "assert candidate(nums=[123, 321, 132, 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 a non-negative integer num, return true if num can be expressed as 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: Given a non-negative integer num, return true if num can be expressed as the sum of any non-negative integer and its re...
[ "assert candidate(num=838) == False", "assert candidate(num=100000) == False", "assert candidate(num=1000) == False", "assert candidate(num=330033) == True", "assert candidate(num=9999) == True", "assert candidate(num=20202) == True", "assert candidate(num=11) == True", "assert candidate(num=858) == F...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(num=838) == False", "assert candidate(num=100000) == False", "assert candidate(num=1000) == False", "assert candidate(num=330033) == True", "assert candidate(num=9999) == True", "assert candidate(num=20202) == True", "assert candidate(num=11) == 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:\nThere is an undirected connected tree with n nodes labeled from 1 to n 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: There is an undirected connected tree with n nodes labeled from 1 to n and n - 1 edges. You are given the integer n. Th...
[ "assert candidate(n=10, queries=[10, 9, 8, 7, 6, 5, 4, 3, 2, 1]) == 5", "assert candidate(n=10, queries=[1]) == 10", "assert candidate(n=10, queries=[5, 10, 1]) == 9", "assert candidate(n=1000, queries=[500, 250, 125, 625, 312, 156, 78, 39, 20, 10]) == 91", "assert candidate(n=10, queries=[1, 2, 2, 3, 4, 5,...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=10, queries=[10, 9, 8, 7, 6, 5, 4, 3, 2, 1]) == 5", "assert candidate(n=10, queries=[1]) == 10", "assert candidate(n=10, queries=[5, 10, 1]) == 9", "assert candidate(n=1000, queries=[500, 250, 125, 625, 312, 156, 78, 39, 20, 10]) == 91", "assert candidate(n=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 an integer array nums and an integer k, return the number of subarra...
You are an expert Python 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, return the number of subarrays of nums where the greatest common divisor ...
[ "assert candidate(nums=[81, 54, 27, 9, 3, 1], k=3) == 5", "assert candidate(nums=[17, 34, 51, 68, 85, 102, 119, 136, 153, 170, 187, 204, 221, 238, 255], k=17) == 106", "assert candidate(nums=[5, 10, 15, 20, 25], k=5) == 11", "assert candidate(nums=[15, 30, 45, 60, 75, 90, 105, 120, 135, 150], k=15) == 46", ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[81, 54, 27, 9, 3, 1], k=3) == 5", "assert candidate(nums=[17, 34, 51, 68, 85, 102, 119, 136, 153, 170, 187, 204, 221, 238, 255], k=17) == 106", "assert candidate(nums=[5, 10, 15, 20, 25], k=5) == 11", "assert candidate(nums=[15, 30, 45, 60, 75, 90, 105, 120, ...
[ { "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 one operation, you can choose any two...
[ "assert candidate(nums=[100000, 50000, 25000, 12500, 6250, 3125, 1563], target=[1562, 3125, 6250, 12500, 25000, 50000, 100000]) == 49218", "assert candidate(nums=[4, 6, 8], target=[2, 6, 10]) == 1", "assert candidate(nums=[1, 5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 45, 49, 53, 57, 61, 65, 69, 73, 77], target=[2, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[100000, 50000, 25000, 12500, 6250, 3125, 1563], target=[1562, 3125, 6250, 12500, 25000, 50000, 100000]) == 49218", "assert candidate(nums=[4, 6, 8], target=[2, 6, 10]) == 1", "assert candidate(nums=[1, 5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 45, 49, 53, 57, 61, 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:\nYou are given two string arrays, queries and dictionary. All words in each...
You are an expert Python 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 string arrays, queries and dictionary. All words in each array comprise of lowercase English letters ...
[ "assert candidate(queries=['programming', 'development', 'debugging'], dictionary=['proogramming', 'develpopment', 'debguggin']) == []", "assert candidate(queries=['racecar', 'level', 'rotor'], dictionary=['racecer', 'levek', 'roter']) == ['racecar', 'level', 'rotor']", "assert candidate(queries=['dictionary', ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(queries=['programming', 'development', 'debugging'], dictionary=['proogramming', 'develpopment', 'debguggin']) == []", "assert candidate(queries=['racecar', 'level', 'rotor'], dictionary=['racecer', 'levek', 'roter']) == ['racecar', 'level', 'rotor']", "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 array nums consisting of positive integers, repr...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 0-indexed array nums consisting of positive integers, representing targets on a number line. You are al...
[ "assert candidate(nums=[2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50], space=2) == 2", "assert candidate(nums=[5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100], space=5) == 5", "assert candidate(nums=[2, 4, 6, 8, 10, 12, 14, 16, 18...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50], space=2) == 2", "assert candidate(nums=[5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100], space=5) == 5", "assert candidate(nums=[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 a 0-indexed array of non-negative integers nums. For each 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 array of non-negative integers nums. For each integer in nums, you must find its respective s...
[ "assert candidate(nums=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) == [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1]", "assert candidate(nums=[0, 1, 2, 0, 3, 0, 4]) == [2, 3, 4, 4, -1, -1, -1]", "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]) == [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, -1, -1]", ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) == [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1]", "assert candidate(nums=[0, 1, 2, 0, 3, 0, 4]) == [2, 3, 4, 4, -1, -1, -1]", "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]) == [3, 4, 5, 6, 7, 8, 9, 10, 11, 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 string arrays creators and ids, and an integer array vie...
You are an expert Python 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 string arrays creators and ids, and an integer array views, all of length n. The ith video on a platf...
[ "assert candidate(creators=['anna', 'bob', 'charlie', 'bob', 'anna'], ids=['aaa', 'bbb', 'ccc', 'bbb', 'aaa'], views=[150, 250, 350, 250, 150]) == [['bob', 'bbb']]", "assert candidate(creators=['eve', 'eve', 'eve', 'eve', 'eve', 'eve', 'eve'], ids=['a', 'b', 'c', 'd', 'e', 'f', 'g'], views=[10, 10, 10, 10, 10, 10...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(creators=['anna', 'bob', 'charlie', 'bob', 'anna'], ids=['aaa', 'bbb', 'ccc', 'bbb', 'aaa'], views=[150, 250, 350, 250, 150]) == [['bob', 'bbb']]", "assert candidate(creators=['eve', 'eve', 'eve', 'eve', 'eve', 'eve', 'eve'], ids=['a', 'b', 'c', 'd', 'e', 'f', 'g'], views=...
[ { "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 containing each element 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: You are given an integer array nums of size n containing each element from 0 to n - 1 (inclusive). Each of the elements...
[ "assert candidate(nums=[1, 2, 3, 4, 0, 6, 5, 8, 7, 10, 9, 12, 11]) == 4", "assert candidate(nums=[20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]) == 28", "assert candidate(nums=[5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4]) == 15", "assert candidate(nums=[8, 0, 1, 2, 3, 4, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[1, 2, 3, 4, 0, 6, 5, 8, 7, 10, 9, 12, 11]) == 4", "assert candidate(nums=[20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]) == 28", "assert candidate(nums=[5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4]) == 15", "assert candida...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an integer array nums and an integer k. Find the maximum 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 an integer array nums and an integer k. Find the maximum subarray sum of all the subarrays of nums that m...
[ "assert candidate(nums=[1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3], k=3) == 6", "assert candidate(nums=[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], k=30) == 465", "assert candidate(nums=[4, 4, 4], k=3) == 0", "assert candi...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3], k=3) == 6", "assert candidate(nums=[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], k=30) == 465", "assert candidate(nums=[4, 4, 4], 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 costs where costs[i] is the cost o...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a 0-indexed integer array costs where costs[i] is the cost of hiring the ith worker. You are also given t...
[ "assert candidate(costs=[10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10], k=10, candidates=5) == 100", "assert candidate(costs=[5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100], k=10, candidates=5) == 275", "assert candidate(costs=[100, 99, 98, 97, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(costs=[10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10], k=10, candidates=5) == 100", "assert candidate(costs=[5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100], k=10, candidates=5) == 275", "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:\nThere are some robots and factories on the X-axis. You are given 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: There are some robots and factories on the X-axis. You are given an integer array robot where robot[i] is the position ...
[ "assert candidate(robot=[-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5], factory=[[-10, 6], [0, 5]]) == 60", "assert candidate(robot=[1, 3, 5, 7, 9, 11], factory=[[2, 2], [6, 2], [10, 2]]) == 6", "assert candidate(robot=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], factory=[[0, 2], [5, 3], [10, 5]]) == 16", "assert candidate(robot...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(robot=[-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5], factory=[[-10, 6], [0, 5]]) == 60", "assert candidate(robot=[1, 3, 5, 7, 9, 11], factory=[[2, 2], [6, 2], [10, 2]]) == 6", "assert candidate(robot=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], factory=[[0, 2], [5, 3], [10, 5]]) == 16", ...
[ { "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.\nSplitting of an integer array nums 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 an integer array nums. Splitting of an integer array nums into subarrays is valid if: the greatest commo...
[ "assert candidate(nums=[3, 9, 27, 81]) == 1", "assert candidate(nums=[14, 21, 28, 35, 42, 49, 56, 63, 70, 77]) == 1", "assert candidate(nums=[100, 200, 300, 400, 500, 600, 700, 800, 900, 1000]) == 1", "assert candidate(nums=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100]) == 1", "assert candidate(nums=[17, 51, 85...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[3, 9, 27, 81]) == 1", "assert candidate(nums=[14, 21, 28, 35, 42, 49, 56, 63, 70, 77]) == 1", "assert candidate(nums=[100, 200, 300, 400, 500, 600, 700, 800, 900, 1000]) == 1", "assert candidate(nums=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100]) == 1", "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:\nGiven the integers zero, one, low, and high, we can construct a string by ...
You are an expert Python 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 integers zero, one, low, and high, we can construct a string by starting with an empty string, and then at ea...
[ "assert candidate(low=10, high=10, zero=3, one=4) == 3", "assert candidate(low=7, high=9, zero=3, one=2) == 12", "assert candidate(low=20, high=25, zero=5, one=6) == 17", "assert candidate(low=1, high=5, zero=2, one=2) == 6", "assert candidate(low=4, high=4, zero=2, one=2) == 4", "assert candidate(low=5, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(low=10, high=10, zero=3, one=4) == 3", "assert candidate(low=7, high=9, zero=3, one=2) == 12", "assert candidate(low=20, high=25, zero=5, one=6) == 17", "assert candidate(low=1, high=5, zero=2, one=2) == 6", "assert candidate(low=4, high=4, zero=2, one=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:\nThere is an undirected tree with n nodes labeled from 0 to n - 1, rooted 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 an undirected tree with n nodes labeled from 0 to n - 1, rooted at node 0. You are given a 2D integer array ed...
[ "assert candidate(edges=[[0, 1], [0, 2], [1, 3], [1, 4], [2, 5], [2, 6], [3, 7], [3, 8], [4, 9], [4, 10], [5, 11], [5, 12]], bob=11, amount=[10, 20, -30, 40, -50, 60, -70, 80, -90, 100, -110, 120, -130]) == 150", "assert candidate(edges=[[0, 1], [0, 2], [1, 3], [1, 4], [2, 5], [2, 6]], bob=5, amount=[-5, 2, -3, 4...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(edges=[[0, 1], [0, 2], [1, 3], [1, 4], [2, 5], [2, 6], [3, 7], [3, 8], [4, 9], [4, 10], [5, 11], [5, 12]], bob=11, amount=[10, 20, -30, 40, -50, 60, -70, 80, -90, 100, -110, 120, -130]) == 150", "assert candidate(edges=[[0, 1], [0, 2], [1, 3], [1, 4], [2, 5], [2, 6]], bob=...
[ { "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, return the number of subarra...
You are an expert Python 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, return the number of subarrays of nums where the least common multiple of...
[ "assert candidate(nums=[21, 28, 35, 42, 49], k=4620) == 0", "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], k=232792560) == 22", "assert candidate(nums=[25, 50, 75, 100, 125, 150], k=15000) == 0", "assert candidate(nums=[2, 4, 6, 8, 10, 12], k=12) == 3", "asse...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[21, 28, 35, 42, 49], k=4620) == 0", "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], k=232792560) == 22", "assert candidate(nums=[25, 50, 75, 100, 125, 150], k=15000) == 0", "assert candidate(nums=[2, 4, 6, 8, 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 the root of a binary tree with unique values.\nIn one operat...
You are an expert Python 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 root of a binary tree with unique values. In one operation, you can choose any two nodes at the same ...
[ "assert candidate(root=tree_node([1, 3, 2, 7, 6, 5, 4, 15, 14, 13, 12, 11, 10, 9, 8, 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])) == 7", "assert candidate(root=tree_node([1, 2, 3, 4, 5, None, None, 6, 7, 8, 9, 10, 11, 12, 13])) == 0", "assert candidate(ro...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(root=tree_node([1, 3, 2, 7, 6, 5, 4, 15, 14, 13, 12, 11, 10, 9, 8, 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])) == 7", "assert candidate(root=tree_node([1, 2, 3, 4, 5, None, None, 6, 7, 8, 9, 10, 11, 12, 13])) == 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 string s and a positive integer k.\nSelect a set of non-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 string s and a positive integer k. Select a set of non-overlapping substrings from the string s that sa...
[ "assert candidate(s='abaccdbbd', k=3) == 2", "assert candidate(s='abbaabbabbaabb', k=2) == 6", "assert candidate(s='abbaaccddccaaabbbcccdd', k=3) == 5", "assert candidate(s='racecarannakayak', k=5) == 2", "assert candidate(s='abcbaabababaabcba', k=3) == 4", "assert candidate(s='abcdefghij', k=3) == 0", ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='abaccdbbd', k=3) == 2", "assert candidate(s='abbaabbabbaabb', k=2) == 6", "assert candidate(s='abbaaccddccaaabbbcccdd', k=3) == 5", "assert candidate(s='racecarannakayak', k=5) == 2", "assert candidate(s='abcbaabababaabcba', k=3) == 4", "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 positive integer n representing n cities numbered from 1 t...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a positive integer n representing n cities numbered from 1 to n. You are also given a 2D array roads, whe...
[ "assert candidate(n=8, roads=[[1, 2, 1], [2, 3, 2], [3, 4, 3], [4, 5, 4], [5, 6, 5], [6, 7, 6], [7, 8, 7], [8, 1, 8], [1, 3, 9], [2, 4, 10], [3, 5, 11], [4, 6, 12], [5, 7, 13], [6, 8, 14]], appleCost=[100, 200, 300, 400, 500, 600, 700, 800], k=3) == [100, 104, 112, 124, 140, 160, 160, 132]", "assert candidate(n=7...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=8, roads=[[1, 2, 1], [2, 3, 2], [3, 4, 3], [4, 5, 4], [5, 6, 5], [6, 7, 6], [7, 8, 7], [8, 1, 8], [1, 3, 9], [2, 4, 10], [3, 5, 11], [4, 6, 12], [5, 7, 13], [6, 8, 14]], appleCost=[100, 200, 300, 400, 500, 600, 700, 800], k=3) == [100, 104, 112, 124, 140, 160, 160, 132]", ...
[ { "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 root of a binary search tree and an array queries of siz...
You are an expert Python 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 root of a binary search tree and an array queries of size n consisting of positive integers. Find a 2...
[ "assert candidate(root=tree_node([8, 3, 10, None, 6, 9, 12, None, None, 5, 7]), queries=[2, 8, 11, 13]) == [[-1, 3], [5, 8], [10, 12], [12, -1]]", "assert candidate(root=tree_node([10, 5, 15, 3, 7, 12, 18, 1, None, 6, 8, 11, 13, None, None, 16, 19]), queries=[1, 4, 7, 9, 10, 15, 17, 20]) == [[1, 16], [3, 5], [7, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(root=tree_node([8, 3, 10, None, 6, 9, 12, None, None, 5, 7]), queries=[2, 8, 11, 13]) == [[-1, 3], [5, 8], [10, 12], [12, -1]]", "assert candidate(root=tree_node([10, 5, 15, 3, 7, 12, 18, 1, None, 6, 8, 11, 13, None, None, 16, 19]), queries=[1, 4, 7, 9, 10, 15, 17, 20]) ==...
[ { "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 tree (i.e., a connected, undirected graph with no cycles) struc...
You are an expert Python 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 tree (i.e., a connected, undirected graph with no cycles) structure country network consisting of n cities n...
[ "assert candidate(roads=[[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], [7, 14], [7, 15], [8, 16], [8, 17], [9, 18], [9, 19], [10, 20], [10, 21], [11, 22], [11, 23], [12, 24], [12, 25], [13, 26], [13, 27], [14, 28], [14, 29], [15, 30], [15, 31]], seats=8)...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(roads=[[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], [7, 14], [7, 15], [8, 16], [8, 17], [9, 18], [9, 19], [10, 20], [10, 21], [11, 22], [11, 23], [12, 24], [12, 25], [13, 26], [13, 27], [14, 28], [14, 29], [15, 30]...
[ { "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 that consists of the digits '1' to '9' and two 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 string s that consists of the digits '1' to '9' and two integers k and minLength. A partition of s is c...
[ "assert candidate(s='222333555777111222333', k=7, minLength=2) == 0", "assert candidate(s='21212121212121', k=3, minLength=2) == 15", "assert candidate(s='2222222222222222222222222222', k=12, minLength=1) == 0", "assert candidate(s='23759237592375923759', k=5, minLength=4) == 0", "assert candidate(s='235421...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='222333555777111222333', k=7, minLength=2) == 0", "assert candidate(s='21212121212121', k=3, minLength=2) == 15", "assert candidate(s='2222222222222222222222222222', k=12, minLength=1) == 0", "assert candidate(s='23759237592375923759', k=5, minLength=4) == 0", ...