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:\nA company is planning to interview 2n people. Given the array costs 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: A company is planning to interview 2n people. Given the array costs where costs[i] = [aCosti, bCosti], the cost of flyi...
[ "assert candidate(costs=[[100, 500], [200, 400], [300, 300], [400, 200], [500, 100], [600, 600], [700, 700], [800, 800], [900, 900], [1000, 1000], [1100, 1100], [1200, 1200]]) == 7200", "assert candidate(costs=[[259, 770], [448, 54], [926, 667], [184, 139], [840, 118], [577, 469]]) == 1859", "assert candidate(c...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(costs=[[100, 500], [200, 400], [300, 300], [400, 200], [500, 100], [600, 600], [700, 700], [800, 800], [900, 900], [1000, 1000], [1100, 1100], [1200, 1200]]) == 7200", "assert candidate(costs=[[259, 770], [448, 54], [926, 667], [184, 139], [840, 118], [577, 469]]) == 1859"...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven an integer array nums and two integers firstLen and secondLen, retur...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given an integer array nums and two integers firstLen and secondLen, return the maximum sum of elements in two non-over...
[ "assert candidate(nums=[30, 25, 20, 15, 10, 5, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[30, 25, 20, 15, 10, 5, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 6...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nThere are three stones in different positions on the X-axis. You are given...
You are an expert Python programmer. 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 three stones in different positions on the X-axis. You are given three integers a, b, and c, the positions of...
[ "assert candidate(a=1, b=10, c=20) == [2, 17]", "assert candidate(a=3, b=4, c=5) == [0, 0]", "assert candidate(a=10, b=15, c=25) == [2, 13]", "assert candidate(a=2, b=4, c=8) == [1, 4]", "assert candidate(a=23, b=26, c=29) == [2, 4]", "assert candidate(a=6, b=9, c=12) == [2, 4]", "assert candidate(a=5, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(a=1, b=10, c=20) == [2, 17]", "assert candidate(a=3, b=4, c=5) == [0, 0]", "assert candidate(a=10, b=15, c=25) == [2, 13]", "assert candidate(a=2, b=4, c=8) == [1, 4]", "assert candidate(a=23, b=26, c=29) == [2, 4]", "assert candidate(a=6, b=9, c=12) == [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 m x n integer matrix grid, and three integers row, col, 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 m x n integer matrix grid, and three integers row, col, and color. Each value in the grid represents t...
[ "assert candidate(grid=[[1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1]], row=2, col=2, color=2) == [[2, 2, 2, 2, 2], [2, 1, 1, 1, 2], [2, 1, 1, 1, 2], [2, 1, 1, 1, 2], [2, 2, 2, 2, 2]]", "assert candidate(grid=[[1, 1, 1, 1, 1], [1, 2, 2, 2, 1], [1, 2, 3, 2, 1], [1, 2, 2, 2, 1]...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(grid=[[1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1]], row=2, col=2, color=2) == [[2, 2, 2, 2, 2], [2, 1, 1, 1, 2], [2, 1, 1, 1, 2], [2, 1, 1, 1, 2], [2, 2, 2, 2, 2]]", "assert candidate(grid=[[1, 1, 1, 1, 1], [1, 2, 2, 2, 1], [1, 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:\nYou are given two integer arrays nums1 and nums2. We write the integers 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 integer arrays nums1 and nums2. We write the integers of nums1 and nums2 (in the order they are given...
[ "assert candidate(nums1=[1, 2, 3, 4, 5], nums2=[1, 2, 3, 4, 5]) == 5", "assert candidate(nums1=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], nums2=[15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]) == 1", "assert candidate(nums1=[1, 4, 2, 3, 5, 6], nums2=[6, 2, 4, 5, 1]) == 2", "assert candidate(nums...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums1=[1, 2, 3, 4, 5], nums2=[1, 2, 3, 4, 5]) == 5", "assert candidate(nums1=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], nums2=[15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]) == 1", "assert candidate(nums1=[1, 4, 2, 3, 5, 6], nums2=[6, 2, 4, 5, 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:\nThere is a 1 million by 1 million grid on an XY-plane, and the coordinates...
You are an expert Python programmer. 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 1 million by 1 million grid on an XY-plane, and the coordinates of each grid square are (x, y). We start at ...
[ "assert candidate(blocked=[[1, 1], [2, 2], [3, 3], [4, 4], [5, 5], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [1, 3], [2, 4], [3, 5], [4, 6], [5, 7], [1, 4], [2, 5], [3, 6], [4, 7], [5, 8]], source=[0, 0], target=[5, 9]) == True", "assert candidate(blocked=[[500000, 500000], [500001, 500000], [500002, 500000], [5000...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(blocked=[[1, 1], [2, 2], [3, 3], [4, 4], [5, 5], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [1, 3], [2, 4], [3, 5], [4, 6], [5, 7], [1, 4], [2, 5], [3, 6], [4, 7], [5, 8]], source=[0, 0], target=[5, 9]) == True", "assert candidate(blocked=[[500000, 500000], [500001, 500000], ...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven the root of a Binary Search Tree (BST), convert it to a Greater Tree...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given the root of a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is c...
[ "assert is_same_tree(candidate(root=tree_node([8, 3, 10, 1, 6, None, 14, None, None, 4, 7, 13])), tree_node([45, 65, 37, 66, 58, None, 14, None, None, 62, 52, 27]))", "assert is_same_tree(candidate(root=tree_node([5, 3, 7, 2, 4, 6, 8, 1, None, None, None, None, None, None, 9])), tree_node([35, 42, 24, 44, 39, 30,...
newfacade/LeetCodeDataset
{ "constraints": [ "assert is_same_tree(candidate(root=tree_node([8, 3, 10, 1, 6, None, 14, None, None, 4, 7, 13])), tree_node([45, 65, 37, 66, 58, None, 14, None, None, 62, 52, 27]))", "assert is_same_tree(candidate(root=tree_node([5, 3, 7, 2, 4, 6, 8, 1, None, None, None, None, None, None, 9])), tree_node([...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou have a convex n-sided polygon where each vertex has an integer value. ...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You have a convex n-sided polygon where each vertex has an integer value. You are given an integer array values where v...
[ "assert candidate(values=[5, 6, 3, 2, 7, 8, 4, 1, 9]) == 201", "assert candidate(values=[10, 5, 1, 100, 10, 5, 1]) == 1110", "assert candidate(values=[3, 5, 100, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(values=[5, 6, 3, 2, 7, 8, 4, 1, 9]) == 201", "assert candidate(values=[10, 5, 1, 100, 10, 5, 1]) == 1110", "assert candidate(values=[3, 5, 100, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nThere are some stones in different positions on the X-axis. You are given ...
You are an expert Python programmer. 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 stones in different positions on the X-axis. You are given an integer array stones, the positions of the...
[ "assert candidate(stones=[1, 10, 11, 12, 13, 14, 15, 20]) == [2, 8]", "assert candidate(stones=[2, 4, 5, 6, 8, 10, 11, 13, 15, 16]) == [3, 5]", "assert candidate(stones=[1, 10, 20, 30, 40, 50, 60, 70, 80, 90]) == [8, 72]", "assert candidate(stones=[3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105]) == [9, 88...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(stones=[1, 10, 11, 12, 13, 14, 15, 20]) == [2, 8]", "assert candidate(stones=[2, 4, 5, 6, 8, 10, 11, 13, 15, 16]) == [3, 5]", "assert candidate(stones=[1, 10, 20, 30, 40, 50, 60, 70, 80, 90]) == [8, 72]", "assert candidate(stones=[3, 6, 10, 15, 21, 28, 36, 45, 55, ...
[ { "role": "user", "content": "You are an expert Python programmer. You will 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 an infinite plane, a robot initially stands at (0, 0) and faces north. ...
You are an expert Python programmer. 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 an infinite plane, a robot initially stands at (0, 0) and faces north. Note that: The north direction is the positi...
[ "assert candidate(instructions='GGLRLGLLGGRR') == True", "assert candidate(instructions='GLGLGLGLGLGL') == True", "assert candidate(instructions='GLGLGLGLGRRGRRGL') == True", "assert candidate(instructions='GLGLGLGL') == True", "assert candidate(instructions='GGGGGGGGGGGGGG') == False", "assert candidate(...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(instructions='GGLRLGLLGGRR') == True", "assert candidate(instructions='GLGLGLGLGLGL') == True", "assert candidate(instructions='GLGLGLGLGRRGRRGL') == True", "assert candidate(instructions='GLGLGLGL') == True", "assert candidate(instructions='GGGGGGGGGGGGGG') ==...
[ { "role": "user", "content": "You are an expert Python programmer. You will 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 gardens, labeled from 1 to n, and an array paths where paths[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 have n gardens, labeled from 1 to n, and an array paths where paths[i] = [xi, yi] describes a bidirectional path be...
[ "assert candidate(n=12, paths=[[1, 2], [1, 3], [2, 4], [2, 5], [3, 6], [3, 7], [4, 8], [4, 9], [5, 10], [5, 11], [6, 12], [7, 12], [8, 12], [9, 12], [10, 11], [10, 12], [11, 12]]) == [1, 2, 2, 1, 1, 1, 1, 2, 2, 2, 3, 4]", "assert candidate(n=7, paths=[[1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 1]]) == [1...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=12, paths=[[1, 2], [1, 3], [2, 4], [2, 5], [3, 6], [3, 7], [4, 8], [4, 9], [5, 10], [5, 11], [6, 12], [7, 12], [8, 12], [9, 12], [10, 11], [10, 12], [11, 12]]) == [1, 2, 2, 1, 1, 1, 1, 2, 2, 2, 3, 4]", "assert candidate(n=7, paths=[[1, 2], [2, 3], [3, 4], [4, 5], [5, 6],...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an array of words where each word consists of lowercase Engl...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given an array of words where each word consists of lowercase English letters. wordA is a predecessor of wordB ...
[ "assert candidate(words=['z', 'zy', 'zyx', 'zyxz', 'zyxza', 'zyxzag', 'zyxzagh', 'zyxzaghd', 'zyxzaghde', 'zyxzaghdef', 'zyxzaghdefg', 'zyxzaghdefgh', 'zyxzaghdefghi', 'zyxzaghdefghj', 'zyxzaghdefghjk', 'zyxzaghdefghjkl', 'zyxzaghdefghjklm', 'zyxzaghdefghjklmn', 'zyxzaghdefghjklmno', 'zyxzaghdefghjklmnop']) == 19",...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(words=['z', 'zy', 'zyx', 'zyxz', 'zyxza', 'zyxzag', 'zyxzagh', 'zyxzaghd', 'zyxzaghde', 'zyxzaghdef', 'zyxzaghdefg', 'zyxzaghdefgh', 'zyxzaghdefghi', 'zyxzaghdefghj', 'zyxzaghdefghjk', 'zyxzaghdefghjkl', 'zyxzaghdefghjklm', 'zyxzaghdefghjklmn', 'zyxzaghdefghjklmno', 'zyxzaghde...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an array of integers stones where stones[i] is the weight of...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given an array of integers stones where stones[i] is the weight of the ith stone. We are playing a game with th...
[ "assert candidate(stones=[20, 30, 40, 50, 60, 70]) == 10", "assert candidate(stones=[50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50]) == 0", "assert candidate(stones=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(stones=[20, 30, 40, 50, 60, 70]) == 10", "assert candidate(stones=[50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50]) == 0", "assert candidate(stones=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 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 array of positive integers arr (not necessarily distinct), return...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given an array of positive integers arr (not necessarily distinct), return the lexicographically largest permutation th...
[ "assert candidate(arr=[10, 9, 8, 7, 6]) == [10, 9, 8, 6, 7]", "assert candidate(arr=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9]) == [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9]", "assert candidate(arr=[1, 3, 5, 7, 9, 8, 6, 4, 2]) == [1, 3, 5, 7, 9, 8, 6, 2, 4]", "assert candidate(arr=[4, 3, 2, 1, 0]) == [4, 3, 2, 0, 1]", "asser...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(arr=[10, 9, 8, 7, 6]) == [10, 9, 8, 6, 7]", "assert candidate(arr=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9]) == [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9]", "assert candidate(arr=[1, 3, 5, 7, 9, 8, 6, 4, 2]) == [1, 3, 5, 7, 9, 8, 6, 2, 4]", "assert candidate(arr=[4, 3, 2, 1, 0]) ==...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nIn a warehouse, there is a row of barcodes, where the ith barcode is barco...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: In a warehouse, there is a row of barcodes, where the ith barcode is barcodes[i]. Rearrange the barcodes so that no two...
[ "assert candidate(barcodes=[14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16]) == [14, 15, 14, 15, 14, 15, 14, 15, 14, 15, 14, 15, 14, 15, 14, 15, 14, 15, 14, 15, 14, 16, 14, 16, 15, 16, 15]", "assert candidate(barcodes=[1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 1, 1,...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(barcodes=[14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16]) == [14, 15, 14, 15, 14, 15, 14, 15, 14, 15, 14, 15, 14, 15, 14, 15, 14, 15, 14, 15, 14, 16, 14, 16, 15, 16, 15]", "assert candidate(barcodes=[1, 1, 2, 2, ...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nA subsequence of a string is a new string that is formed from the original...
You are an expert Python programmer. 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 subsequence of a string is a new string that is formed from the original string by deleting some (can be none) of the...
[ "assert candidate(source='abc', target='abcbc') == 2", "assert candidate(source='source', target='sourcesourcesource') == 3", "assert candidate(source='abcd', target='ababd') == 2", "assert candidate(source='mnopqr', target='ponmqrponmqrponmqrponmr') == 16", "assert candidate(source='zzz', target='zzzzzzzzz...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(source='abc', target='abcbc') == 2", "assert candidate(source='source', target='sourcesourcesource') == 3", "assert candidate(source='abcd', target='ababd') == 2", "assert candidate(source='mnopqr', target='ponmqrponmqrponmqrponmr') == 16", "assert candidate(so...
[ { "role": "user", "content": "You are an expert Python programmer. You will 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 a campus represented on the X-Y plane, there are n workers and m bikes,...
You are an expert Python programmer. 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 a campus represented on the X-Y plane, there are n workers and m bikes, with n <= m. You are given an array workers ...
[ "assert candidate(workers=[[0, 0], [0, 1], [1, 0], [1, 1]], bikes=[[0, 2], [1, 2], [2, 0], [2, 1], [2, 2], [2, 3]]) == [3, 0, 2, 1]", "assert candidate(workers=[[0, 0], [0, 0], [0, 0]], bikes=[[0, 1], [0, 2], [0, 3], [0, 4], [0, 5]]) == [0, 1, 2]", "assert candidate(workers=[[1, 1], [2, 2], [3, 3]], bikes=[[2, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(workers=[[0, 0], [0, 1], [1, 0], [1, 1]], bikes=[[0, 2], [1, 2], [2, 0], [2, 1], [2, 2], [2, 3]]) == [3, 0, 2, 1]", "assert candidate(workers=[[0, 0], [0, 0], [0, 0]], bikes=[[0, 1], [0, 2], [0, 3], [0, 4], [0, 5]]) == [0, 1, 2]", "assert candidate(workers=[[1, 1], [2,...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven an array of prices [p1,p2...,pn] and a target, round each price pi 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 an array of prices [p1,p2...,pn] and a target, round each price pi to Roundi(pi) so that the rounded array [Round...
[ "assert candidate(prices=['999.900', '1000.000', '1000.100'], target=2999) == '1.000'", "assert candidate(prices=['999.999', '1000.000', '0.001'], target=2000) == '0.002'", "assert candidate(prices=['1.499', '2.499', '3.499', '4.499'], target=12) == '2.000'", "assert candidate(prices=['5.500', '5.500', '5.500...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(prices=['999.900', '1000.000', '1000.100'], target=2999) == '1.000'", "assert candidate(prices=['999.999', '1000.000', '0.001'], target=2000) == '0.002'", "assert candidate(prices=['1.499', '2.499', '3.499', '4.499'], target=12) == '2.000'", "assert candidate(price...
[ { "role": "user", "content": "You are an expert Python programmer. You will 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 which is sorted in ascending order and all of ...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given an integer array nums which is sorted in ascending order and all of its elements are unique and given also an int...
[ "assert candidate(nums=[3, 6, 12, 18, 24, 30, 36, 42, 48, 54, 60, 66, 72, 78, 84, 90, 96, 102], k=50) == 63", "assert candidate(nums=[4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 256], k=150) == 164", "assert candidate(nums=[5, 9, 14, 20, 27, 35, 44, 54, 65, 77, 90], k=30) == 40", "assert candi...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[3, 6, 12, 18, 24, 30, 36, 42, 48, 54, 60, 66, 72, 78, 84, 90, 96, 102], k=50) == 63", "assert candidate(nums=[4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 256], k=150) == 164", "assert candidate(nums=[5, 9, 14, 20, 27, 35, 44, 54, 65, 77, 90], k=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 two strings of the same length s1 and s2 and a string baseSt...
You are an expert Python programmer. 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 of the same length s1 and s2 and a string baseStr. We say s1[i] and s2[i] are equivalent char...
[ "assert candidate(s1='acbacbacbacb', s2='zyxzyxzyxzyx', baseStr='abcdefghijklmnopqrstuvwxyz') == 'abcdefghijklmnopqrstuvwbca'", "assert candidate(s1='aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz', s2='bbaaccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyza', baseStr='abcdefghijklmnopqrstuvwxyzabcdefghijklmno...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s1='acbacbacbacb', s2='zyxzyxzyxzyx', baseStr='abcdefghijklmnopqrstuvwxyz') == 'abcdefghijklmnopqrstuvwbca'", "assert candidate(s1='aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz', s2='bbaaccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyza', baseStr='abcdefghijklmnopqr...
[ { "role": "user", "content": "You are an expert Python programmer. You will 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 non-empty subarrays with...
You are an expert Python programmer. 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 non-empty subarrays with the leftmost element of the subarray not lar...
[ "assert candidate(nums=[10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == 76", "assert candidate(nums=[1, 3, 2, 4, 3, 5, 4, 6, 5, 7, 6, 8, 7, 9, 8]) == 71", "assert candidate(nums=[5, 4, 3, 2, 1, 5, 4, 3, 2, 1]) == 15", "assert candidate(nums=[1, 1, 2, 2, 1, 1, 3, 3, 2, 2]) == 39", "asser...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == 76", "assert candidate(nums=[1, 3, 2, 4, 3, 5, 4, 6, 5, 7, 6, 8, 7, 9, 8]) == 71", "assert candidate(nums=[5, 4, 3, 2, 1, 5, 4, 3, 2, 1]) == 15", "assert candidate(nums=[1, 1, 2, 2, 1, 1, 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:\nOn a campus represented as a 2D grid, there are n workers and m bikes, wit...
You are an expert Python programmer. 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 a campus represented as a 2D grid, there are n workers and m bikes, with n <= m. Each worker and bike is a 2D coordi...
[ "assert candidate(workers=[[999, 999], [998, 998], [997, 997], [996, 996], [995, 995]], bikes=[[0, 0], [1, 1], [2, 2], [3, 3], [4, 4], [5, 5], [6, 6], [7, 7], [8, 8], [9, 9]]) == 9900", "assert candidate(workers=[[0, 0], [1, 0], [2, 0], [3, 0], [4, 0]], bikes=[[0, 999], [1, 999], [2, 999], [3, 999], [4, 999]]) ==...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(workers=[[999, 999], [998, 998], [997, 997], [996, 996], [995, 995]], bikes=[[0, 0], [1, 1], [2, 2], [3, 3], [4, 4], [5, 5], [6, 6], [7, 7], [8, 8], [9, 9]]) == 9900", "assert candidate(workers=[[0, 0], [1, 0], [2, 0], [3, 0], [4, 0]], bikes=[[0, 999], [1, 999], [2, 999], ...
[ { "role": "user", "content": "You are an expert Python programmer. You will 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 single-digit integer d and two integers low and high, return 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: Given a single-digit integer d and two integers low and high, return the number of times that d occurs as a digit in al...
[ "assert candidate(d=3, low=123456789, high=987654321) == 795042436", "assert candidate(d=5, low=500000, high=505000) == 6502", "assert candidate(d=7, low=1000, high=9999) == 3700", "assert candidate(d=4, low=44444, high=444444) == 244450", "assert candidate(d=5, low=5555555, high=55555555) == 40555563", "...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(d=3, low=123456789, high=987654321) == 795042436", "assert candidate(d=5, low=500000, high=505000) == 6502", "assert candidate(d=7, low=1000, high=9999) == 3700", "assert candidate(d=4, low=44444, high=444444) == 244450", "assert candidate(d=5, low=5555555, hig...
[ { "role": "user", "content": "You are an expert Python programmer. You will 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  tiles, where each tile has one letter tiles[i] printed on 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 have n  tiles, where each tile has one letter tiles[i] printed on it. Return the number of possible non-empty seque...
[ "assert candidate(tiles='AABBCD') == 522", "assert candidate(tiles='AABBCCDE') == 14458", "assert candidate(tiles='AAB') == 8", "assert candidate(tiles='ABCDEFGHII') == 4986850", "assert candidate(tiles='ABACADAE') == 5188", "assert candidate(tiles='ABABABABAB') == 922", "assert candidate(tiles='QQQQRRR...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(tiles='AABBCD') == 522", "assert candidate(tiles='AABBCCDE') == 14458", "assert candidate(tiles='AAB') == 8", "assert candidate(tiles='ABCDEFGHII') == 4986850", "assert candidate(tiles='ABACADAE') == 5188", "assert candidate(tiles='ABABABABAB') == 922", ...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven the root of a binary tree and an integer limit, delete all insuffici...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given the root of a binary tree and an integer limit, delete all insufficient nodes in the tree simultaneously, and ret...
[ "assert candidate(root=tree_node([10, 5, 10]), limit=21) == None", "assert candidate(root=tree_node([1, None, -2, None, -3, None, -4, -5, None]), limit=-1) == None", "assert is_same_tree(candidate(root=tree_node([1, None, 2, None, 3]), limit=6), tree_node([1, None, 2, None, 3]))", "assert is_same_tree(candida...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(root=tree_node([10, 5, 10]), limit=21) == None", "assert candidate(root=tree_node([1, None, -2, None, -3, None, -4, -5, None]), limit=-1) == None", "assert is_same_tree(candidate(root=tree_node([1, None, 2, None, 3]), limit=6), tree_node([1, None, 2, None, 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 string s representing a list of words. Each letter in the ...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given a string s representing a list of words. Each letter in the word has one or more options. If there is on...
[ "assert candidate(s='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}') == ['abehkn', 'abehko', 'abehkp', 'abehkq', 'abehkr', 'abehks', 'abehkt', 'abehku', 'abehkv', 'abehkw', 'abehkx', 'abehky', 'abehkz', 'abehln', 'abehlo', 'abehlp', 'abehlq', 'abehlr', 'abehls', 'abehlt', 'abehlu', 'abehlv', 'abehlw', 'a...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='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}') == ['abehkn', 'abehko', 'abehkp', 'abehkq', 'abehkr', 'abehks', 'abehkt', 'abehku', 'abehkv', 'abehkw', 'abehkx', 'abehky', 'abehkz', 'abehln', 'abehlo', 'abehlp', 'abehlq', 'abehlr', 'abehls', 'abehlt', 'abehlu', '...
[ { "role": "user", "content": "You are an expert Python programmer. You will 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 confusing number is a number that when rotated 180 degrees becomes a dif...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: A confusing number is a number that when rotated 180 degrees becomes a different number with each digit valid. We can r...
[ "assert candidate(n=456789123) == 779876", "assert candidate(n=88888888) == 292126", "assert candidate(n=10) == 3", "assert candidate(n=12345) == 830", "assert candidate(n=1) == 0", "assert candidate(n=43210) == 1196", "assert candidate(n=9999999) == 77626", "assert candidate(n=500000000) == 779876", ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=456789123) == 779876", "assert candidate(n=88888888) == 292126", "assert candidate(n=10) == 3", "assert candidate(n=12345) == 830", "assert candidate(n=1) == 0", "assert candidate(n=43210) == 1196", "assert candidate(n=9999999) == 77626", "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 n item's value and label as two integer arrays values and la...
You are an expert Python programmer. 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 n item's value and label as two integer arrays values and labels. You are also given two integers numWant...
[ "assert candidate(values=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100], labels=[1, 1, 2, 2, 3, 3, 4, 4, 5, 5], numWanted=6, useLimit=2) == 450", "assert candidate(values=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], labels=[1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1], numWanted=8, useLimit=3) == 75", "asser...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(values=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100], labels=[1, 1, 2, 2, 3, 3, 4, 4, 5, 5], numWanted=6, useLimit=2) == 450", "assert candidate(values=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], labels=[1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1], numWanted=8, useLi...
[ { "role": "user", "content": "You are an expert Python programmer. You will 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 n x n binary matrix grid, return the length of the shortest clear...
You are an expert Python programmer. 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 n x n binary matrix grid, return the length of the shortest clear path in the matrix. If there is no clear pat...
[ "assert candidate(grid=[[0, 1, 0, 0, 0], [0, 0, 1, 1, 0], [0, 0, 0, 1, 0], [1, 0, 0, 0, 0], [0, 0, 0, 0, 0]]) == 5", "assert candidate(grid=[[0]]) == 1", "assert candidate(grid=[[0, 1, 1, 1, 1], [1, 1, 0, 1, 1], [1, 0, 1, 0, 1], [1, 0, 0, 0, 1], [1, 1, 1, 1, 0]]) == -1", "assert candidate(grid=[[0, 0, 0, 0, 0...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(grid=[[0, 1, 0, 0, 0], [0, 0, 1, 1, 0], [0, 0, 0, 1, 0], [1, 0, 0, 0, 0], [0, 0, 0, 0, 0]]) == 5", "assert candidate(grid=[[0]]) == 1", "assert candidate(grid=[[0, 1, 1, 1, 1], [1, 1, 0, 1, 1], [1, 0, 1, 0, 1], [1, 0, 0, 0, 1], [1, 1, 1, 1, 0]]) == -1", "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:\nGiven two strings str1 and str2, return the shortest string that has 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: Given two strings str1 and str2, return the shortest string that has both str1 and str2 as subsequences. If there are m...
[ "assert candidate(str1='abcd', str2='abcdeabcde') == 'abcdeabcde'", "assert candidate(str1='longestcommonsubsequence', str2='shortestcommonsupersequence') == 'shlortngestcommonsuperbsequence'", "assert candidate(str1='supersequence', str2='subsequence') == 'subpersequence'", "assert candidate(str1='programmin...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(str1='abcd', str2='abcdeabcde') == 'abcdeabcde'", "assert candidate(str1='longestcommonsubsequence', str2='shortestcommonsupersequence') == 'shlortngestcommonsuperbsequence'", "assert candidate(str1='supersequence', str2='subsequence') == 'subpersequence'", "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:\nUnder the grammar given below, strings can represent a set of lowercase wo...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Under the grammar given below, strings can represent a set of lowercase words. Let R(expr) denote the set of words the ...
[ "assert candidate(expression='{a,b}{c,d,e}') == ['ac', 'ad', 'ae', 'bc', 'bd', 'be']", "assert candidate(expression='{a,b{c,d}}{e,f}') == ['ae', 'af', 'bce', 'bcf', 'bde', 'bdf']", "assert candidate(expression='{a{b{c{d,e},f},g},h{i,j}}') == ['abcd', 'abce', 'abf', 'ag', 'hi', 'hj']", "assert candidate(expres...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(expression='{a,b}{c,d,e}') == ['ac', 'ad', 'ae', 'bc', 'bd', 'be']", "assert candidate(expression='{a,b{c,d}}{e,f}') == ['ae', 'af', 'bce', 'bcf', 'bde', 'bdf']", "assert candidate(expression='{a{b{c{d,e},f},g},h{i,j}}') == ['abcd', 'abce', 'abf', 'ag', 'hi', 'hj']", ...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven a string s and an integer k, return the number of substrings in s of...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given a string s and an integer k, return the number of substrings in s of length k with no repeated characters.   Cons...
[ "assert candidate(s='aaaaaaa', k=2) == 0", "assert candidate(s='abacabadabacaba', k=5) == 0", "assert candidate(s='aaaaaabbbbbbcccccc', k=3) == 0", "assert candidate(s='abcdabcabcabcd', k=4) == 5", "assert candidate(s='hellohellohellohello', k=5) == 0", "assert candidate(s='aabbccddeeffgghhiijjkkllmmnnoop...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='aaaaaaa', k=2) == 0", "assert candidate(s='abacabadabacaba', k=5) == 0", "assert candidate(s='aaaaaabbbbbbcccccc', k=3) == 0", "assert candidate(s='abcdabcabcabcd', k=4) == 5", "assert candidate(s='hellohellohellohello', k=5) == 0", "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 are n people in a social group labeled from 0 to n - 1. You are give...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: There are n people in a social group labeled from 0 to n - 1. You are given an array logs where logs[i] = [timestampi, ...
[ "assert candidate(logs=[[1, 0, 1], [2, 2, 3], [3, 4, 5], [4, 6, 7], [5, 8, 9], [6, 0, 2], [7, 1, 3], [8, 5, 6], [9, 4, 7], [10, 0, 9]], n=10) == -1", "assert candidate(logs=[[10, 0, 1], [11, 1, 2], [12, 2, 3], [13, 3, 4], [14, 4, 5], [15, 5, 6], [16, 6, 7], [17, 7, 8], [18, 8, 9], [19, 9, 0], [20, 10, 0]], n=11) ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(logs=[[1, 0, 1], [2, 2, 3], [3, 4, 5], [4, 6, 7], [5, 8, 9], [6, 0, 2], [7, 1, 3], [8, 5, 6], [9, 4, 7], [10, 0, 9]], n=10) == -1", "assert candidate(logs=[[10, 0, 1], [11, 1, 2], [12, 2, 3], [13, 3, 4], [14, 4, 5], [15, 5, 6], [16, 6, 7], [17, 7, 8], [18, 8, 9], [19, 9, 0...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven an m x n integer matrix grid, return the maximum score of a path sta...
You are an expert Python programmer. 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 integer matrix grid, return the maximum score of a path starting at (0, 0) and ending at (m - 1, n - 1) ...
[ "assert candidate(grid=[[1, 2, 0, 3, 4], [4, 3, 5, 6, 7], [8, 7, 6, 5, 4], [4, 5, 6, 7, 8], [9, 8, 7, 6, 5]]) == 1", "assert candidate(grid=[[10, 9, 8, 7, 6, 5, 4, 3, 2, 1], [9, 8, 7, 6, 5, 4, 3, 2, 1, 0], [8, 7, 6, 5, 4, 3, 2, 1, 0, 9], [7, 6, 5, 4, 3, 2, 1, 0, 9, 8], [6, 5, 4, 3, 2, 1, 0, 9, 8, 7], [5, 4, 3, 2,...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(grid=[[1, 2, 0, 3, 4], [4, 3, 5, 6, 7], [8, 7, 6, 5, 4], [4, 5, 6, 7, 8], [9, 8, 7, 6, 5]]) == 1", "assert candidate(grid=[[10, 9, 8, 7, 6, 5, 4, 3, 2, 1], [9, 8, 7, 6, 5, 4, 3, 2, 1, 0], [8, 7, 6, 5, 4, 3, 2, 1, 0, 9], [7, 6, 5, 4, 3, 2, 1, 0, 9, 8], [6, 5, 4, 3, 2, 1, 0,...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nA boolean expression is an expression that evaluates to either true or fal...
You are an expert Python programmer. 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 boolean expression is an expression that evaluates to either true or false. It can be in one of the following shapes:...
[ "assert candidate(expression='!(|(|(|(f,t),t),f),&(f,|(t,!(t),f),&(t,t,t,t,t,t)))') == True", "assert candidate(expression='&(t,|(f,!(t),&(t,f)),&(f,|(t,f,t)),!(f))') == False", "assert candidate(expression='!(&(|(&(t,f),t),&(f,|(t,f))),|(f,!(t)))') == True", "assert candidate(expression='&(f,!(t),|(f,f,t),&(...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(expression='!(|(|(|(f,t),t),f),&(f,|(t,!(t),f),&(t,t,t,t,t,t)))') == True", "assert candidate(expression='&(t,|(f,!(t),&(t,f)),&(f,|(t,f,t)),!(f))') == False", "assert candidate(expression='!(&(|(&(t,f),t),&(f,|(t,f))),|(f,!(t)))') == True", "assert candidate(expre...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nThere are n flights that are labeled from 1 to n.\nYou are given an array ...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: There are n flights that are labeled from 1 to n. You are given an array of flight bookings bookings, where bookings[i]...
[ "assert candidate(bookings=[[1, 2, 10], [2, 5, 20], [3, 5, 30], [4, 5, 40], [5, 5, 50], [1, 2, 10], [2, 5, 20], [3, 5, 30], [4, 5, 40], [5, 5, 50]], n=5) == [20, 60, 100, 180, 280]", "assert candidate(bookings=[[1, 3, 5000], [2, 4, 4000], [3, 5, 3000], [4, 5, 2000], [1, 5, 1000]], n=5) == [6000, 10000, 13000, 100...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(bookings=[[1, 2, 10], [2, 5, 20], [3, 5, 30], [4, 5, 40], [5, 5, 50], [1, 2, 10], [2, 5, 20], [3, 5, 30], [4, 5, 40], [5, 5, 50]], n=5) == [20, 60, 100, 180, 280]", "assert candidate(bookings=[[1, 3, 5000], [2, 4, 4000], [3, 5, 3000], [4, 5, 2000], [1, 5, 1000]], n=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 the root of a binary tree, return the maximum average value of a sub...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given the root of a binary tree, return the maximum average value of a subtree of that tree. Answers within 10-5 of the...
[ "assert candidate(root=tree_node([5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75])) == 75.0", "assert candidate(root=tree_node([10, 9, 20, None, None, 15, 7, 6, 12, None, 14, None, None, 13, None, None, None, None, 8, None, None, 11, None, None, 10])) == 14.0", "assert candidate(root=tree_node([1, 10...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(root=tree_node([5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75])) == 75.0", "assert candidate(root=tree_node([10, 9, 20, None, None, 15, 7, 6, 12, None, 14, None, None, 13, None, None, None, None, 8, None, None, 11, None, None, 10])) == 14.0", "assert candid...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven an integer array nums sorted in non-decreasing order 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: Given an integer array nums sorted in non-decreasing order and an integer k, return true if this array can be divided i...
[ "assert candidate(nums=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], k=10) == False", "assert candidate(nums=[1, 1, 1, 2, 2, 3], k=2) == True", "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], k=2) == True", "asser...
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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], k=10) == False", "assert candidate(nums=[1, 1, 1, 2, 2, 3], k=2) == True", "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 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:\nGiven the root of a binary tree, return the lowest common ancestor of its ...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given the root of a binary tree, return the lowest common ancestor of its deepest leaves. Recall that: The node of a b...
[ "assert is_same_tree(candidate(root=tree_node([7, 3, 8, 1, 4, 6, 9, None, None, 2, 5])), tree_node([4, 2, 5]))", "assert is_same_tree(candidate(root=tree_node([1, 2, None, 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])), tree_node([15]))", "...
newfacade/LeetCodeDataset
{ "constraints": [ "assert is_same_tree(candidate(root=tree_node([7, 3, 8, 1, 4, 6, 9, None, None, 2, 5])), tree_node([4, 2, 5]))", "assert is_same_tree(candidate(root=tree_node([1, 2, None, 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])),...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nIn a project, you have a list of required skills req_skills, and a list 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: In a project, you have a list of required skills req_skills, and a list of people. The ith person people[i] contains a ...
[ "assert candidate(req_skills=['ui', 'ux', 'backend', 'frontend'], people=[['ui'], ['ux'], ['backend'], ['frontend'], ['ui', 'ux'], ['backend', 'frontend'], ['ui', 'backend'], ['ux', 'frontend'], ['ui', 'ux', 'backend', 'frontend']]) == [8]", "assert candidate(req_skills=['security', 'analytics', 'ml', 'devops'], ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(req_skills=['ui', 'ux', 'backend', 'frontend'], people=[['ui'], ['ux'], ['backend'], ['frontend'], ['ui', 'ux'], ['backend', 'frontend'], ['ui', 'backend'], ['ux', 'frontend'], ['ui', 'ux', 'backend', 'frontend']]) == [8]", "assert candidate(req_skills=['security', 'analyt...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven an array arr of positive integers, consider all binary trees 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 an array arr of positive integers, consider all binary trees such that: Each node has either 0 or 2 children; Th...
[ "assert candidate(arr=[5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5]) == 800", "assert candidate(arr=[5, 3, 8, 6, 2, 4, 1, 9]) == 211", "assert candidate(arr=[12, 15, 8, 3, 10, 6]) == 494", "assert candidate(arr=[8, 9, 10, 7, 6, 5, 4, 3, 2, 1]) == 344", "...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(arr=[5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5]) == 800", "assert candidate(arr=[5, 3, 8, 6, 2, 4, 1, 9]) == 211", "assert candidate(arr=[12, 15, 8, 3, 10, 6]) == 494", "assert candidate(arr=[8, 9, 10, 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:\nThere are n cities labeled from 1 to n. You are given the integer n and an...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: There are n cities labeled from 1 to n. You are given the integer n and an array connections where connections[i] = [xi...
[ "assert candidate(n=10, connections=[[1, 2, 2], [2, 3, 3], [3, 4, 4], [4, 5, 5], [5, 6, 6], [6, 7, 7], [7, 8, 8], [8, 9, 9], [9, 10, 10]]) == 54", "assert candidate(n=12, connections=[[1, 2, 10], [1, 3, 9], [1, 4, 8], [1, 5, 7], [1, 6, 6], [1, 7, 5], [1, 8, 4], [1, 9, 3], [1, 10, 2], [1, 11, 1], [1, 12, 0]]) == 5...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=10, connections=[[1, 2, 2], [2, 3, 3], [3, 4, 4], [4, 5, 5], [5, 6, 6], [6, 7, 7], [7, 8, 8], [8, 9, 9], [9, 10, 10]]) == 54", "assert candidate(n=12, connections=[[1, 2, 10], [1, 3, 9], [1, 4, 8], [1, 5, 7], [1, 6, 6], [1, 7, 5], [1, 8, 4], [1, 9, 3], [1, 10, 2], [1, 11...
[ { "role": "user", "content": "You are an expert Python programmer. You will 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, which indicates that there are n courses label...
You are an expert Python programmer. 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, which indicates that there are n courses labeled from 1 to n. You are also given an array r...
[ "assert candidate(n=7, relations=[[1, 2], [1, 3], [2, 4], [3, 5], [4, 6], [5, 6], [6, 7]]) == 5", "assert candidate(n=10, relations=[[1, 2], [1, 3], [2, 4], [3, 4], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10], [4, 5], [10, 1]]) == -1", "assert candidate(n=12, relations=[[1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=7, relations=[[1, 2], [1, 3], [2, 4], [3, 5], [4, 6], [5, 6], [6, 7]]) == 5", "assert candidate(n=10, relations=[[1, 2], [1, 3], [2, 4], [3, 4], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10], [4, 5], [10, 1]]) == -1", "assert candidate(n=12, relations=[[1, 2], [2, 3], [3, ...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nOn an alphabet board, we start at position (0, 0), corresponding to charac...
You are an expert Python programmer. 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 an alphabet board, we start at position (0, 0), corresponding to character board[0][0].\r \r Here, board = ["abcde",...
[ "assert candidate(target='thequickbrownfoxjumpsoverthelazydog') == 'RRRRDDD!LLUU!URR!LLLDDD!LD!UUURRR!LU!LLDD!UUR!RDDD!URR!LLDD!UUR!LLLU!RRRRD!LDD!UUUR!LLLLDDD!UURR!LLD!RRR!UR!LLLDD!UUUURRR!LLDDD!RR!LLUU!URR!LLLDD!LUU!DDDDD!URRRR!LUUUU!RDD!LLLU!'", "assert candidate(target='tiger') == 'RRRRDDD!LUU!LL!URRR!LLDDD!'...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(target='thequickbrownfoxjumpsoverthelazydog') == 'RRRRDDD!LLUU!URR!LLLDDD!LD!UUURRR!LU!LLDD!UUR!RDDD!URR!LLDD!UUR!LLLU!RRRRD!LDD!UUUR!LLLLDDD!UURR!LLD!RRR!UR!LLLDD!UUUURRR!LLDDD!RR!LLUU!URR!LLLDD!LUU!DDDDD!URRRR!LUUUU!RDD!LLLU!'", "assert candidate(target='tiger') == 'RRRR...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven a 2D grid of 0s and 1s, return the number of elements in 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: Given a 2D grid of 0s and 1s, return the number of elements in the largest square subgrid that has all 1s on its border...
[ "assert candidate(grid=[[1, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0, 1]]) == 1", "assert candidate(gri...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(grid=[[1, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0, 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:\nAlice and Bob continue their games with piles of stones. There are a 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: Alice and Bob continue their games with piles of stones. There are a number of piles arranged in a row, and each pile h...
[ "assert candidate(piles=[3, 6, 9, 12]) == 15", "assert candidate(piles=[99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80]) == 913", "assert candidate(piles=[3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36]) == 123", "assert candidate(piles=[50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40,...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(piles=[3, 6, 9, 12]) == 15", "assert candidate(piles=[99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80]) == 913", "assert candidate(piles=[3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36]) == 123", "assert candidate(piles=[50, 49, 48, 47, ...
[ { "role": "user", "content": "You are an expert Python programmer. You will 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 strings text1 and text2, return the length of their longest comm...
You are an expert Python programmer. 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 strings text1 and text2, return the length of their longest common subsequence. If there is no common subsequ...
[ "assert candidate(text1='lclcl', text2='clcl') == 4", "assert candidate(text1='psnw', text2='vozbbmloqjbpbprqs') == 2", "assert candidate(text1='aaaaabbbb', text2='ababababab') == 6", "assert candidate(text1='abcdexyz', text2='xyzabcd') == 4", "assert candidate(text1='mhunuzqrkz', text2='dhlmfpnqjk') == 4",...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(text1='lclcl', text2='clcl') == 4", "assert candidate(text1='psnw', text2='vozbbmloqjbpbprqs') == 2", "assert candidate(text1='aaaaabbbb', text2='ababababab') == 6", "assert candidate(text1='abcdexyz', text2='xyzabcd') == 4", "assert candidate(text1='mhunuzqrkz...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven an array nums of integers, a move consists of choosing any element a...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given an array nums of integers, a move consists of choosing any element and decreasing it by 1. An array A is a zigzag...
[ "assert candidate(nums=[1000, 999, 998, 997, 996, 995, 994, 993, 992, 991]) == 8", "assert candidate(nums=[1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1]) == 0", "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]) == 18", "assert candidate(nums=[1]) == 0", "assert candid...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[1000, 999, 998, 997, 996, 995, 994, 993, 992, 991]) == 8", "assert candidate(nums=[1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1]) == 0", "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]) == 18", "assert candidate(nums=[...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven a binary array data, return the minimum number of swaps required 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: Given a binary array data, return the minimum number of swaps required to group all 1’s present in the array together i...
[ "assert candidate(data=[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) == 0", "assert candidate(data=[1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1]) == 4", "assert candidate(data=[0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]) == 1", "ass...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(data=[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) == 0", "assert candidate(data=[1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1]) == 4", "assert candidate(data=[0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given two string arrays username and website and an integer array ...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given two string arrays username and website and an integer array timestamp. All the given arrays are of the sa...
[ "assert candidate(username=['alice', 'alice', 'alice', 'bob', 'bob', 'bob', 'bob', 'carol', 'carol', 'carol', 'carol'], timestamp=[1, 3, 5, 2, 4, 6, 8, 7, 9, 11, 13], website=['site1', 'site2', 'site3', 'site1', 'site2', 'site1', 'site3', 'site1', 'site2', 'site1', 'site3']) == ('site1', 'site2', 'site3')", "asse...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(username=['alice', 'alice', 'alice', 'bob', 'bob', 'bob', 'bob', 'carol', 'carol', 'carol', 'carol'], timestamp=[1, 3, 5, 2, 4, 6, 8, 7, 9, 11, 13], website=['site1', 'site2', 'site3', 'site1', 'site2', 'site1', 'site3', 'site1', 'site2', 'site1', 'site3']) == ('site1', 'site2...
[ { "role": "user", "content": "You are an expert Python programmer. You will 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 dice, and each dice has k faces numbered from 1 to k.\nGiven 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: You have n dice, and each dice has k faces numbered from 1 to k. Given three integers n, k, and target, return the numb...
[ "assert candidate(n=30, k=5, target=125) == 699555125", "assert candidate(n=20, k=20, target=400) == 1", "assert candidate(n=16, k=7, target=80) == 150185177", "assert candidate(n=14, k=7, target=98) == 1", "assert candidate(n=18, k=12, target=250) == 0", "assert candidate(n=27, k=18, target=350) == 91344...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=30, k=5, target=125) == 699555125", "assert candidate(n=20, k=20, target=400) == 1", "assert candidate(n=16, k=7, target=80) == 150185177", "assert candidate(n=14, k=7, target=98) == 1", "assert candidate(n=18, k=12, target=250) == 0", "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 a string text. You can swap two of the characters in the tex...
You are an expert Python programmer. 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 text. You can swap two of the characters in the text. Return the length of the longest substring...
[ "assert candidate(text='abccbaabccbaabccbaabccba') == 3", "assert candidate(text='abacabadabacab') == 3", "assert candidate(text='aabbccddeeffgghhii') == 2", "assert candidate(text='abbcccddddeeefffggghhh') == 4", "assert candidate(text='abacabadabacaba') == 3", "assert candidate(text='aabacaaa') == 5", ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(text='abccbaabccbaabccbaabccba') == 3", "assert candidate(text='abacabadabacab') == 3", "assert candidate(text='aabbccddeeffgghhii') == 2", "assert candidate(text='abbcccddddeeefffggghhh') == 4", "assert candidate(text='abacabadabacaba') == 3", "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:\nGiven the root of a binary tree, the level of its root is 1, the level of ...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given the root of a binary tree, the level of its root is 1, the level of its children is 2, and so on. Return the smal...
[ "assert candidate(root=tree_node([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])) == 1", "assert candidate(root=tree_node([10, -5, 3, 4, -6, 10, -15, 0, 2, None, -8, None, 9, None, None, None, None, None, 5])) == 1", "assert candidate(root=tree_node([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15])) == 4", ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(root=tree_node([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])) == 1", "assert candidate(root=tree_node([10, -5, 3, 4, -6, 10, -15, 0, 2, None, -8, None, 9, None, None, None, None, None, 5])) == 1", "assert candidate(root=tree_node([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven an n x n grid containing only values 0 and 1, where 0 represents wat...
You are an expert Python programmer. 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 n x n grid containing only values 0 and 1, where 0 represents water and 1 represents land, find a water cell s...
[ "assert candidate(grid=[[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 1, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]]) == 4", "assert candidate(grid=[[1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1]]) == 6", "a...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(grid=[[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 1, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]]) == 4", "assert candidate(grid=[[1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0,...
[ { "role": "user", "content": "You are an expert Python programmer. You will 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, return the last substring of s in lexicographical order....
You are an expert Python programmer. 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, return the last substring of s in lexicographical order.   Constraints: 1 <= s.length <= 4 * 105 s c...
[ "assert candidate(s='aaaaaaaaaaab') == 'b'", "assert candidate(s='akjflaweproqwoijrpprpwlekfawpqwlekfqpwoqpwlekjqwlkfqpwlkerpqwlkfjqwlekflpqwlekfqpwlkerpqwlekfqwlekjfqpwekfqpwlkjqwlekjfqpwlkerpqwlekfpwoqwjfwqppqwjflawejqawlkjqwlkfjqwlkfjqwlkfjqwlkfjqwlekjqwlekjqwlekjqwlekjqwlekjqwlekjqwlkjqwlekjqwlekjqwlekjqwlekj...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='aaaaaaaaaaab') == 'b'", "assert candidate(s='akjflaweproqwoijrpprpwlekfawpqwlekfqpwoqpwlekjqwlkfqpwlkerpqwlkfjqwlekflpqwlekfqpwlkerpqwlekfqwlekjfqpwekfqpwlkjqwlekjfqpwlkerpqwlekfpwoqwjfwqppqwjflawejqawlkjqwlkfjqwlkfjqwlkfjqwlkfjqwlekjqwlekjqwlekjqwlekjqwlekjqwlekjqwlkjq...
[ { "role": "user", "content": "You are an expert Python programmer. You will 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 some number of sticks with positive integer lengths. These 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 have some number of sticks with positive integer lengths. These lengths are given as an array sticks, where sticks[...
[ "assert candidate(sticks=[10000, 9999, 9998, 9997, 9996, 9995, 9994, 9993, 9992, 9991]) == 339835", "assert candidate(sticks=[1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096]) == 16368", "assert candidate(sticks=[1, 1, 1, 1, 1]) == 12", "assert candidate(sticks=[100, 200, 300, 400, 500, 600, 700, 800,...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(sticks=[10000, 9999, 9998, 9997, 9996, 9995, 9994, 9993, 9992, 9991]) == 339835", "assert candidate(sticks=[1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096]) == 16368", "assert candidate(sticks=[1, 1, 1, 1, 1]) == 12", "assert candidate(sticks=[100, 200, 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:\nThere are n houses in a village. We want to supply water for all the house...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: There are n houses in a village. We want to supply water for all the houses by building wells and laying pipes. For eac...
[ "assert candidate(n=10, wells=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100], pipes=[[1, 2, 5], [2, 3, 5], [3, 4, 5], [4, 5, 5], [5, 6, 5], [6, 7, 5], [7, 8, 5], [8, 9, 5], [9, 10, 5], [1, 10, 15], [1, 9, 14], [2, 10, 13], [2, 9, 12], [3, 10, 11], [3, 9, 10], [4, 10, 9], [4, 9, 8], [5, 10, 7], [5, 9, 6], [6, 10, 5], [6,...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=10, wells=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100], pipes=[[1, 2, 5], [2, 3, 5], [3, 4, 5], [4, 5, 5], [5, 6, 5], [6, 7, 5], [7, 8, 5], [8, 9, 5], [9, 10, 5], [1, 10, 15], [1, 9, 14], [2, 10, 13], [2, 9, 12], [3, 10, 11], [3, 9, 10], [4, 10, 9], [4, 9, 8], [5, 10, 7], [5, 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:\nA transaction is possibly invalid if:\n\nthe amount exceeds $1000, or;\nif...
You are an expert Python programmer. 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 transaction is possibly invalid if: the amount exceeds $1000, or; if it occurs within (and including) 60 minutes of ...
[ "assert candidate(transactions=['frank,10,500,seattle', 'frank,20,500,sanfrancisco', 'frank,30,1500,seattle', 'frank,90,700,sanfrancisco', 'frank,150,1200,seattle']) == ['frank,10,500,seattle', 'frank,20,500,sanfrancisco', 'frank,30,1500,seattle', 'frank,90,700,sanfrancisco', 'frank,150,1200,seattle']", "assert c...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(transactions=['frank,10,500,seattle', 'frank,20,500,sanfrancisco', 'frank,30,1500,seattle', 'frank,90,700,sanfrancisco', 'frank,150,1200,seattle']) == ['frank,10,500,seattle', 'frank,20,500,sanfrancisco', 'frank,30,1500,seattle', 'frank,90,700,sanfrancisco', 'frank,150,1200,se...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nLet the function f(s) be the frequency of the lexicographically smallest 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: Let the function f(s) be the frequency of the lexicographically smallest character in a non-empty string s. For example...
[ "assert candidate(queries=['zzz'], words=['aaa', 'bbb', 'ccc']) == [0]", "assert candidate(queries=['abcdabcd', 'abcdeabcde', 'abcdefabcdef'], words=['bcdefgbcdefg', 'cdefghcdefgh', 'defghidefghi']) == [0, 0, 0]", "assert candidate(queries=['zzzzzzzzzz', 'zzzzzzzzz', 'zzzzzzzz', 'zzzzzzz', 'zzzzzz', 'zzzzz', 'z...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(queries=['zzz'], words=['aaa', 'bbb', 'ccc']) == [0]", "assert candidate(queries=['abcdabcd', 'abcdeabcde', 'abcdefabcdef'], words=['bcdefgbcdefg', 'cdefghcdefgh', 'defghidefghi']) == [0, 0, 0]", "assert candidate(queries=['zzzzzzzzzz', 'zzzzzzzzz', 'zzzzzzzz', 'zzzzzz...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven the head of a linked list, we repeatedly delete consecutive sequence...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given the head of a linked list, we repeatedly delete consecutive sequences of nodes that sum to 0 until there are no s...
[ "assert is_same_list(candidate(head=list_node([1, 0, -1, 0, 1, 0, -1, 0, 1])), list_node([1]))", "assert is_same_list(candidate(head=list_node([10, 20, -10, -10])), list_node([10]))", "assert is_same_list(candidate(head=list_node([5, 6, 7, -18, 19, 20, -39, 21, 22, 23, -65, 24])), list_node([21, 22, 23, -65, 24...
newfacade/LeetCodeDataset
{ "constraints": [ "assert is_same_list(candidate(head=list_node([1, 0, -1, 0, 1, 0, -1, 0, 1])), list_node([1]))", "assert is_same_list(candidate(head=list_node([10, 20, -10, -10])), list_node([10]))", "assert is_same_list(candidate(head=list_node([5, 6, 7, -18, 19, 20, -39, 21, 22, 23, -65, 24])), list_...
[ { "role": "user", "content": "You are an expert Python programmer. You will 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 array queries where queries[i] = [lefti, righ...
You are an expert Python programmer. 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 array queries where queries[i] = [lefti, righti, ki]. We may rearrange the substring s[lef...
[ "assert candidate(s='banana', queries=[[0, 5, 1], [1, 4, 1], [2, 3, 1], [0, 3, 2], [1, 2, 2], [3, 4, 2], [2, 5, 2]]) == [True, True, True, True, True, True, True]", "assert candidate(s='thisisaverylongstringwithseveralcharacters', queries=[[0, 4, 1], [5, 9, 2], [10, 14, 3], [15, 19, 4], [20, 24, 5], [0, 25, 10]])...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='banana', queries=[[0, 5, 1], [1, 4, 1], [2, 3, 1], [0, 3, 2], [1, 2, 2], [3, 4, 2], [2, 5, 2]]) == [True, True, True, True, True, True, True]", "assert candidate(s='thisisaverylongstringwithseveralcharacters', queries=[[0, 4, 1], [5, 9, 2], [10, 14, 3], [15, 19, 4], [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:\nWith respect to a given puzzle string, a word is valid if both the followi...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: With respect to a given puzzle string, a word is valid if both the following conditions are satisfied: word contains t...
[ "assert candidate(words=['hello', 'world', 'python', 'programming'], puzzles=['hellozp', 'dlrowxy', 'thonpqr', 'grammxyz']) == [1, 1, 0, 0]", "assert candidate(words=['abcdef', 'abcdefg', 'bcdefg', 'cdefgh', 'defghi', 'efghij', 'fghijk', 'ghijkl'], puzzles=['abcdefgh', 'bcdefghi', 'cdefghij', 'defghijk', 'efghijk...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(words=['hello', 'world', 'python', 'programming'], puzzles=['hellozp', 'dlrowxy', 'thonpqr', 'grammxyz']) == [1, 1, 0, 0]", "assert candidate(words=['abcdef', 'abcdefg', 'bcdefg', 'cdefgh', 'defghi', 'efghij', 'fghijk', 'ghijkl'], puzzles=['abcdefgh', 'bcdefghi', 'cdefghij...
[ { "role": "user", "content": "You are an expert Python programmer. You will 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 list of phrases, generate a list of Before and After puzzles.\nA 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: Given a list of phrases, generate a list of Before and After puzzles. A phrase is a string that consists of lowercase E...
[ "assert candidate(phrases=['one fish two fish', 'fish red fish blue fish', 'blue fish green eggs and ham', 'eggs and ham green eggs and ham', 'ham and eggs', 'eggs are delicious', 'delicious eggs', 'eggs fish', 'fish']) == ['blue fish green eggs and ham and eggs', 'delicious eggs and ham green eggs and ham', 'delic...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(phrases=['one fish two fish', 'fish red fish blue fish', 'blue fish green eggs and ham', 'eggs and ham green eggs and ham', 'ham and eggs', 'eggs are delicious', 'delicious eggs', 'eggs fish', 'fish']) == ['blue fish green eggs and ham and eggs', 'delicious eggs and ham green ...
[ { "role": "user", "content": "You are an expert Python programmer. You will 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 colors, in which there are three colors: 1, 2 and 3...
You are an expert Python programmer. 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 colors, in which there are three colors: 1, 2 and 3. You are also given some queries. Each query...
[ "assert candidate(colors=[1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3], queries=[[0, 3], [5, 1], [10, 2], [15, 3], [20, 1]]) == [2, 1, 0, 1, 2]", "assert candidate(colors=[1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3], queries=[[0, 2], [2, 3], [7, 1], [12, 2]]) == [5, 8, 3, 3]", "assert candida...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(colors=[1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3], queries=[[0, 3], [5, 1], [10, 2], [15, 3], [20, 1]]) == [2, 1, 0, 1, 2]", "assert candidate(colors=[1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3], queries=[[0, 2], [2, 3], [7, 1], [12, 2]]) == [5, 8, 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:\nConsider a matrix M with dimensions width * height, such that every cell h...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Consider a matrix M with dimensions width * height, such that every cell has value 0 or 1, and any square sub-matrix of...
[ "assert candidate(width=8, height=12, sideLength=4, maxOnes=3) == 18", "assert candidate(width=40, height=30, sideLength=6, maxOnes=9) == 315", "assert candidate(width=6, height=6, sideLength=3, maxOnes=4) == 16", "assert candidate(width=70, height=70, sideLength=25, maxOnes=50) == 450", "assert candidate(w...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(width=8, height=12, sideLength=4, maxOnes=3) == 18", "assert candidate(width=40, height=30, sideLength=6, maxOnes=9) == 315", "assert candidate(width=6, height=6, sideLength=3, maxOnes=4) == 16", "assert candidate(width=70, height=70, sideLength=25, maxOnes=50) == ...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven an array of integers, return the maximum sum for a non-empty 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 array of integers, return the maximum sum for a non-empty subarray (contiguous elements) with at most one elem...
[ "assert candidate(arr=[1, 2, 3, -6, 4, 5, 6, -10, 7, 8, 9]) == 39", "assert candidate(arr=[1, 2, 3, 4, 5, -100, 1, 2, 3, 4, 5]) == 30", "assert candidate(arr=[0, 0, 0, 0, 0]) == 0", "assert candidate(arr=[-10, 20, -30, 40, -50, 60, -70, 80, -90, 100, -110, 120]) == 220", "assert candidate(arr=[-1, -2, 3, 4,...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(arr=[1, 2, 3, -6, 4, 5, 6, -10, 7, 8, 9]) == 39", "assert candidate(arr=[1, 2, 3, 4, 5, -100, 1, 2, 3, 4, 5]) == 30", "assert candidate(arr=[0, 0, 0, 0, 0]) == 0", "assert candidate(arr=[-10, 20, -30, 40, -50, 60, -70, 80, -90, 100, -110, 120]) == 220", "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 two integer arrays arr1 and arr2, return the minimum number of opera...
You are an expert Python programmer. 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 integer arrays arr1 and arr2, return the minimum number of operations (possibly zero) needed to make arr1 str...
[ "assert candidate(arr1=[1, 2, 2, 3, 4], arr2=[2, 3, 4, 5]) == 3", "assert candidate(arr1=[2000, 1999, 1998, 1997, 1996], arr2=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == 4", "assert candidate(arr1=[1, 1, 1, 1], arr2=[2, 2, 2, 2]) == -1", "assert candidate(arr1=[1, 3, 2, 4, 5, 6], arr2=[2, 3, 4, 5, 6, 7]) == 2", "as...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(arr1=[1, 2, 2, 3, 4], arr2=[2, 3, 4, 5]) == 3", "assert candidate(arr1=[2000, 1999, 1998, 1997, 1996], arr2=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == 4", "assert candidate(arr1=[1, 1, 1, 1], arr2=[2, 2, 2, 2]) == -1", "assert candidate(arr1=[1, 3, 2, 4, 5, 6], arr2=[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:\nGiven an integer array arr and an integer k, modify the array by repeating...
You are an expert Python programmer. 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 arr and an integer k, modify the array by repeating it k times. For example, if arr = [1, 2] and...
[ "assert candidate(arr=[-1, 4, -2, 3, -2], k=100000) == 200003", "assert candidate(arr=[5, -1, 2, 3, -2], k=10) == 72", "assert candidate(arr=[-10, 9, -20, 10, -30, 20, -40, 30, -50, 40], k=5) == 40", "assert candidate(arr=[5, -1, 3, -4, 2, 6, -5], k=10) == 65", "assert candidate(arr=[1, -1, 1, -1, 1, -1, 1,...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(arr=[-1, 4, -2, 3, -2], k=100000) == 200003", "assert candidate(arr=[5, -1, 2, 3, -2], k=10) == 72", "assert candidate(arr=[-10, 9, -20, 10, -30, 20, -40, 30, -50, 40], k=5) == 40", "assert candidate(arr=[5, -1, 3, -4, 2, 6, -5], k=10) == 65", "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 n servers numbered from 0 to n - 1 connected by undirected serve...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: There are n servers numbered from 0 to n - 1 connected by undirected server-to-server connections forming a network whe...
[ "assert candidate(n=15, connections=[[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, 0], [1, 3], [3, 5], [5, 7], [7, 9], [9, 11], [11, 13]]) == []", "assert candidate(n=10, connections=[[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=15, connections=[[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, 0], [1, 3], [3, 5], [5, 7], [7, 9], [9, 11], [11, 13]]) == []", "assert candidate(n=10, connections=[[0, 1], [1, 2], [2, 3], [3,...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nIn an infinite chess board with coordinates from -infinity to +infinity, y...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: In an infinite chess board with coordinates from -infinity to +infinity, you have a knight at square [0, 0]. A knight h...
[ "assert candidate(x=0, y=-299) == 151", "assert candidate(x=140, y=140) == 94", "assert candidate(x=-150, y=150) == 100", "assert candidate(x=100, y=100) == 68", "assert candidate(x=150, y=200) == 118", "assert candidate(x=249, y=250) == 167", "assert candidate(x=-200, y=-150) == 118", "assert candida...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(x=0, y=-299) == 151", "assert candidate(x=140, y=140) == 94", "assert candidate(x=-150, y=150) == 100", "assert candidate(x=100, y=100) == 68", "assert candidate(x=150, y=200) == 118", "assert candidate(x=249, y=250) == 167", "assert candidate(x=-200, y...
[ { "role": "user", "content": "You are an expert Python programmer. You will 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 mat where every row is sorted in strictly increasing...
You are an expert Python programmer. 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 mat where every row is sorted in strictly increasing order, return the smallest common element in...
[ "assert candidate(mat=[[1, 4, 7, 10, 13], [2, 4, 6, 8, 10], [3, 4, 5, 7, 9], [4, 5, 6, 7, 8]]) == 4", "assert candidate(mat=[[1, 3, 5, 7, 9], [2, 3, 5, 7, 9], [3, 5, 7, 9, 11], [4, 5, 7, 9, 11], [5, 7, 9, 11, 13]]) == 5", "assert candidate(mat=[[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [2, 3, 4, 5, 6, 7, 8, 9, 10, 11], ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(mat=[[1, 4, 7, 10, 13], [2, 4, 6, 8, 10], [3, 4, 5, 7, 9], [4, 5, 6, 7, 8]]) == 4", "assert candidate(mat=[[1, 3, 5, 7, 9], [2, 3, 5, 7, 9], [3, 5, 7, 9, 11], [4, 5, 7, 9, 11], [5, 7, 9, 11, 13]]) == 5", "assert candidate(mat=[[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [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 a list of blocks, where blocks[i] = t means that the i-th bl...
You are an expert Python programmer. 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 list of blocks, where blocks[i] = t means that the i-th block needs t units of time to be built. A bloc...
[ "assert candidate(blocks=[100000, 90000, 80000, 70000, 60000, 50000, 40000, 30000, 20000, 10000], split=10000) == 110000", "assert candidate(blocks=[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], split=2) == 34", "assert candidate(blocks=[10, 20, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(blocks=[100000, 90000, 80000, 70000, 60000, 50000, 40000, 30000, 20000, 10000], split=10000) == 110000", "assert candidate(blocks=[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], split=2) == 34", "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 strings s and t of the same length and an integer maxCos...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given two strings s and t of the same length and an integer maxCost. You want to change s to t. Changing the it...
[ "assert candidate(s='mississippi', t='abababababa', maxCost=10) == 1", "assert candidate(s='abcdefghijklmnopqrstuvwxyz', t='zyxwvutsrqponmlkjihgfedcba', maxCost=25) == 7", "assert candidate(s='aabbccddeeff', t='zzeeffgghhii', maxCost=15) == 5", "assert candidate(s='abcdefghij', t='jihgfedcba', maxCost=50) == ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='mississippi', t='abababababa', maxCost=10) == 1", "assert candidate(s='abcdefghijklmnopqrstuvwxyz', t='zyxwvutsrqponmlkjihgfedcba', maxCost=25) == 7", "assert candidate(s='aabbccddeeff', t='zzeeffgghhii', maxCost=15) == 5", "assert candidate(s='abcdefghij', t='j...
[ { "role": "user", "content": "You are an expert Python programmer. You will 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 an integer k, a k duplicate removal consists ...
You are an expert Python programmer. 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 an integer k, a k duplicate removal consists of choosing k adjacent and equal letters from...
[ "assert candidate(s='aaaabbbccc', k=4) == 'bbbccc'", "assert candidate(s='abcde', k=2) == 'abcde'", "assert candidate(s='xyzzzzzzzzzzzyyxwwwwwwwwwwwwwxvvvvvvvvvvvvvuuuuuuuuuuuuuutttttttttttttsssssssssssssrrrrrrrrrrrrrqqqqqqqqqqqqqpnnnnnnnnnnnnnoommmmmmmmmmmmmllllllllllllllkkkkkkkkkkkkkkjjjjjjjjjjjjjjiiiiiiiiiii...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='aaaabbbccc', k=4) == 'bbbccc'", "assert candidate(s='abcde', k=2) == 'abcde'", "assert candidate(s='xyzzzzzzzzzzzyyxwwwwwwwwwwwwwxvvvvvvvvvvvvvuuuuuuuuuuuuuutttttttttttttsssssssssssssrrrrrrrrrrrrrqqqqqqqqqqqqqpnnnnnnnnnnnnnoommmmmmmmmmmmmllllllllllllllkkkkkkkkkkkkkk...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nIn an n*n grid, there is a snake that spans 2 cells and starts moving 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: In an n*n grid, there is a snake that spans 2 cells and starts moving from the top left corner at (0, 0) and (0, 1). Th...
[ "assert candidate(grid=[[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 1, 0, 1, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 1, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 1, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 1, 0, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(grid=[[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 1, 0, 1, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 1, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 1, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 1, 0, 1, 0], [0, 0, 0, 0, 0,...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nA stepping number is an integer such that all of its adjacent digits have ...
You are an expert Python programmer. 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 stepping number is an integer such that all of its adjacent digits have an absolute difference of exactly 1. For exa...
[ "assert candidate(low=222222, high=222223) == []", "assert candidate(low=987654, high=987654321) == [987654, 987656, 987676, 987678, 987876, 987878, 987898, 989876, 989878, 989898, 1010101, 1010121, 1010123, 1012101, 1012121, 1012123, 1012321, 1012323, 1012343, 1012345, 1210101, 1210121, 1210123, 1212101, 1212121...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(low=222222, high=222223) == []", "assert candidate(low=987654, high=987654321) == [987654, 987656, 987676, 987678, 987876, 987878, 987898, 989876, 989878, 989898, 1010101, 1010121, 1010123, 1012101, 1012121, 1012123, 1012321, 1012323, 1012343, 1012345, 1210101, 1210121, 12...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven a string s and an integer k, return true if s is a k-palindrome.\nA ...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given a string s and an integer k, return true if s is a k-palindrome. A string is k-palindrome if it can be transforme...
[ "assert candidate(s='zxcvbnmlkjhgfdsapoiuytrewq', k=13) == False", "assert candidate(s='abcdefgfedcba', k=3) == True", "assert candidate(s='anana', k=1) == True", "assert candidate(s='abcdefghijk', k=9) == False", "assert candidate(s='racecar', k=2) == True", "assert candidate(s='a', k=0) == False", "as...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='zxcvbnmlkjhgfdsapoiuytrewq', k=13) == False", "assert candidate(s='abcdefgfedcba', k=3) == True", "assert candidate(s='anana', k=1) == True", "assert candidate(s='abcdefghijk', k=9) == False", "assert candidate(s='racecar', k=2) == True", "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:\nGiven an integer array arr and an integer difference, return the length of...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given an integer array arr and an integer difference, return the length of the longest subsequence in arr which is an a...
[ "assert candidate(arr=[3, 6, 9, 12, 15, 18, 21, 24, 27, 30], difference=3) == 10", "assert candidate(arr=[1, 7, 13, 19, 25, 31, 37, 43, 49, 55], difference=6) == 10", "assert candidate(arr=[0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6], difference=1) == 7", "assert candidate(arr=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(arr=[3, 6, 9, 12, 15, 18, 21, 24, 27, 30], difference=3) == 10", "assert candidate(arr=[1, 7, 13, 19, 25, 31, 37, 43, 49, 55], difference=6) == 10", "assert candidate(arr=[0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6], difference=1) == 7", "assert candidate(arr=[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:\nIn a gold mine grid of size m x n, each cell in this mine has an integer r...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: In a gold mine grid of size m x n, each cell in this mine has an integer representing the amount of gold in that cell, ...
[ "assert candidate(grid=[[0, 1, 0, 1, 0], [1, 0, 1, 0, 1], [0, 1, 0, 1, 0], [1, 0, 1, 0, 1], [0, 1, 0, 1, 0]]) == 1", "assert candidate(grid=[[10, 33], [8, 3]]) == 54", "assert candidate(grid=[[0, 0, 10, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(grid=[[0, 1, 0, 1, 0], [1, 0, 1, 0, 1], [0, 1, 0, 1, 0], [1, 0, 1, 0, 1], [0, 1, 0, 1, 0]]) == 1", "assert candidate(grid=[[10, 33], [8, 3]]) == 54", "assert candidate(grid=[[0, 0, 10, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven an integer n, your task is to count how many strings of length n can...
You are an expert Python programmer. 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 n, your task is to count how many strings of length n can be formed under the following rules: Each c...
[ "assert candidate(n=2) == 10", "assert candidate(n=20) == 1151090", "assert candidate(n=200) == 670333618", "assert candidate(n=10000) == 76428576", "assert candidate(n=50) == 227130014", "assert candidate(n=150) == 965179800", "assert candidate(n=19999) == 706457669", "assert candidate(n=100) == 1739...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=2) == 10", "assert candidate(n=20) == 1151090", "assert candidate(n=200) == 670333618", "assert candidate(n=10000) == 76428576", "assert candidate(n=50) == 227130014", "assert candidate(n=150) == 965179800", "assert candidate(n=19999) == 706457669", ...
[ { "role": "user", "content": "You are an expert Python programmer. You will 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 a 0-indexed 8 x 8 chessboard, there can be multiple black queens and on...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: On a 0-indexed 8 x 8 chessboard, there can be multiple black queens and one white king. You are given a 2D integer arra...
[ "assert candidate(queens=[[1, 1], [2, 2], [3, 3], [4, 4], [5, 5], [6, 6], [7, 7]], king=[3, 3]) == [[2, 2], [4, 4]]", "assert candidate(queens=[[0, 0], [0, 7], [7, 0], [7, 7], [3, 3], [4, 4], [2, 2], [5, 5], [1, 1], [6, 6], [0, 3], [3, 0], [3, 6], [6, 3]], king=[3, 3]) == [[2, 2], [0, 3], [3, 0], [3, 6], [6, 3], ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(queens=[[1, 1], [2, 2], [3, 3], [4, 4], [5, 5], [6, 6], [7, 7]], king=[3, 3]) == [[2, 2], [4, 4]]", "assert candidate(queens=[[0, 0], [0, 7], [7, 0], [7, 7], [3, 3], [4, 4], [2, 2], [5, 5], [1, 1], [6, 6], [0, 3], [3, 0], [3, 6], [6, 3]], king=[3, 3]) == [[2, 2], [0, 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:\nA die simulator generates a random number from 1 to 6 for each roll. You 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: A die simulator generates a random number from 1 to 6 for each roll. You introduced a constraint to the generator such ...
[ "assert candidate(n=350, rollMax=[2, 3, 4, 5, 6, 7]) == 326686679", "assert candidate(n=10, rollMax=[2, 3, 4, 5, 6, 7]) == 58240426", "assert candidate(n=10, rollMax=[1, 1, 1, 2, 3, 4]) == 27915907", "assert candidate(n=50, rollMax=[3, 4, 5, 6, 7, 8]) == 753899520", "assert candidate(n=150, rollMax=[5, 5, 5...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=350, rollMax=[2, 3, 4, 5, 6, 7]) == 326686679", "assert candidate(n=10, rollMax=[2, 3, 4, 5, 6, 7]) == 58240426", "assert candidate(n=10, rollMax=[1, 1, 1, 2, 3, 4]) == 27915907", "assert candidate(n=50, rollMax=[3, 4, 5, 6, 7, 8]) == 753899520", "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:\nGiven an array nums of positive integers, return the longest possible 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: Given an array nums of positive integers, return the longest possible length of an array prefix of nums, such that it i...
[ "assert candidate(nums=[1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9]) == 25", "assert candidate(nums=[1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5]) == 10", "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 1, 2, 2]) == 21", "assert ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9]) == 25", "assert candidate(nums=[1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5]) == 10", "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 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:\nn passengers board an airplane with exactly n seats. The first passenger h...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: n passengers board an airplane with exactly n seats. The first passenger has lost the ticket and picks a seat randomly....
[ "assert candidate(n=2) == 0.5", "assert candidate(n=101) == 0.5", "assert candidate(n=1001) == 0.5", "assert candidate(n=200000) == 0.5", "assert candidate(n=1) == 1", "assert candidate(n=100) == 0.5", "assert candidate(n=50001) == 0.5", "assert candidate(n=200) == 0.5", "assert candidate(n=50) == 0...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=2) == 0.5", "assert candidate(n=101) == 0.5", "assert candidate(n=1001) == 0.5", "assert candidate(n=200000) == 0.5", "assert candidate(n=1) == 1", "assert candidate(n=100) == 0.5", "assert candidate(n=50001) == 0.5", "assert candidate(n=200) == 0...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven the availability time slots arrays slots1 and slots2 of two people a...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given the availability time slots arrays slots1 and slots2 of two people and a meeting duration duration, return the ea...
[ "assert candidate(slots1=[[1, 100], [200, 300], [400, 500]], slots2=[[50, 150], [250, 350], [450, 550]], duration=50) == [50, 100]", "assert candidate(slots1=[[10, 15], [25, 30]], slots2=[[12, 17], [27, 32]], duration=3) == [12, 15]", "assert candidate(slots1=[[1000000000, 1000000010], [1000000020, 1000000030]]...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(slots1=[[1, 100], [200, 300], [400, 500]], slots2=[[50, 150], [250, 350], [450, 550]], duration=50) == [50, 100]", "assert candidate(slots1=[[10, 15], [25, 30]], slots2=[[12, 17], [27, 32]], duration=3) == [12, 15]", "assert candidate(slots1=[[1000000000, 1000000010], ...
[ { "role": "user", "content": "You are an expert Python programmer. You will 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 some coins.  The i-th coin has a probability prob[i] of facing he...
You are an expert Python programmer. 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 some coins.  The i-th coin has a probability prob[i] of facing heads when tossed. Return the probability that ...
[ "assert candidate(prob=[0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05], target=3) == 0.05958214776873273", "assert candidate(prob=[0.4], target=1) == 0.4", "assert candidate(prob=[0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25]...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(prob=[0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05], target=3) == 0.05958214776873273", "assert candidate(prob=[0.4], target=1) == 0.4", "assert candidate(prob=[0.25, 0.25, 0.25, 0.25, 0.25, 0.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 have one chocolate bar that consists of some chunks. Each chunk has 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 have one chocolate bar that consists of some chunks. Each chunk has its own sweetness given by the array sweetness....
[ "assert candidate(sweetness=[9, 8, 7, 6, 5, 4, 3, 2, 1, 9, 8, 7, 6, 5, 4, 3, 2, 1, 9, 8, 7, 6, 5, 4, 3, 2, 1, 9, 8, 7, 6, 5, 4, 3, 2, 1, 9, 8, 7, 6, 5, 4], k=32) == 4", "assert candidate(sweetness=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], k=5) == 3", "assert candidate(sweetness=[1, 10, 100, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(sweetness=[9, 8, 7, 6, 5, 4, 3, 2, 1, 9, 8, 7, 6, 5, 4, 3, 2, 1, 9, 8, 7, 6, 5, 4, 3, 2, 1, 9, 8, 7, 6, 5, 4, 3, 2, 1, 9, 8, 7, 6, 5, 4], k=32) == 4", "assert candidate(sweetness=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], k=5) == 3", "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:\nGiven a list of folders folder, return the folders after removing all sub-...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given a list of folders folder, return the folders after removing all sub-folders in those folders. You may return the ...
[ "assert candidate(folder=['/data/backups', '/data/backups/weekly', '/data/backups/monthly', '/data/backups/yearly', '/data/backups/weekly/2021-01-01', '/data/backups/weekly/2021-02-01', '/data/backups/monthly/2021-01', '/data/backups/yearly/2020']) == ['/data/backups']", "assert candidate(folder=['/user/home', '/...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(folder=['/data/backups', '/data/backups/weekly', '/data/backups/monthly', '/data/backups/yearly', '/data/backups/weekly/2021-01-01', '/data/backups/weekly/2021-02-01', '/data/backups/monthly/2021-01', '/data/backups/yearly/2020']) == ['/data/backups']", "assert candidate(f...
[ { "role": "user", "content": "You are an expert Python programmer. You will 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 length n containing only four kinds of charact...
You are an expert Python programmer. 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 length n containing only four kinds of characters: 'Q', 'W', 'E', and 'R'. A string is said...
[ "assert candidate(s='QQQWWWWWWWWEEEEEEEEEEEEEEEEERRRRRRRRRRRRRRRR') == 11", "assert candidate(s='QQQQQQQQWWWWWWWWWEEEEEEEEEEEEEEEEERRRRRRRRRRRRRR') == 7", "assert candidate(s='QWQWQWQWQWQWQWQWQWQWQWQWQWQWQWQWQW') == 18", "assert candidate(s='QQQWEEERRRRQQQWEEERRRRQQQWEEERRRRQQQWEEERRRRQQQWEEERRRRQQQWEEERRRRQQ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='QQQWWWWWWWWEEEEEEEEEEEEEEEEERRRRRRRRRRRRRRRR') == 11", "assert candidate(s='QQQQQQQQWWWWWWWWWEEEEEEEEEEEEEEEEERRRRRRRRRRRRRR') == 7", "assert candidate(s='QWQWQWQWQWQWQWQWQWQWQWQWQWQWQWQWQW') == 18", "assert candidate(s='QQQWEEERRRRQQQWEEERRRRQQQWEEERRRRQQQWEEER...
[ { "role": "user", "content": "You are an expert Python programmer. You will 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 2 integers n and start. Your task is return any permutation p of (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 2 integers n and start. Your task is return any permutation p of (0,1,2.....,2^n -1) such that :\r \r \r p[0] = ...
[ "assert candidate(n=10, start=31) == [31, 29, 28, 20, 21, 23, 22, 18, 19, 17, 16, 48, 49, 51, 50, 54, 55, 53, 52, 60, 61, 63, 62, 58, 59, 57, 56, 40, 41, 43, 42, 46, 47, 45, 44, 36, 37, 39, 38, 34, 35, 33, 32, 96, 97, 99, 98, 102, 103, 101, 100, 108, 109, 111, 110, 106, 107, 105, 104, 120, 121, 123, 122, 126, 127, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=10, start=31) == [31, 29, 28, 20, 21, 23, 22, 18, 19, 17, 16, 48, 49, 51, 50, 54, 55, 53, 52, 60, 61, 63, 62, 58, 59, 57, 56, 40, 41, 43, 42, 46, 47, 45, 44, 36, 37, 39, 38, 34, 35, 33, 32, 96, 97, 99, 98, 102, 103, 101, 100, 108, 109, 111, 110, 106, 107, 105, 104, 120, 121,...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an array of strings arr. A string s is formed by the concate...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given an array of strings arr. A string s is formed by the concatenation of a subsequence of arr that has uniqu...
[ "assert candidate(arr=['abc', 'def', 'ghi', 'jkl', 'mno', 'pqr', 'stu', 'vwx', 'yz', 'a', 'b', 'c', 'd']) == 26", "assert candidate(arr=['abcdefgh', 'ijklmnop', 'qrstuvwx', 'yzabcdef', 'ghijklmn', 'opqrstuv', 'wxyzab', 'cdefghij', 'klmnopqr', 'stuvwxy']) == 24", "assert candidate(arr=['zyxwvutsrqponmlkjihgfedcb...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(arr=['abc', 'def', 'ghi', 'jkl', 'mno', 'pqr', 'stu', 'vwx', 'yz', 'a', 'b', 'c', 'd']) == 26", "assert candidate(arr=['abcdefgh', 'ijklmnop', 'qrstuvwx', 'yzabcdef', 'ghijklmn', 'opqrstuv', 'wxyzab', 'cdefghij', 'klmnopqr', 'stuvwxy']) == 24", "assert candidate(arr=['...
[ { "role": "user", "content": "You are an expert Python programmer. You will 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 rectangle of size n x m, return the minimum number of integer-side...
You are an expert Python programmer. 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 rectangle of size n x m, return the minimum number of integer-sided squares that tile the rectangle.   Constrai...
[ "assert candidate(n=3, m=14) == 7", "assert candidate(n=6, m=13) == 6", "assert candidate(n=8, m=10) == 5", "assert candidate(n=6, m=10) == 4", "assert candidate(n=11, m=10) == 6", "assert candidate(n=10, m=15) == 3", "assert candidate(n=13, m=7) == 6", "assert candidate(n=4, m=6) == 3", "assert can...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=3, m=14) == 7", "assert candidate(n=6, m=13) == 6", "assert candidate(n=8, m=10) == 5", "assert candidate(n=6, m=10) == 4", "assert candidate(n=11, m=10) == 6", "assert candidate(n=10, m=15) == 3", "assert candidate(n=13, m=7) == 6", "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:\nGiven a URL startUrl and an interface HtmlParser, implement a Multi-thread...
You are an expert Python programmer. 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 URL startUrl and an interface HtmlParser, implement a Multi-threaded web crawler to crawl all links that are un...
[ "assert candidate(startUrl='http://news.google.com', htmlParser='HtmlParser()') == ['http://news.google.com']", "assert candidate(startUrl='http://smallset.com/', htmlParser='HtmlParserObject') == ['http://smallset.com/']", "assert candidate(startUrl='http://example.com/circular/page1', htmlParser='HtmlParserOb...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(startUrl='http://news.google.com', htmlParser='HtmlParser()') == ['http://news.google.com']", "assert candidate(startUrl='http://smallset.com/', htmlParser='HtmlParserObject') == ['http://smallset.com/']", "assert candidate(startUrl='http://example.com/circular/page1',...
[ { "role": "user", "content": "You are an expert Python programmer. You will 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 arr.\nIn one move, you can select a palindr...
You are an expert Python programmer. 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 arr. In one move, you can select a palindromic subarray arr[i], arr[i + 1], ..., arr[j] ...
[ "assert candidate(arr=[1, 2, 1, 3, 1, 2, 1, 4, 1, 3, 1, 2, 1, 5, 1, 4, 1, 3, 1, 2, 1]) == 5", "assert candidate(arr=[1, 2, 1, 2, 1, 2, 1]) == 1", "assert candidate(arr=[1, 2]) == 2", "assert candidate(arr=[1, 2, 3, 4, 5, 4, 3, 2, 1, 2, 3, 4, 5, 4, 3, 2, 1]) == 1", "assert candidate(arr=[1, 2, 3, 2, 1, 3, 2,...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(arr=[1, 2, 1, 3, 1, 2, 1, 4, 1, 3, 1, 2, 1, 5, 1, 4, 1, 3, 1, 2, 1]) == 5", "assert candidate(arr=[1, 2, 1, 2, 1, 2, 1]) == 1", "assert candidate(arr=[1, 2]) == 2", "assert candidate(arr=[1, 2, 3, 4, 5, 4, 3, 2, 1, 2, 3, 4, 5, 4, 3, 2, 1]) == 1", "assert candid...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given two strings s1 and s2 of equal length consisting of letters ...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given two strings s1 and s2 of equal length consisting of letters "x" and "y" only. Your task is to make these ...
[ "assert candidate(s1='xyyxxyyxxy', s2='yxyxyxyxyx') == 4", "assert candidate(s1='xyxyxyxyxy', s2='yxyxyxyxyx') == 6", "assert candidate(s1='xyxxyxyxyx', s2='xyxyxyxyyx') == -1", "assert candidate(s1='xyyxxyyxxyyx', s2='yxyxyxyxyxyy') == -1", "assert candidate(s1='xyxyxyxyxyxyxyxyxyxyxyxyxyxy', s2='yxyxyxyxy...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s1='xyyxxyyxxy', s2='yxyxyxyxyx') == 4", "assert candidate(s1='xyxyxyxyxy', s2='yxyxyxyxyx') == 6", "assert candidate(s1='xyxxyxyxyx', s2='xyxyxyxyyx') == -1", "assert candidate(s1='xyyxxyyxxyyx', s2='yxyxyxyxyxyy') == -1", "assert candidate(s1='xyxyxyxyxyxyxyx...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven an array of integers nums and an integer k. A continuous subarray 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: Given an array of integers nums and an integer k. A continuous subarray is called nice if there are k odd numbers on it...
[ "assert candidate(nums=[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39], k=15) == 6", "assert candidate(nums=[1, 1, 2, 1, 2, 1, 2, 1, 2, 1], k=3) == 10", "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], k=5) == 12", "assert candidate(nums=[1, 2, 3, 2, 1, 2...
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=15) == 6", "assert candidate(nums=[1, 1, 2, 1, 2, 1, 2, 1, 2, 1], k=3) == 10", "assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], k=5) == 12", "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:\nGiven a string s of '(' , ')' and lowercase English characters.\nYour task...
You are an expert Python programmer. 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 of '(' , ')' and lowercase English characters. Your task is to remove the minimum number of parenthese...
[ "assert candidate(s='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') == 'a(b(c(d(e(f(g(h)i)j)k)l)m)n)o(p)q(r)st(u)v(w(x)y)z'", "assert candidate(s='(abc(def(ghi(jkl(mnopqr(stu(vwx(yz)))))))') == 'abc(def(ghi(jkl(mnopqr(stu(vwx(yz)))))))'", "assert candidate(s='((((a(b)c)d(e(f)g)h)i(j(k(l)m)n)o(p)q(r)s)t(u...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='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') == 'a(b(c(d(e(f(g(h)i)j)k)l)m)n)o(p)q(r)st(u)v(w(x)y)z'", "assert candidate(s='(abc(def(ghi(jkl(mnopqr(stu(vwx(yz)))))))') == 'abc(def(ghi(jkl(mnopqr(stu(vwx(yz)))))))'", "assert candidate(s='((((a(b)c)d(e(f)g)h)...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven an array nums of positive integers. Your task is to select some subs...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given an array nums of positive integers. Your task is to select some subset of nums, multiply each element by an integ...
[ "assert candidate(nums=[4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42]) == False", "assert candidate(nums=[11, 13, 17, 19]) == True", "assert candidate(nums=[8, 12, 18, 24, 30, 36, 42, 48, 54]) == False", "assert candidate(nums=[1000000000, 1000000000, 1000000000, 1000000000, 100...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42]) == False", "assert candidate(nums=[11, 13, 17, 19]) == True", "assert candidate(nums=[8, 12, 18, 24, 30, 36, 42, 48, 54]) == False", "assert candidate(nums=[1000000000, 1000000000, ...
[ { "role": "user", "content": "You are an expert Python programmer. You will 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 following details of a matrix with n columns and 2 rows :\n\nThe...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given the following details of a matrix with n columns and 2 rows : The matrix is a binary matrix, which means each el...
[ "assert candidate(upper=5, lower=3, colsum=[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) == []", "assert candidate(upper=9, lower=9, colsum=[2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2]) == []", "assert candidate(upper=5, lower=5, colsum=[2, 1, 2, 0, 1, 0, 1, 2, 0, 1]) == [[1, 0, 1, 0, 1, 0, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(upper=5, lower=3, colsum=[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) == []", "assert candidate(upper=9, lower=9, colsum=[2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2]) == []", "assert candidate(upper=5, lower=5, colsum=[2, 1, 2, 0, 1, 0, 1, 2, 0, 1]...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven a 2D grid consists of 0s (land) and 1s (water).  An island is a maxi...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given a 2D grid consists of 0s (land) and 1s (water).  An island is a maximal 4-directionally connected group of 0s and...
[ "assert candidate(grid=[[1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1], [1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1], [1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1], [1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 1, 1, 0,...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(grid=[[1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1], [1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1], [1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1], [1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0...