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:\nGiven a list of words, list of  single letters (might be repeating) and sc...
You are an expert Python programmer. 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 words, list of  single letters (might be repeating) and score of every character. Return the maximum sc...
[ "assert candidate(words=['zebra', 'elephant', 'giraffe', 'hippo'], letters=['a', 'e', 'e', 'f', 'g', 'h', 'i', 'i', 'l', 'n', 'o', 'p', 'p', 'r', 'r', 's', 't', 'u', 'z', 'z'], score=[1, 3, 3, 2, 1, 4, 2, 4, 1, 8, 5, 1, 3, 1, 1, 3, 10, 1, 1, 1, 1, 4, 4, 8, 4, 10]) == 13", "assert candidate(words=['abracadabra', '...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(words=['zebra', 'elephant', 'giraffe', 'hippo'], letters=['a', 'e', 'e', 'f', 'g', 'h', 'i', 'i', 'l', 'n', 'o', 'p', 'p', 'r', 'r', 's', 't', 'u', 'z', 'z'], score=[1, 3, 3, 2, 1, 4, 2, 4, 1, 8, 5, 1, 3, 1, 1, 3, 10, 1, 1, 1, 1, 4, 4, 8, 4, 10]) == 13", "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:\nGiven a non-negative integer num, Return its encoding string.\\r\n\\r\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 a non-negative integer num, Return its encoding string.\r \r The encoding is done by converting the integer to a ...
[ "assert candidate(num=16383) == '00000000000000'", "assert candidate(num=65536) == '0000000000000001'", "assert candidate(num=536870911) == '00000000000000000000000000000'", "assert candidate(num=64) == '000001'", "assert candidate(num=17179869183) == '0000000000000000000000000000000000'", "assert candida...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(num=16383) == '00000000000000'", "assert candidate(num=65536) == '0000000000000001'", "assert candidate(num=536870911) == '00000000000000000000000000000'", "assert candidate(num=64) == '000001'", "assert candidate(num=17179869183) == '00000000000000000000000000...
[ { "role": "user", "content": "You are an expert Python programmer. You will be 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 even number of people numPeople that stand around a circl...
You are an expert Python programmer. You 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 even number of people numPeople that stand around a circle and each person shakes hands with someone e...
[ "assert candidate(numPeople=750) == 309104184", "assert candidate(numPeople=70) == 93302951", "assert candidate(numPeople=60) == 475387402", "assert candidate(numPeople=800) == 497153305", "assert candidate(numPeople=80) == 602941373", "assert candidate(numPeople=30) == 9694845", "assert candidate(numPe...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(numPeople=750) == 309104184", "assert candidate(numPeople=70) == 93302951", "assert candidate(numPeople=60) == 475387402", "assert candidate(numPeople=800) == 497153305", "assert candidate(numPeople=80) == 602941373", "assert candidate(numPeople=30) == 9694...
[ { "role": "user", "content": "You are an expert Python programmer. You will 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 maximum possible sum of elements o...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given an integer array nums, return the maximum possible sum of elements of the array such that it is divisible by thre...
[ "assert candidate(nums=[1, 2, 0, 3, 0, 6, 0, 9, 0, 12, 0, 15, 0, 18, 0, 21, 0, 24, 0, 27, 0, 30]) == 168", "assert candidate(nums=[1, 4, 7, 10, 13, 16, 19, 22, 25, 28]) == 144", "assert candidate(nums=[2, 5, 8, 11, 14, 17, 20, 23, 26, 29, 32, 35, 38]) == 258", "assert candidate(nums=[2, 3, 5, 7, 11, 13, 17, 1...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[1, 2, 0, 3, 0, 6, 0, 9, 0, 12, 0, 15, 0, 18, 0, 21, 0, 24, 0, 27, 0, 30]) == 168", "assert candidate(nums=[1, 4, 7, 10, 13, 16, 19, 22, 25, 28]) == 144", "assert candidate(nums=[2, 5, 8, 11, 14, 17, 20, 23, 26, 29, 32, 35, 38]) == 258", "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:\nA storekeeper is a game in which the player pushes boxes around in a wareh...
You are an expert Python programmer. 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 storekeeper is a game in which the player pushes boxes around in a warehouse trying to get them to target locations. ...
[ "assert candidate(grid=[['#', '#', '#', '#', '#', '#', '#'], ['#', '.', '.', 'T', '.', '.', '#'], ['#', '.', '#', '#', '#', '.', '#'], ['#', '.', '.', 'B', '.', '.', '#'], ['#', '#', '#', '#', '#', '.', '#'], ['#', '.', '.', '.', 'S', '.', '#'], ['#', '#', '#', '#', '#', '#', '#']]) == -1", "assert candidate(grid...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(grid=[['#', '#', '#', '#', '#', '#', '#'], ['#', '.', '.', 'T', '.', '.', '#'], ['#', '.', '#', '#', '#', '.', '#'], ['#', '.', '.', 'B', '.', '.', '#'], ['#', '#', '#', '#', '#', '.', '#'], ['#', '.', '.', '.', 'S', '.', '#'], ['#', '#', '#', '#', '#', '#', '#']]) == -1", ...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a map of a server center, represented as a m * n integer mat...
You are an expert Python programmer. You 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 map of a server center, represented as a m * n integer matrix grid, where 1 means that on that cell the...
[ "assert candidate(grid=[[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]) == 16", "assert candidate(grid=[[0]]) == 0", "assert candidate(grid=[[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]) == 0", "assert candidate(grid=[[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]) == 12", "assert candidate(g...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(grid=[[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]) == 16", "assert candidate(grid=[[0]]) == 0", "assert candidate(grid=[[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]) == 0", "assert candidate(grid=[[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]) ==...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an array of strings products and a string searchWord.\nDesig...
You are an expert Python programmer. You 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 products and a string searchWord. Design a system that suggests at most three product...
[ "assert candidate(products=['elephant', 'elephant', 'elephant', 'elephant', 'elephant', 'elephant', 'elephant', 'elephant', 'elephant', 'elephant'], searchWord='elephant') == [['elephant', 'elephant', 'elephant'], ['elephant', 'elephant', 'elephant'], ['elephant', 'elephant', 'elephant'], ['elephant', 'elephant', '...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(products=['elephant', 'elephant', 'elephant', 'elephant', 'elephant', 'elephant', 'elephant', 'elephant', 'elephant', 'elephant'], searchWord='elephant') == [['elephant', 'elephant', 'elephant'], ['elephant', 'elephant', 'elephant'], ['elephant', 'elephant', 'elephant'], ['ele...
[ { "role": "user", "content": "You are an expert Python programmer. You will be 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 pointer at index 0 in an array of size arrLen. At each step, yo...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You have a pointer at index 0 in an array of size arrLen. At each step, you can move 1 position to the left, 1 position...
[ "assert candidate(steps=400, arrLen=2) == 99483769", "assert candidate(steps=100, arrLen=500) == 345787718", "assert candidate(steps=400, arrLen=500) == 990505357", "assert candidate(steps=3, arrLen=10) == 4", "assert candidate(steps=450, arrLen=500) == 679622497", "assert candidate(steps=200, arrLen=5000...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(steps=400, arrLen=2) == 99483769", "assert candidate(steps=100, arrLen=500) == 345787718", "assert candidate(steps=400, arrLen=500) == 990505357", "assert candidate(steps=3, arrLen=10) == 4", "assert candidate(steps=450, arrLen=500) == 679622497", "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:\nA set of real numbers can be represented as the union of several disjoint ...
You are an expert Python programmer. 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 set of real numbers can be represented as the union of several disjoint intervals, where each interval is in the form...
[ "assert candidate(intervals=[[-2, -1], [-0.5, 0], [0.5, 1], [1.5, 2]], toBeRemoved=[-1.5, 1.5]) == [[-2, -1.5], [1.5, 2]]", "assert candidate(intervals=[[-5, 0], [1, 3], [5, 7], [8, 10], [12, 15]], toBeRemoved=[-10, -1]) == [[-1, 0], [1, 3], [5, 7], [8, 10], [12, 15]]", "assert candidate(intervals=[[-1000000000...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(intervals=[[-2, -1], [-0.5, 0], [0.5, 1], [1.5, 2]], toBeRemoved=[-1.5, 1.5]) == [[-2, -1.5], [1.5, 2]]", "assert candidate(intervals=[[-5, 0], [1, 3], [5, 7], [8, 10], [12, 15]], toBeRemoved=[-10, -1]) == [[-1, 0], [1, 3], [5, 7], [8, 10], [12, 15]]", "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 two integers tomatoSlices and cheeseSlices. The ingredients of diffe...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given two integers tomatoSlices and cheeseSlices. The ingredients of different burgers are as follows: Jumbo Burger: 4...
[ "assert candidate(tomatoSlices=15, cheeseSlices=5) == []", "assert candidate(tomatoSlices=17, cheeseSlices=4) == []", "assert candidate(tomatoSlices=20000000, cheeseSlices=5000000) == [5000000, 0]", "assert candidate(tomatoSlices=88, cheeseSlices=22) == [22, 0]", "assert candidate(tomatoSlices=14, cheeseSli...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(tomatoSlices=15, cheeseSlices=5) == []", "assert candidate(tomatoSlices=17, cheeseSlices=4) == []", "assert candidate(tomatoSlices=20000000, cheeseSlices=5000000) == [5000000, 0]", "assert candidate(tomatoSlices=88, cheeseSlices=22) == [22, 0]", "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 a m * n matrix of ones and zeros, return how many square submatrices...
You are an expert Python programmer. 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 m * n matrix of ones and zeros, return how many square submatrices have all ones.   Constraints: 1 <= arr.leng...
[ "assert candidate(matrix=[[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, 0, 1, 0], [1, 0, 1, 0, 1, 0, 1], [0, 1, 0, 1, 0, 1, 0], [1, 0, 1, 0, 1, 0, 1]]) == 25", "assert candidate(matrix=[[0, 1, 0, 1, 0], [1, 1, 1, 1, 1], [0, 1, 1, 1, 0], [0, 1, 1, 1, 0], [0, 0, 0, 0, 0]]) == 18"...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(matrix=[[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, 0, 1, 0], [1, 0, 1, 0, 1, 0, 1], [0, 1, 0, 1, 0, 1, 0], [1, 0, 1, 0, 1, 0, 1]]) == 25", "assert candidate(matrix=[[0, 1, 0, 1, 0], [1, 1, 1, 1, 1], [0, 1, 1, 1, 0], [0, 1, 1, 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:\nThere are n people that are split into some unknown number of groups. Each...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: There are n people that are split into some unknown number of groups. Each person is labeled with a unique ID from 0 to...
[ "assert candidate(groupSizes=[5, 1, 5, 5, 5, 1, 5, 5, 5, 5, 1]) == [[0, 2, 3, 4, 6], [7, 8, 9], [1], [5], [10]]", "assert candidate(groupSizes=[3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) == [[0, 1, 2], [3, 4], [5], [6], [7], [8], [9], [10], [11], [12], [13], [14], [...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(groupSizes=[5, 1, 5, 5, 5, 1, 5, 5, 5, 5, 1]) == [[0, 2, 3, 4, 6], [7, 8, 9], [1], [5], [10]]", "assert candidate(groupSizes=[3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) == [[0, 1, 2], [3, 4], [5], [6], [7], [8], [9], [10], [1...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven a m x n binary matrix mat. In one step, you can choose one cell and ...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given a m x n binary matrix mat. In one step, you can choose one cell and flip it and all the four neighbors of it if t...
[ "assert candidate(mat=[[1, 1, 0, 1], [1, 0, 1, 0], [0, 1, 0, 1], [1, 0, 1, 1]]) == 6", "assert candidate(mat=[[1, 0, 0], [1, 0, 0]]) == -1", "assert candidate(mat=[[1, 1, 1], [0, 0, 0], [1, 1, 1]]) == 2", "assert candidate(mat=[[1, 1, 0, 0], [0, 0, 1, 1], [1, 1, 0, 0], [0, 0, 1, 1]]) == -1", "assert candida...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(mat=[[1, 1, 0, 1], [1, 0, 1, 0], [0, 1, 0, 1], [1, 0, 1, 1]]) == 6", "assert candidate(mat=[[1, 0, 0], [1, 0, 0]]) == -1", "assert candidate(mat=[[1, 1, 1], [0, 0, 0], [1, 1, 1]]) == 2", "assert candidate(mat=[[1, 1, 0, 0], [0, 0, 1, 1], [1, 1, 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:\nGiven an array intervals where intervals[i] = [li, ri] represent the inter...
You are an expert Python programmer. 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 intervals where intervals[i] = [li, ri] represent the interval [li, ri), remove all intervals that are c...
[ "assert candidate(intervals=[[1, 3], [2, 4], [3, 5], [4, 6], [5, 7]]) == 5", "assert candidate(intervals=[[1, 1000], [50, 550], [100, 900], [200, 800], [300, 700], [400, 600], [500, 550], [600, 650], [700, 750]]) == 1", "assert candidate(intervals=[[5, 10], [1, 3], [4, 5], [8, 11], [10, 15]]) == 5", "assert c...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(intervals=[[1, 3], [2, 4], [3, 5], [4, 6], [5, 7]]) == 5", "assert candidate(intervals=[[1, 1000], [50, 550], [100, 900], [200, 800], [300, 700], [400, 600], [500, 550], [600, 650], [700, 750]]) == 1", "assert candidate(intervals=[[5, 10], [1, 3], [4, 5], [8, 11], [10,...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven an n x n integer matrix grid, return the minimum sum of a falling pa...
You are an expert Python programmer. 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 integer matrix grid, return the minimum sum of a falling path with non-zero shifts. A falling path with ...
[ "assert candidate(grid=[[1, 2], [3, 4]]) == 5", "assert candidate(grid=[[7]]) == 7", "assert candidate(grid=[[100, -100, 50, -50], [-50, 50, -100, 100], [10, -10, 20, -20], [-20, 20, -10, 10]]) == -240", "assert candidate(grid=[[10, 50, 20, 30], [40, 10, 60, 70], [80, 90, 10, 40], [50, 20, 30, 60]]) == 50", ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(grid=[[1, 2], [3, 4]]) == 5", "assert candidate(grid=[[7]]) == 7", "assert candidate(grid=[[100, -100, 50, -50], [-50, 50, -100, 100], [10, -10, 20, -20], [-20, 20, -10, 10]]) == -240", "assert candidate(grid=[[10, 50, 20, 30], [40, 10, 60, 70], [80, 90, 10, 40], [...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nAn integer has sequential digits if and only if each digit in the number 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: An integer has sequential digits if and only if each digit in the number is one more than the previous digit. Return a ...
[ "assert candidate(low=123456, high=789012) == [123456, 234567, 345678, 456789]", "assert candidate(low=56789, high=98765) == [56789]", "assert candidate(low=111, high=123456789) == [123, 234, 345, 456, 567, 678, 789, 1234, 2345, 3456, 4567, 5678, 6789, 12345, 23456, 34567, 45678, 56789, 123456, 234567, 345678, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(low=123456, high=789012) == [123456, 234567, 345678, 456789]", "assert candidate(low=56789, high=98765) == [56789]", "assert candidate(low=111, high=123456789) == [123, 234, 345, 456, 567, 678, 789, 1234, 2345, 3456, 4567, 5678, 6789, 12345, 23456, 34567, 45678, 56789,...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an m x n integer matrix grid where each cell is either 0 (em...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given an m x n integer matrix grid where each cell is either 0 (empty) or 1 (obstacle). You can move up, down, ...
[ "assert candidate(grid=[[0, 1, 1, 1, 1, 1, 0, 0, 0, 0], [1, 0, 0, 0, 1, 0, 1, 1, 1, 1], [1, 1, 1, 0, 0, 0, 0, 0, 1, 1], [1, 0, 0, 1, 0, 1, 1, 1, 0, 1], [0, 0, 0, 0, 0, 0, 1, 0, 0, 0], [1, 1, 1, 1, 1, 0, 0, 1, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 0]], k=5) == 15", "assert candidate(grid=[[0, 1, 0, 0, 0, 0, 0], [0, 1...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(grid=[[0, 1, 1, 1, 1, 1, 0, 0, 0, 0], [1, 0, 0, 0, 1, 0, 1, 1, 1, 1], [1, 1, 1, 0, 0, 0, 0, 0, 1, 1], [1, 0, 0, 1, 0, 1, 1, 1, 0, 1], [0, 0, 0, 0, 0, 0, 1, 0, 0, 0], [1, 1, 1, 1, 1, 0, 0, 1, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 0]], k=5) == 15", "assert candidate(grid=[[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 string s, return the maximum number of occurrences of any substrin...
You are an expert Python programmer. 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 maximum number of occurrences of any substring under the following rules: The number of u...
[ "assert candidate(s='abacabadabacabadabacaba', maxLetters=3, minSize=3, maxSize=7) == 6", "assert candidate(s='xyxzyxzyxzyxzyxzyxzyxz', maxLetters=3, minSize=3, maxSize=4) == 7", "assert candidate(s='xyzxyzxyz', maxLetters=3, minSize=3, maxSize=6) == 3", "assert candidate(s='aabbccddeeffgghhiijjkkllmmnnooppqq...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='abacabadabacabadabacaba', maxLetters=3, minSize=3, maxSize=7) == 6", "assert candidate(s='xyxzyxzyxzyxzyxzyxzyxz', maxLetters=3, minSize=3, maxSize=4) == 7", "assert candidate(s='xyzxyzxyz', maxLetters=3, minSize=3, maxSize=6) == 3", "assert candidate(s='aabbccd...
[ { "role": "user", "content": "You are an expert Python programmer. You will be 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 boxes labeled from 0 to n - 1. You are given four arrays: statu...
You are an expert Python programmer. You 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 boxes labeled from 0 to n - 1. You are given four arrays: status, candies, keys, and containedBoxes where: ...
[ "assert candidate(status=[0, 0, 0, 0, 0, 0, 0], candies=[10, 20, 30, 40, 50, 60, 70], keys=[[1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6], []], containedBoxes=[[1, 2, 3, 4, 5, 6], [], [], [], [], [], []], initialBoxes=[0]) == 0", "assert candidate(status=[1, 1, 1, 1, 1, 1, 1, 1], candies=[100, 200, 300, 400, 500, 6...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(status=[0, 0, 0, 0, 0, 0, 0], candies=[10, 20, 30, 40, 50, 60, 70], keys=[[1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6], []], containedBoxes=[[1, 2, 3, 4, 5, 6], [], [], [], [], [], []], initialBoxes=[0]) == 0", "assert candidate(status=[1, 1, 1, 1, 1, 1, 1, 1], candies=[100...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven an integer array arr and a target value target, return the integer v...
You are an expert Python programmer. 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 a target value target, return the integer value such that when we change all the integer...
[ "assert candidate(arr=[10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000], target=95000) == 9500", "assert candidate(arr=[1, 10, 100, 1000, 10000], target=12345) == 10000", "assert candidate(arr=[5, 15, 25, 35, 45, 55], target=150) == 35", "assert candidate(arr=[1, 100000, 2, 99999, 3, 9999...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(arr=[10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000], target=95000) == 9500", "assert candidate(arr=[1, 10, 100, 1000, 10000], target=12345) == 10000", "assert candidate(arr=[5, 15, 25, 35, 45, 55], target=150) == 35", "assert candidate(arr=[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 two binary search trees root1 and root2, return a list containing al...
You are an expert Python programmer. 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 binary search trees root1 and root2, return a list containing all the integers from both trees sorted in asce...
[ "assert candidate(root1=tree_node([10000, 5000, 15000, 2500, 7500, 12500, 17500, 1250, 3750, 6250, 8750, 11250, 14375, 16250, 18750]), root2=tree_node([10000, 5000, 15000, 2500, 7500, 12500, 17500, 1250, 3750, 6250, 8750, 11250, 14375, 16250, 18750])) == [1250, 1250, 2500, 2500, 3750, 3750, 5000, 5000, 6250, 6250, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(root1=tree_node([10000, 5000, 15000, 2500, 7500, 12500, 17500, 1250, 3750, 6250, 8750, 11250, 14375, 16250, 18750]), root2=tree_node([10000, 5000, 15000, 2500, 7500, 12500, 17500, 1250, 3750, 6250, 8750, 11250, 14375, 16250, 18750])) == [1250, 1250, 2500, 2500, 3750, 3750, 500...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven an array of non-negative integers arr, you are initially positioned ...
You are an expert Python programmer. 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 non-negative integers arr, you are initially positioned at start index of the array. When you are at ...
[ "assert candidate(arr=[1, 2, 3, 4, 0], start=0) == False", "assert candidate(arr=[0, 1], start=1) == True", "assert candidate(arr=[5, 1, 4, 1, 2, 3, 0, 1], start=2) == True", "assert candidate(arr=[4, 0, 5, 0, 3, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5], start=1) == True", "assert candidate(arr=[0, 1, 2, 3, 4, 5], sta...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(arr=[1, 2, 3, 4, 0], start=0) == False", "assert candidate(arr=[0, 1], start=1) == True", "assert candidate(arr=[5, 1, 4, 1, 2, 3, 0, 1], start=2) == True", "assert candidate(arr=[4, 0, 5, 0, 3, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5], start=1) == True", "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 an equation, represented by words on the left side and the result 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: Given an equation, represented by words on the left side and the result on the right side. You need to check if the equ...
[ "assert candidate(words=['ABCDE', 'FGHIJ'], result='KLMNO') == False", "assert candidate(words=['SNOW', 'FALL'], result='SNOWBALL') == False", "assert candidate(words=['HELLO', 'WORLD'], result='PEACE') == True", "assert candidate(words=['MAGICAL', 'REALM'], result='MYSTERY') == False", "assert candidate(wo...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(words=['ABCDE', 'FGHIJ'], result='KLMNO') == False", "assert candidate(words=['SNOW', 'FALL'], result='SNOWBALL') == False", "assert candidate(words=['HELLO', 'WORLD'], result='PEACE') == True", "assert candidate(words=['MAGICAL', 'REALM'], result='MYSTERY') == Fal...
[ { "role": "user", "content": "You are an expert Python programmer. You will be 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 arr of positive integers. You are also given the ar...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given an array arr of positive integers. You are also given the array queries where queries[i] = [lefti, righti...
[ "assert candidate(arr=[3, 6, 8, 12, 15, 9, 7, 11], queries=[[0, 7], [2, 5], [1, 6], [4, 6], [0, 3], [3, 7]]) == [11, 2, 3, 1, 1, 6]", "assert candidate(arr=[8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 2097152, 4194304], queries=[[0, 19], [1, 18], [2,...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(arr=[3, 6, 8, 12, 15, 9, 7, 11], queries=[[0, 7], [2, 5], [1, 6], [4, 6], [0, 3], [3, 7]]) == [11, 2, 3, 1, 1, 6]", "assert candidate(arr=[8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 2097152, 4194304], queries...
[ { "role": "user", "content": "You are an expert Python programmer. You will 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, each person has a unique id between 0 and n-1. Given 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: There are n people, each person has a unique id between 0 and n-1. Given the arrays watchedVideos and friends, where wa...
[ "assert candidate(watchedVideos=[['SciFi', 'Adventure'], ['Adventure', 'Fantasy'], ['Fantasy', 'Mystery'], ['Mystery', 'Horror'], ['Horror', 'SciFi']], friends=[[1, 4], [0, 2], [1, 3], [2, 4], [0, 3]], id=2, level=2) == ['Adventure', 'Horror', 'SciFi']", "assert candidate(watchedVideos=[['Adventure', 'Comedy'], [...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(watchedVideos=[['SciFi', 'Adventure'], ['Adventure', 'Fantasy'], ['Fantasy', 'Mystery'], ['Mystery', 'Horror'], ['Horror', 'SciFi']], friends=[[1, 4], [0, 2], [1, 3], [2, 4], [0, 3]], id=2, level=2) == ['Adventure', 'Horror', 'SciFi']", "assert candidate(watchedVideos=[['A...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven a m x n matrix mat and an integer k, return a matrix answer where ea...
You are an expert Python programmer. 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 m x n matrix mat and an integer k, return a matrix answer where each answer[i][j] is the sum of all elements ma...
[ "assert candidate(mat=[[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]], k=2) == [[63, 90, 120, 102, 81], [114, 160, 210, 176, 138], [180, 250, 325, 270, 210], [174, 240, 310, 256, 198], [153, 210, 270, 222, 171]]", "assert candidate(mat=[[1, 2, 3], [4, 5, 6], [...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(mat=[[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]], k=2) == [[63, 90, 120, 102, 81], [114, 160, 210, 176, 138], [180, 250, 325, 270, 210], [174, 240, 310, 256, 198], [153, 210, 270, 222, 171]]", "assert candidate(mat=[...
[ { "role": "user", "content": "You are an expert Python programmer. You will 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 sum of values of nodes with an...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given the root of a binary tree, return the sum of values of nodes with an even-valued grandparent. If there are no nod...
[ "assert candidate(root=tree_node([22, 6, 18, 2, 14, 16, 20, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41])) == 493", "assert candidate(root=tree_node([20, 10, 30, 5, 15, 25, 35, 3, 7, 13, 17, 23, 27, 33, 37, 1, 4, 6, 8, 12, 14, 16, 18, 22, 24, 26, 28, 32, 34, 36, 38, 39])) == 240"...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(root=tree_node([22, 6, 18, 2, 14, 16, 20, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41])) == 493", "assert candidate(root=tree_node([20, 10, 30, 5, 15, 25, 35, 3, 7, 13, 17, 23, 27, 33, 37, 1, 4, 6, 8, 12, 14, 16, 18, 22, 24, 26, 28, 32, 34...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nReturn the number of distinct non-empty substrings of text that can be wri...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Return the number of distinct non-empty substrings of text that can be written as the concatenation of some string with...
[ "assert candidate(text='bananabananaananabanana') == 7", "assert candidate(text='abacabaabacaba') == 3", "assert candidate(text='xyzxyzxyzxyz') == 4", "assert candidate(text='zzzzzzzzzzzzzzzzzzzz') == 10", "assert candidate(text='abcabcabcabcabc') == 6", "assert candidate(text='leetcodeleetcodeleetcodelee...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(text='bananabananaananabanana') == 7", "assert candidate(text='abacabaabacaba') == 3", "assert candidate(text='xyzxyzxyzxyz') == 4", "assert candidate(text='zzzzzzzzzzzzzzzzzzzz') == 10", "assert candidate(text='abcabcabcabcabc') == 6", "assert candidate(te...
[ { "role": "user", "content": "You are an expert Python programmer. You will 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 3 positives numbers a, b and c. Return the minimum flips required in...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given 3 positives numbers a, b and c. Return the minimum flips required in some bits of a and b to make ( a OR b == c )...
[ "assert candidate(a=32, b=16, c=48) == 0", "assert candidate(a=8, b=3, c=11) == 0", "assert candidate(a=2, b=6, c=5) == 3", "assert candidate(a=123456789, b=987654321, c=135792468) == 25", "assert candidate(a=123456789, b=987654321, c=999999999) == 10", "assert candidate(a=1048576, b=2097152, c=3145727) =...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(a=32, b=16, c=48) == 0", "assert candidate(a=8, b=3, c=11) == 0", "assert candidate(a=2, b=6, c=5) == 3", "assert candidate(a=123456789, b=987654321, c=135792468) == 25", "assert candidate(a=123456789, b=987654321, c=999999999) == 10", "assert candidate(a=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 n computers numbered from 0 to n - 1 connected by ethernet cable...
You are an expert Python programmer. 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 computers numbered from 0 to n - 1 connected by ethernet cables connections forming a network where connect...
[ "assert candidate(n=14, connections=[[0, 1], [1, 2], [2, 3], [3, 0], [4, 5], [5, 6], [6, 4], [7, 8], [8, 9], [9, 10], [10, 11], [11, 12], [12, 7], [13, 13]]) == 3", "assert candidate(n=7, connections=[[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]) == 0", "assert candidate(n=11, connections=[[0, 1], [0, 2], [0...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=14, connections=[[0, 1], [1, 2], [2, 3], [3, 0], [4, 5], [5, 6], [6, 4], [7, 8], [8, 9], [9, 10], [10, 11], [11, 12], [12, 7], [13, 13]]) == 3", "assert candidate(n=7, connections=[[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]) == 0", "assert candidate(n=11, connec...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\n\nYou have a keyboard layout as shown above in the X-Y plane, where each E...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You have a keyboard layout as shown above in the X-Y plane, where each English uppercase letter is located at some coo...
[ "assert candidate(word='HELLOWORLDHELLOWORLD') == 29", "assert candidate(word='MISSISSIPPI') == 5", "assert candidate(word='SYNTAXERRORHANDLING') == 36", "assert candidate(word='HAPPINESS') == 12", "assert candidate(word='ACCELERATION') == 18", "assert candidate(word='INDUSTRY') == 13", "assert candidat...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(word='HELLOWORLDHELLOWORLD') == 29", "assert candidate(word='MISSISSIPPI') == 5", "assert candidate(word='SYNTAXERRORHANDLING') == 36", "assert candidate(word='HAPPINESS') == 12", "assert candidate(word='ACCELERATION') == 18", "assert candidate(word='INDUST...
[ { "role": "user", "content": "You are an expert Python programmer. You will 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 all the words vertically in the same order in whi...
You are an expert Python programmer. 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 all the words vertically in the same order in which they appear in s.\r Words are returned as ...
[ "assert candidate(s='DIFFERENT LENGTH WORDS HERE') == ['DLWH', 'IEOE', 'FNRR', 'FGDE', 'ETS', 'RH', 'E', 'N', 'T']", "assert candidate(s='MAKE AMERICA GREAT AGAIN') == ['MAGA', 'AMRG', 'KEEA', 'ERAI', ' ITN', ' C', ' A']", "assert candidate(s='A B C D') == ['ABCD']", "assert candidate(s='EQUAL LENGTH WORDS') ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='DIFFERENT LENGTH WORDS HERE') == ['DLWH', 'IEOE', 'FNRR', 'FGDE', 'ETS', 'RH', 'E', 'N', 'T']", "assert candidate(s='MAKE AMERICA GREAT AGAIN') == ['MAGA', 'AMRG', 'KEEA', 'ERAI', ' ITN', ' C', ' A']", "assert candidate(s='A B C D') == ['ABCD']", "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:\nThere is a one-dimensional garden on the x-axis. The garden starts at the ...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: There is a one-dimensional garden on the x-axis. The garden starts at the point 0 and ends at the point n. (i.e., the l...
[ "assert candidate(n=10, ranges=[2, 3, 1, 1, 0, 2, 1, 0, 1, 2, 1]) == 3", "assert candidate(n=13, ranges=[3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3]) == 3", "assert candidate(n=10, ranges=[2, 3, 1, 4, 0, 1, 2, 0, 3, 1, 2]) == 2", "assert candidate(n=7, ranges=[3, 2, 1, 0, 0, 0, 2, 1]) == -1", "assert candidat...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=10, ranges=[2, 3, 1, 1, 0, 2, 1, 0, 1, 2, 1]) == 3", "assert candidate(n=13, ranges=[3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3]) == 3", "assert candidate(n=10, ranges=[2, 3, 1, 4, 0, 1, 2, 0, 3, 1, 2]) == 2", "assert candidate(n=7, ranges=[3, 2, 1, 0, 0, 0, 2, 1])...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nA matrix diagonal is a diagonal line of cells starting from some cell in e...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: A matrix diagonal is a diagonal line of cells starting from some cell in either the topmost row or leftmost column and ...
[ "assert candidate(mat=[[10, 10, 10, 10, 10], [10, 10, 10, 10, 10], [10, 10, 10, 10, 10], [10, 10, 10, 10, 10], [10, 10, 10, 10, 10]]) == [[10, 10, 10, 10, 10], [10, 10, 10, 10, 10], [10, 10, 10, 10, 10], [10, 10, 10, 10, 10], [10, 10, 10, 10, 10]]", "assert candidate(mat=[[1, 2, 3, 4, 5], [6, 7, 8, 9, 10], [11, 1...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(mat=[[10, 10, 10, 10, 10], [10, 10, 10, 10, 10], [10, 10, 10, 10, 10], [10, 10, 10, 10, 10], [10, 10, 10, 10, 10]]) == [[10, 10, 10, 10, 10], [10, 10, 10, 10, 10], [10, 10, 10, 10, 10], [10, 10, 10, 10, 10], [10, 10, 10, 10, 10]]", "assert candidate(mat=[[1, 2, 3, 4, 5], [...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an integer array nums. The value of this array is defined as...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given an integer array nums. The value of this array is defined as the sum of |nums[i] - nums[i + 1]| for all 0...
[ "assert candidate(nums=[10, 10, 10, 10, 10, 10, 10, 10, 10, 10]) == 0", "assert candidate(nums=[1, 3, 2, 1, 2, 3, 1]) == 9", "assert candidate(nums=[5, 3, 8, 6, 7, 2, 4, 1, 9]) == 33", "assert candidate(nums=[5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5]) == 0", "assert candidate(nums=[1, 3, 5...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[10, 10, 10, 10, 10, 10, 10, 10, 10, 10]) == 0", "assert candidate(nums=[1, 3, 2, 1, 2, 3, 1]) == 9", "assert candidate(nums=[5, 3, 8, 6, 7, 2, 4, 1, 9]) == 33", "assert candidate(nums=[5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5]) == 0", "a...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven the array restaurants where  restaurants[i] = [idi, ratingi, veganFr...
You are an expert Python programmer. 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 array restaurants where  restaurants[i] = [idi, ratingi, veganFriendlyi, pricei, distancei]. You have to filt...
[ "assert candidate(restaurants=[[10, 9, 1, 20, 1], [20, 8, 0, 10, 2], [30, 7, 1, 5, 3], [40, 10, 1, 15, 2], [50, 6, 0, 25, 4], [60, 8, 1, 30, 1]], veganFriendly=1, maxPrice=30, maxDistance=3) == [40, 10, 60, 30]", "assert candidate(restaurants=[[11, 3, 1, 20, 10], [12, 8, 1, 18, 8], [13, 5, 0, 15, 7], [14, 7, 0, 1...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(restaurants=[[10, 9, 1, 20, 1], [20, 8, 0, 10, 2], [30, 7, 1, 5, 3], [40, 10, 1, 15, 2], [50, 6, 0, 25, 4], [60, 8, 1, 30, 1]], veganFriendly=1, maxPrice=30, maxDistance=3) == [40, 10, 60, 30]", "assert candidate(restaurants=[[11, 3, 1, 20, 10], [12, 8, 1, 18, 8], [13, 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 numbered from 0 to n-1. Given the array edges where edg...
You are an expert Python programmer. 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 numbered from 0 to n-1. Given the array edges where edges[i] = [fromi, toi, weighti] represents a bi...
[ "assert candidate(n=8, edges=[[0, 1, 4], [1, 2, 4], [2, 3, 4], [3, 4, 4], [4, 5, 4], [5, 6, 4], [6, 7, 4], [0, 7, 8], [0, 3, 5], [1, 4, 5], [2, 5, 5], [3, 6, 5], [4, 7, 5]], distanceThreshold=12) == 7", "assert candidate(n=9, edges=[[0, 1, 4], [0, 2, 9], [0, 3, 5], [0, 4, 3], [1, 2, 10], [1, 3, 2], [1, 4, 8], [2,...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=8, edges=[[0, 1, 4], [1, 2, 4], [2, 3, 4], [3, 4, 4], [4, 5, 4], [5, 6, 4], [6, 7, 4], [0, 7, 8], [0, 3, 5], [1, 4, 5], [2, 5, 5], [3, 6, 5], [4, 7, 5]], distanceThreshold=12) == 7", "assert candidate(n=9, edges=[[0, 1, 4], [0, 2, 9], [0, 3, 5], [0, 4, 3], [1, 2, 10], [1...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou want to schedule a list of jobs in d days. Jobs are dependent (i.e To ...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You want to schedule a list of jobs in d days. Jobs are dependent (i.e To work on the ith job, you have to finish all t...
[ "assert candidate(jobDifficulty=[7, 8, 4, 3, 2, 9, 10, 11, 1, 2], d=3) == 14", "assert candidate(jobDifficulty=[9, 18, 1, 5, 19, 12, 4, 7, 8, 6], d=5) == 44", "assert candidate(jobDifficulty=[10, 20, 30, 40, 50], d=3) == 80", "assert candidate(jobDifficulty=[6, 5, 4, 3, 2, 1], d=2) == 7", "assert candidate(...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(jobDifficulty=[7, 8, 4, 3, 2, 9, 10, 11, 1, 2], d=3) == 14", "assert candidate(jobDifficulty=[9, 18, 1, 5, 19, 12, 4, 7, 8, 6], d=5) == 44", "assert candidate(jobDifficulty=[10, 20, 30, 40, 50], d=3) == 80", "assert candidate(jobDifficulty=[6, 5, 4, 3, 2, 1], d=2) ...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an integer array arr. You can choose a set of integers and 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: You are given an integer array arr. You can choose a set of integers and remove all the occurrences of these integers i...
[ "assert candidate(arr=[1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3]) == 2", "assert candidate(arr=[7, 7, 7, 7, 7, 7]) == 1", "assert candidate(arr=[1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4,...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(arr=[1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3]) == 2", "assert candidate(arr=[7, 7, 7, 7, 7, 7]) == 1", "assert candidate(arr=[1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 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:\nGiven the root of a binary tree, split the binary tree into two subtrees b...
You are an expert Python programmer. 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, split the binary tree into two subtrees by removing one edge such that the product of ...
[ "assert candidate(root=tree_node([7, 3, 6, 2, 4, None, 10, 1, 5, None, None, 8, 9, 11, 12])) == 1520", "assert candidate(root=tree_node([1, 2, 3, None, 4, None, 5, None, 6, None, 7, None, 8, None, 9, None, 10, None, 11, None, 12, None, 13, None, 14, None, 15, None, 16, None, 17, None, 18, None, 19, None, 20, None...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(root=tree_node([7, 3, 6, 2, 4, None, 10, 1, 5, None, None, 8, 9, 11, 12])) == 1520", "assert candidate(root=tree_node([1, 2, 3, None, 4, None, 5, None, 6, None, 7, None, 8, None, 9, None, 10, None, 11, None, 12, None, 13, None, 14, None, 15, None, 16, None, 17, None, 18, 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:\nGiven an array of integers arr and an integer d. In one step you can jump ...
You are an expert Python programmer. 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 arr and an integer d. In one step you can jump from index i to index: i + x where: i + x < ...
[ "assert candidate(arr=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1], d=1) == 1", "assert candidate(arr=[1, 3, 5, 2, 4, 6, 8, 7, 9], d=3) == 6", "assert candidate(arr=[1, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10], d=3) == 6", "assert candidate(arr=[1, 3, 2, 4, 3, 5, 4, 6, 5, 7, 6, 8, 7, 9, 8, 10, 9, 11, 10, 12], d=3) == 11", "assert...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(arr=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1], d=1) == 1", "assert candidate(arr=[1, 3, 5, 2, 4, 6, 8, 7, 9], d=3) == 6", "assert candidate(arr=[1, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10], d=3) == 6", "assert candidate(arr=[1, 3, 2, 4, 3, 5, 4, 6, 5, 7, 6, 8, 7, 9, 8, 10, 9, 11, 10, ...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven an array of integers arr and two integers k and threshold, return 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 of integers arr and two integers k and threshold, return the number of sub-arrays of size k and average ...
[ "assert candidate(arr=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1], k=5, threshold=1) == 6", "assert candidate(arr=[3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3], k=10, threshold=3) == 11", "assert candidate(arr=[5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 500...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(arr=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1], k=5, threshold=1) == 6", "assert candidate(arr=[3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3], k=10, threshold=3) == 11", "assert candidate(arr=[5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 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 two numbers, hour and minutes, return the smaller angle (in degrees)...
You are an expert Python programmer. 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 numbers, hour and minutes, return the smaller angle (in degrees) formed between the hour and the minute hand....
[ "assert candidate(hour=9, minutes=27) == 121.5", "assert candidate(hour=6, minutes=0) == 180.0", "assert candidate(hour=4, minutes=40) == 100.0", "assert candidate(hour=8, minutes=18) == 141.0", "assert candidate(hour=7, minutes=0) == 150.0", "assert candidate(hour=3, minutes=15) == 7.5", "assert candid...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(hour=9, minutes=27) == 121.5", "assert candidate(hour=6, minutes=0) == 180.0", "assert candidate(hour=4, minutes=40) == 100.0", "assert candidate(hour=8, minutes=18) == 141.0", "assert candidate(hour=7, minutes=0) == 150.0", "assert candidate(hour=3, minute...
[ { "role": "user", "content": "You are an expert Python programmer. You will 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 arr, you are initially positioned at the first ...
You are an expert Python programmer. 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 arr, you are initially positioned at the first index of the array. In one step you can jump ...
[ "assert candidate(arr=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10]) == 10", "assert candidate(arr=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(arr=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10]) == 10", "assert candidate(arr=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 7, 8,...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given two strings of the same length s and t. In one step you 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: You are given two strings of the same length s and t. In one step you can choose any character of t and replace it with...
[ "assert candidate(s='onomatopoeia', t='pneumonoultramicroscopicsilicovolcanoconiosis') == 33", "assert candidate(s='reducibility', t='reducibility') == 0", "assert candidate(s='qwertyuiopasdfghjklzxcvbnm', t='mnbvcxzlkjhgfdsapoiuytrewq') == 0", "assert candidate(s='supercalifragilisticexpialidocious', t='pseu...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='onomatopoeia', t='pneumonoultramicroscopicsilicovolcanoconiosis') == 33", "assert candidate(s='reducibility', t='reducibility') == 0", "assert candidate(s='qwertyuiopasdfghjklzxcvbnm', t='mnbvcxzlkjhgfdsapoiuytrewq') == 0", "assert candidate(s='supercalifragilis...
[ { "role": "user", "content": "You are an expert Python programmer. You will be 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 events where events[i] = [startDayi, endDayi]. E...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given an array of events where events[i] = [startDayi, endDayi]. Every event i starts at startDayi and ends at ...
[ "assert candidate(events=[[1, 5], [2, 6], [3, 7], [4, 8], [5, 9], [6, 10], [7, 11], [8, 12], [9, 13], [10, 14], [11, 15], [12, 16], [13, 17], [14, 18], [15, 19], [16, 20], [17, 21], [18, 22], [19, 23], [20, 24], [21, 25], [22, 26], [23, 27], [24, 28], [25, 29], [26, 30], [27, 31], [28, 32], [29, 33], [30, 34], [31,...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(events=[[1, 5], [2, 6], [3, 7], [4, 8], [5, 9], [6, 10], [7, 11], [8, 12], [9, 13], [10, 14], [11, 15], [12, 16], [13, 17], [14, 18], [15, 19], [16, 20], [17, 21], [18, 22], [19, 23], [20, 24], [21, 25], [22, 26], [23, 27], [24, 28], [25, 29], [26, 30], [27, 31], [28, 32], [29...
[ { "role": "user", "content": "You are an expert Python programmer. You will be 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 target of n integers. From a starting array arr con...
You are an expert Python programmer. You 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 target of n integers. From a starting array arr consisting of n 1's, you may perform the followi...
[ "assert candidate(target=[10, 9, 8, 7, 6, 5, 4, 3, 2, 1]) == False", "assert candidate(target=[2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, 17711]) == False", "assert candidate(target=[2, 2, 2, 2, 2, 2, 2, 2, 2, 2]) == False", "assert candidate(target=[123456789, 987...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(target=[10, 9, 8, 7, 6, 5, 4, 3, 2, 1]) == False", "assert candidate(target=[2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, 17711]) == False", "assert candidate(target=[2, 2, 2, 2, 2, 2, 2, 2, 2, 2]) == False", "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 consisting only of characters a, b and c.\nReturn the num...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given a string s consisting only of characters a, b and c. Return the number of substrings containing at least one occu...
[ "assert candidate(s='abc') == 1", "assert candidate(s='aabbbccc') == 6", "assert candidate(s='abcacbacbacbabc') == 89", "assert candidate(s='aabbaacccbaab') == 45", "assert candidate(s='aaaabbccccabbbccc') == 85", "assert candidate(s='aaabbbcccbbbaaabbbc') == 87", "assert candidate(s='aabacbacbacbac') =...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='abc') == 1", "assert candidate(s='aabbbccc') == 6", "assert candidate(s='abcacbacbacbabc') == 89", "assert candidate(s='aabbaacccbaab') == 45", "assert candidate(s='aaaabbccccabbbccc') == 85", "assert candidate(s='aaabbbcccbbbaaabbbc') == 87", "asser...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven n orders, each order consists of a pickup and a delivery service.\nC...
You are an expert Python programmer. 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 n orders, each order consists of a pickup and a delivery service. Count all valid pickup/delivery possible sequen...
[ "assert candidate(n=55) == 22089728", "assert candidate(n=125) == 129345050", "assert candidate(n=18) == 368349166", "assert candidate(n=100) == 14159051", "assert candidate(n=350) == 436707893", "assert candidate(n=250) == 418733499", "assert candidate(n=175) == 82390790", "assert candidate(n=3) == 9...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=55) == 22089728", "assert candidate(n=125) == 129345050", "assert candidate(n=18) == 368349166", "assert candidate(n=100) == 14159051", "assert candidate(n=350) == 436707893", "assert candidate(n=250) == 418733499", "assert candidate(n=175) == 8239079...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven an integer num, find the closest two integers in absolute difference...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given an integer num, find the closest two integers in absolute difference whose product equals num + 1 or num + 2. Ret...
[ "assert candidate(num=499999) == [625, 800]", "assert candidate(num=499999999) == [20000, 25000]", "assert candidate(num=999) == [25, 40]", "assert candidate(num=345678901) == [10853, 31851]", "assert candidate(num=123456789) == [370, 333667]", "assert candidate(num=100000000) == [7122, 14041]", "assert...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(num=499999) == [625, 800]", "assert candidate(num=499999999) == [20000, 25000]", "assert candidate(num=999) == [25, 40]", "assert candidate(num=345678901) == [10853, 31851]", "assert candidate(num=123456789) == [370, 333667]", "assert candidate(num=10000000...
[ { "role": "user", "content": "You are an expert Python programmer. You will 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 digits digits, return the largest multiple of three that...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given an array of digits digits, return the largest multiple of three that can be formed by concatenating some of the g...
[ "assert candidate(digits=[9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0, 0, 0]) == '9876543210000'", "assert candidate(digits=[0, 0, 0]) == '0'", "assert candidate(digits=[9, 6, 3, 0, 9, 6, 3, 0, 9, 6, 3, 0, 9, 6, 3, 0, 9, 6, 3, 0]) == '99999666663333300000'", "assert candidate(digits=[9, 9, 9, 6, 6, 6, 3, 3, 3, 0, 0, 0]) ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(digits=[9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0, 0, 0]) == '9876543210000'", "assert candidate(digits=[0, 0, 0]) == '0'", "assert candidate(digits=[9, 6, 3, 0, 9, 6, 3, 0, 9, 6, 3, 0, 9, 6, 3, 0, 9, 6, 3, 0]) == '99999666663333300000'", "assert candidate(digits=[9, 9, 9, 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:\nIn a special ranking system, each voter gives a rank from highest to lowes...
You are an expert Python programmer. 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 special ranking system, each voter gives a rank from highest to lowest to all teams participating in the competiti...
[ "assert candidate(votes=['BCA', 'CAB', 'ABC', 'ACB', 'BAC']) == 'ABC'", "assert candidate(votes=['QWERTYUIOPASDFGHJKLZXCVBNM', 'MNBVCXZLKJHGFDSAPOIUYTREWQ', 'QWERTYUIOPASDFGHJKLZXCVBNM', 'MNBVCXZLKJHGFDSAPOIUYTREWQ', 'QWERTYUIOPASDFGHJKLZXCVBNM', 'MNBVCXZLKJHGFDSAPOIUYTREWQ', 'QWERTYUIOPASDFGHJKLZXCVBNM', 'MNBVCX...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(votes=['BCA', 'CAB', 'ABC', 'ACB', 'BAC']) == 'ABC'", "assert candidate(votes=['QWERTYUIOPASDFGHJKLZXCVBNM', 'MNBVCXZLKJHGFDSAPOIUYTREWQ', 'QWERTYUIOPASDFGHJKLZXCVBNM', 'MNBVCXZLKJHGFDSAPOIUYTREWQ', 'QWERTYUIOPASDFGHJKLZXCVBNM', 'MNBVCXZLKJHGFDSAPOIUYTREWQ', 'QWERTYUIOPASD...
[ { "role": "user", "content": "You are an expert Python programmer. You will 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 tree root and a linked list with head as the first node. \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 binary tree root and a linked list with head as the first node.  Return True if all the elements in the linked ...
[ "assert candidate(head=list_node([3, 6, 9, 12]), root=tree_node([3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45])) == False", "assert candidate(head=list_node([1, 4, 2, 6, 8]), root=tree_node([1, 4, 4, None, 2, 2, None, 1, None, 6, 8, None, None, None, None, 1, 3])) == False", "assert candidate(head=li...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(head=list_node([3, 6, 9, 12]), root=tree_node([3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45])) == False", "assert candidate(head=list_node([1, 4, 2, 6, 8]), root=tree_node([1, 4, 4, None, 2, 2, None, 1, None, 6, 8, None, None, None, None, 1, 3])) == False", ...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven an m x n grid. Each cell of the grid has a sign pointing to the next...
You are an expert Python programmer. 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 grid. Each cell of the grid has a sign pointing to the next cell you should visit if you are currently i...
[ "assert candidate(grid=[[4, 4, 4], [4, 4, 4], [4, 4, 4]]) == 4", "assert candidate(grid=[[1, 2, 3, 4], [2, 3, 4, 1], [3, 4, 1, 2], [4, 1, 2, 3]]) == 3", "assert candidate(grid=[[1, 2, 3, 4, 1, 2, 3], [2, 3, 4, 1, 2, 3, 4], [3, 4, 1, 2, 3, 4, 1], [4, 1, 2, 3, 4, 1, 2], [1, 2, 3, 4, 1, 2, 3], [2, 3, 4, 1, 2, 3, 4...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(grid=[[4, 4, 4], [4, 4, 4], [4, 4, 4]]) == 4", "assert candidate(grid=[[1, 2, 3, 4], [2, 3, 4, 1], [3, 4, 1, 2], [4, 1, 2, 3]]) == 3", "assert candidate(grid=[[1, 2, 3, 4, 1, 2, 3], [2, 3, 4, 1, 2, 3, 4], [3, 4, 1, 2, 3, 4, 1], [4, 1, 2, 3, 4, 1, 2], [1, 2, 3, 4, 1, 2,...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven the string s, return the size of the longest substring containing ea...
You are an expert Python programmer. 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 string s, return the size of the longest substring containing each vowel an even number of times. That is, 'a...
[ "assert candidate(s='aeiouabcdefghijklmnopqrstuvwxyzaeiou') == 31", "assert candidate(s='') == 0", "assert candidate(s='xyz') == 3", "assert candidate(s='uuuuuuuuuuuuuuuuuuuuuuuuuuu') == 26", "assert candidate(s='abecidofug') == 1", "assert candidate(s='aeiouaeiouaeiouaeiouaeiouaeiouabcdeffedcbaaeiouaeiou...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='aeiouabcdefghijklmnopqrstuvwxyzaeiou') == 31", "assert candidate(s='') == 0", "assert candidate(s='xyz') == 3", "assert candidate(s='uuuuuuuuuuuuuuuuuuuuuuuuuuu') == 26", "assert candidate(s='abecidofug') == 1", "assert candidate(s='aeiouaeiouaeiouaeioua...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given the root of a binary tree.\nA ZigZag path for a binary 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: You are given the root of a binary tree. A ZigZag path for a binary tree is defined as follow: Choose any node in the ...
[ "assert candidate(root=tree_node([1, None, 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])) == 1", "assert candidate(root=tree_node([1, 2, None, 3, None, None, 4, None, 5, None, None, 6, None, None, 7, None, None, 8, None, 9])) == 2", ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(root=tree_node([1, None, 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])) == 1", "assert candidate(root=tree_node([1, 2, None, 3, None, None, 4, None, 5, None, None, 6, None, None, 7, None, None...
[ { "role": "user", "content": "You are an expert Python programmer. You will 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 tree root, return the maximum sum of all keys of any sub-tr...
You are an expert Python programmer. 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 tree root, return the maximum sum of all keys of any sub-tree which is also a Binary Search Tree (BST). ...
[ "assert candidate(root=tree_node([3, 2, 5, None, None, 4, 6])) == 20", "assert candidate(root=tree_node([1, None, 10, None, None, 5, None, None, 15])) == 11", "assert candidate(root=tree_node([15, 10, 20, 5, 13, 18, 25, 2, 7, 11, 14, 16, 19, 23, 27, 1, 3, 6, 8, 9, 12, 17, 21, 22, 24, 26, 28, 29, 30])) == 32", ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(root=tree_node([3, 2, 5, None, None, 4, 6])) == 20", "assert candidate(root=tree_node([1, None, 10, None, None, 5, None, None, 15])) == 11", "assert candidate(root=tree_node([15, 10, 20, 5, 13, 18, 25, 2, 7, 11, 14, 16, 19, 23, 27, 1, 3, 6, 8, 9, 12, 17, 21, 22, 24, 26...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nA company has n employees with a unique ID for each employee from 0 to n -...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: A company has n employees with a unique ID for each employee from 0 to n - 1. The head of the company is the one with h...
[ "assert candidate(n=50, headID=0, manager=[-1, 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24], informTime=[0, 1, 1, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10,...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=50, headID=0, manager=[-1, 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24], informTime=[0, 1, 1, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven an undirected tree consisting of n vertices numbered from 1 to n. 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 undirected tree consisting of n vertices numbered from 1 to n. A frog starts jumping from vertex 1. In one sec...
[ "assert candidate(n=20, edges=[[1, 2], [1, 3], [1, 4], [2, 5], [2, 6], [3, 7], [3, 8], [4, 9], [4, 10], [5, 11], [5, 12], [6, 13], [6, 14], [7, 15], [7, 16], [8, 17], [8, 18], [9, 19], [9, 20]], t=6, target=15) == 0.08333333333333333", "assert candidate(n=5, edges=[[1, 2], [1, 3], [1, 4], [1, 5]], t=1, target=3) ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=20, edges=[[1, 2], [1, 3], [1, 4], [2, 5], [2, 6], [3, 7], [3, 8], [4, 9], [4, 10], [5, 11], [5, 12], [6, 13], [6, 14], [7, 15], [7, 16], [8, 17], [8, 18], [9, 19], [9, 20]], t=6, target=15) == 0.08333333333333333", "assert candidate(n=5, edges=[[1, 2], [1, 3], [1, 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:\nGiven the root of a binary search tree, return a balanced binary search tr...
You are an expert Python programmer. 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, return a balanced binary search tree with the same node values. If there is mor...
[ "assert is_same_tree(candidate(root=tree_node([7, 3, 11, 2, 5, 9, 13, 1, 4, 6, 8, 10, 12, 14, 15])), tree_node([7, 3, 11, 2, 5, 9, 13, 1, 4, 6, 8, 10, 12, 14, 15]))", "assert is_same_tree(candidate(root=tree_node([10, 5, None, 2, 7, None, None, 1, 3, None, None, 6, 8])), tree_node([7, 5, 3, 2, 1, 6, 8, None, None...
newfacade/LeetCodeDataset
{ "constraints": [ "assert is_same_tree(candidate(root=tree_node([7, 3, 11, 2, 5, 9, 13, 1, 4, 6, 8, 10, 12, 14, 15])), tree_node([7, 3, 11, 2, 5, 9, 13, 1, 4, 6, 8, 10, 12, 14, 15]))", "assert is_same_tree(candidate(root=tree_node([10, 5, None, 2, 7, None, None, 1, 3, None, None, 6, 8])), tree_node([7, 5, 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 integers n and k and two integer arrays speed and effici...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given two integers n and k and two integer arrays speed and efficiency both of length n. There are n engineers ...
[ "assert candidate(n=20, speed=[5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100], efficiency=[100, 95, 90, 85, 80, 75, 70, 65, 60, 55, 50, 45, 40, 35, 30, 25, 20, 15, 10, 5], k=10) == 17000", "assert candidate(n=25, speed=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=20, speed=[5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100], efficiency=[100, 95, 90, 85, 80, 75, 70, 65, 60, 55, 50, 45, 40, 35, 30, 25, 20, 15, 10, 5], k=10) == 17000", "assert candidate(n=25, speed=[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:\nThe power of an integer x is defined as the number of steps needed to tran...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: The power of an integer x is defined as the number of steps needed to transform x into 1 using the following steps: if...
[ "assert candidate(lo=200, hi=300, k=1) == 256", "assert candidate(lo=300, hi=700, k=250) == 699", "assert candidate(lo=300, hi=400, k=5) == 384", "assert candidate(lo=10, hi=20, k=5) == 13", "assert candidate(lo=5, hi=5, k=1) == 5", "assert candidate(lo=950, hi=1000, k=25) == 984", "assert candidate(lo=...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(lo=200, hi=300, k=1) == 256", "assert candidate(lo=300, hi=700, k=250) == 699", "assert candidate(lo=300, hi=400, k=5) == 384", "assert candidate(lo=10, hi=20, k=5) == 13", "assert candidate(lo=5, hi=5, k=1) == 5", "assert candidate(lo=950, hi=1000, k=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:\nThere is a pizza with 3n slices of varying size, you and your friends will...
You are an expert Python programmer. 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 pizza with 3n slices of varying size, you and your friends will take slices of pizza as follows: You will p...
[ "assert candidate(slices=[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]) == 10", "assert candidate(slices=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) == 4", "assert candidate(slices=[1200, 1100, 1000, 900, 800, 700, 600, 500, 400, 300, 200, 100]) == 3600", "assert c...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(slices=[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]) == 10", "assert candidate(slices=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) == 4", "assert candidate(slices=[1200, 1100, 1000, 900, 800, 700, 600, 500, 400, 300, 200, 10...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven an integer array nums, return the sum of divisors of the integers in...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given an integer array nums, return the sum of divisors of the integers in that array that have exactly four divisors. ...
[ "assert candidate(nums=[5005, 5007, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087]) == 6680", "assert candidate(nums=[143, 221, 247, 299, 323]) == 1396", "assert candidate(nums=[100, 121, 143, 169, 180]) == 168", "assert candidate(nums=[100, 121, 143, 169, 189]) == 168", "assert candidate(nums=[435, ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[5005, 5007, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087]) == 6680", "assert candidate(nums=[143, 221, 247, 299, 323]) == 1396", "assert candidate(nums=[100, 121, 143, 169, 180]) == 168", "assert candidate(nums=[100, 121, 143, 169, 189]) == 168", ...
[ { "role": "user", "content": "You are an expert Python programmer. You will be 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 grid. Each cell of grid represents a street. The st...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given an m x n grid. Each cell of grid represents a street. The street of grid[i][j] can be: 1 which means a s...
[ "assert candidate(grid=[[1, 2, 1], [1, 2, 1]]) == False", "assert candidate(grid=[[2, 5, 3, 4, 3, 2, 1], [1, 6, 5, 4, 3, 2, 4], [4, 3, 2, 1, 6, 5, 3], [3, 2, 1, 6, 5, 4, 2], [6, 5, 4, 2, 1, 4, 3], [5, 4, 2, 1, 6, 5, 1], [2, 1, 6, 5, 4, 2, 6]]) == False", "assert candidate(grid=[[5, 5, 1, 6, 3, 1, 4, 2, 5, 4], [...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(grid=[[1, 2, 1], [1, 2, 1]]) == False", "assert candidate(grid=[[2, 5, 3, 4, 3, 2, 1], [1, 6, 5, 4, 3, 2, 4], [4, 3, 2, 1, 6, 5, 3], [3, 2, 1, 6, 5, 4, 2], [6, 5, 4, 2, 1, 4, 3], [5, 4, 2, 1, 6, 5, 1], [2, 1, 6, 5, 4, 2, 6]]) == False", "assert candidate(grid=[[5, 5, 1...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nA string is called a happy prefix if is a non-empty prefix which is also 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: A string is called a happy prefix if is a non-empty prefix which is also a suffix (excluding itself). Given a string s,...
[ "assert candidate(s='abcabcabcabcabcd') == ''", "assert candidate(s='aabaaabaabaaabaab') == 'aabaaabaab'", "assert candidate(s='abacabadabacabadabacabadabacabadabacabadabacabad') == 'abacabadabacabadabacabadabacabadabacabad'", "assert candidate(s='abcabcabcabcabcabcabcabcabcabc') == 'abcabcabcabcabcabcabcabca...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='abcabcabcabcabcd') == ''", "assert candidate(s='aabaaabaabaaabaab') == 'aabaaabaab'", "assert candidate(s='abacabadabacabadabacabadabacabadabacabadabacabad') == 'abacabadabacabadabacabadabacabadabacabad'", "assert candidate(s='abcabcabcabcabcabcabcabcabcabc') ==...
[ { "role": "user", "content": "You are an expert Python programmer. You will 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 soldiers standing in a line. Each soldier is assigned a unique...
You are an expert Python programmer. 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 soldiers standing in a line. Each soldier is assigned a unique rating value. You have to form a team of 3 s...
[ "assert candidate(rating=[3, 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]) == 430", "assert candidate(rating=[1, 10, 2, 9, 3, 8, 4, 7, 5, 6, 11, 20, 12, 19, 13, 18, 14, 17, 15, 16]) == 600", "assert candidate(rating=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100]) == 120", "assert candidate(rating=[2, 1, 3]) == ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(rating=[3, 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]) == 430", "assert candidate(rating=[1, 10, 2, 9, 3, 8, 4, 7, 5, 6, 11, 20, 12, 19, 13, 18, 14, 17, 15, 16]) == 600", "assert candidate(rating=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100]) == 120", "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 strings s1 and s2 of size n and the string evil, return the numb...
You are an expert Python programmer. 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 strings s1 and s2 of size n and the string evil, return the number of good strings. A good string has size n,...
[ "assert candidate(n=2, s1='aa', s2='da', evil='b') == 51", "assert candidate(n=5, s1='apple', s2='appla', evil='appl') == 0", "assert candidate(n=35, s1='applepieapplepieapplepieapplepie', s2='zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz', evil='apple') == 695022504", "assert candidate(n=5, s1='apple', s2='ze...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=2, s1='aa', s2='da', evil='b') == 51", "assert candidate(n=5, s1='apple', s2='appla', evil='appl') == 0", "assert candidate(n=35, s1='applepieapplepieapplepieapplepie', s2='zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz', evil='apple') == 695022504", "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 a string s and an integer k, return true if you can use all the char...
You are an expert Python programmer. 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 you can use all the characters in s to construct non-empty k palindro...
[ "assert candidate(s='a', k=1) == True", "assert candidate(s='yzyzyzyzyzyzyzy', k=2) == True", "assert candidate(s='aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz', k=20) == True", "assert candidate(s='aabbccccddeeeeffff', k=7) == True", "assert candidate(s='aabaaabbbbccccddddd', k=11) == True", "ass...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='a', k=1) == True", "assert candidate(s='yzyzyzyzyzyzyzy', k=2) == True", "assert candidate(s='aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz', k=20) == True", "assert candidate(s='aabbccccddeeeeffff', k=7) == True", "assert candidate(s='aabaaabbbbccccd...
[ { "role": "user", "content": "You are an expert Python programmer. You will be 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 circle represented as (radius, xCenter, yCenter) and an ax...
You are an expert Python programmer. You 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 circle represented as (radius, xCenter, yCenter) and an axis-aligned rectangle represented as (x1, y1, ...
[ "assert candidate(radius=1, xCenter=0, yCenter=0, x1=-2, y1=-2, x2=-1, y2=-1) == False", "assert candidate(radius=10, xCenter=-5, yCenter=-5, x1=5, y1=5, x2=15, y2=15) == False", "assert candidate(radius=150, xCenter=0, yCenter=0, x1=-200, y1=-200, x2=200, y2=200) == True", "assert candidate(radius=50, xCente...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(radius=1, xCenter=0, yCenter=0, x1=-2, y1=-2, x2=-1, y2=-1) == False", "assert candidate(radius=10, xCenter=-5, yCenter=-5, x1=5, y1=5, x2=15, y2=15) == False", "assert candidate(radius=150, xCenter=0, yCenter=0, x1=-200, y1=-200, x2=200, y2=200) == True", "assert ...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven the binary representation of an integer as a string s, return the nu...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given the binary representation of an integer as a string s, return the number of steps to reduce it to 1 under the fol...
[ "assert candidate(s='10101010') == 12", "assert candidate(s='1001001001001001001001001001001001001001001001001') == 82", "assert candidate(s='1110111011101110111011101110111011101110111011101110111011101110') == 80", "assert candidate(s='1111101010101010101010101010101') == 45", "assert candidate(s='1111101...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='10101010') == 12", "assert candidate(s='1001001001001001001001001001001001001001001001001') == 82", "assert candidate(s='1110111011101110111011101110111011101110111011101110111011101110') == 80", "assert candidate(s='1111101010101010101010101010101') == 45", ...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nA string s is called happy if it satisfies the following conditions:\n\ns ...
You are an expert Python programmer. 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 string s is called happy if it satisfies the following conditions: s only contains the letters 'a', 'b', and 'c'. s ...
[ "assert candidate(a=3, b=3, c=9) == 'ccaccbccacbcabc'", "assert candidate(a=33, b=33, c=34) == 'cabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabc'", "assert candidate(a=3, b=3, c=4) == 'cabcabcabc'", "assert candidate(a=34, b=34, c=32) == 'abababcabcabcabcabc...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(a=3, b=3, c=9) == 'ccaccbccacbcabc'", "assert candidate(a=33, b=33, c=34) == 'cabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabc'", "assert candidate(a=3, b=3, c=4) == 'cabcabcabc'", "assert candidate(a=34, b=34, 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:\nAlice and Bob continue their games with piles of stones. There are several...
You are an expert Python programmer. 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 several stones arranged in a row, and each stone has...
[ "assert candidate(stoneValue=[3, 2, 10, 4]) == 'Alice'", "assert candidate(stoneValue=[-1, -2, -3, -4, -5, -6, -7, -8, -9, -10]) == 'Alice'", "assert candidate(stoneValue=[-5, 10, 20, -15, 30, 25, -20, 40, -35, 50, -45, 60, -55]) == 'Alice'", "assert candidate(stoneValue=[5, 3, -6, 7, 2, 8, -1, 4, 10]) == 'Al...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(stoneValue=[3, 2, 10, 4]) == 'Alice'", "assert candidate(stoneValue=[-1, -2, -3, -4, -5, -6, -7, -8, -9, -10]) == 'Alice'", "assert candidate(stoneValue=[-5, 10, 20, -15, 30, 25, -20, 40, -35, 50, -45, 60, -55]) == 'Alice'", "assert candidate(stoneValue=[5, 3, -6, ...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven the array queries of positive integers between 1 and m, you have to ...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given the array queries of positive integers between 1 and m, you have to process all queries[i] (from i=0 to i=queries...
[ "assert candidate(queries=[2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 19, 17, 15, 13, 11, 9, 7, 5, 3, 1], m=20) == [1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19]", "assert candidate(queries=[9, 1, 9, 2, 9, 3, 9, 4, 9, 5], m=10) == [8, 1, 1, 2, 1, 3, 1, 4, 1, 5]", "assert candidate(queries=...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(queries=[2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 19, 17, 15, 13, 11, 9, 7, 5, 3, 1], m=20) == [1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19]", "assert candidate(queries=[9, 1, 9, 2, 9, 3, 9, 4, 9, 5], m=10) == [8, 1, 1, 2, 1, 3, 1, 4, 1, 5]", "...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou have a grid of size n x 3 and you want to paint each cell of the grid ...
You are an expert Python programmer. You 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 grid of size n x 3 and you want to paint each cell of the grid with exactly one of the three colors: Red, Ye...
[ "assert candidate(n=2000) == 897054912", "assert candidate(n=4) == 1122", "assert candidate(n=1500) == 814277332", "assert candidate(n=1) == 12", "assert candidate(n=10) == 10107954", "assert candidate(n=250) == 601916395", "assert candidate(n=2) == 54", "assert candidate(n=750) == 493513580", "asse...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=2000) == 897054912", "assert candidate(n=4) == 1122", "assert candidate(n=1500) == 814277332", "assert candidate(n=1) == 12", "assert candidate(n=10) == 10107954", "assert candidate(n=250) == 601916395", "assert candidate(n=2) == 54", "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 integer k, return the minimum number of Fibonacci numbers whose s...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given an integer k, return the minimum number of Fibonacci numbers whose sum is equal to k. The same Fibonacci number c...
[ "assert candidate(k=5702887) == 1", "assert candidate(k=433494437) == 1", "assert candidate(k=5) == 1", "assert candidate(k=14930352) == 1", "assert candidate(k=196418) == 1", "assert candidate(k=144) == 1", "assert candidate(k=28657) == 1", "assert candidate(k=100) == 3", "assert candidate(k=832040...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(k=5702887) == 1", "assert candidate(k=433494437) == 1", "assert candidate(k=5) == 1", "assert candidate(k=14930352) == 1", "assert candidate(k=196418) == 1", "assert candidate(k=144) == 1", "assert candidate(k=28657) == 1", "assert candidate(k=100) ...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nA program was supposed to print an array of integers. The program forgot t...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: A program was supposed to print an array of integers. The program forgot to print whitespaces and the array is printed ...
[ "assert candidate(s='3030303030303030303', k=30) == 1", "assert candidate(s='123456789012345678901234567890', k=50000) == 23834271", "assert candidate(s='9999999999999999999999999999999999999999', k=1000000000) == 707881333", "assert candidate(s='10101010101010101010', k=101) == 1", "assert candidate(s='987...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='3030303030303030303', k=30) == 1", "assert candidate(s='123456789012345678901234567890', k=50000) == 23834271", "assert candidate(s='9999999999999999999999999999999999999999', k=1000000000) == 707881333", "assert candidate(s='10101010101010101010', k=101) == 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 the array orders, which represents the orders that customers have do...
You are an expert Python programmer. 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 array orders, which represents the orders that customers have done in a restaurant. More specifically orders[...
[ "assert candidate(orders=[['Laura', '2', 'Bean Burrito'], ['Jhon', '2', 'Beef Burrito'], ['Melissa', '2', 'Soda']]) == [['Table', 'Bean Burrito', 'Beef Burrito', 'Soda'], ['2', '1', '1', '1']]", "assert candidate(orders=[['David', '3', 'Ceviche'], ['Corina', '10', 'Beef Burrito'], ['David', '3', 'Fried Chicken'],...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(orders=[['Laura', '2', 'Bean Burrito'], ['Jhon', '2', 'Beef Burrito'], ['Melissa', '2', 'Soda']]) == [['Table', 'Bean Burrito', 'Beef Burrito', 'Soda'], ['2', '1', '1', '1']]", "assert candidate(orders=[['David', '3', 'Ceviche'], ['Corina', '10', 'Beef Burrito'], ['David',...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given the string croakOfFrogs, which represents a combination of t...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given the string croakOfFrogs, which represents a combination of the string "croak" from different frogs, that ...
[ "assert candidate(croakOfFrogs='croakcroakcroakcroakcroakcroak') == 1", "assert candidate(croakOfFrogs='crrrooookkkkaaa') == -1", "assert candidate(croakOfFrogs='ccccrrroooookkkkkaaaa') == -1", "assert candidate(croakOfFrogs='crocrocrocrocroakroakroak') == -1", "assert candidate(croakOfFrogs='crrrcroakroakr...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(croakOfFrogs='croakcroakcroakcroakcroakcroak') == 1", "assert candidate(croakOfFrogs='crrrooookkkkaaa') == -1", "assert candidate(croakOfFrogs='ccccrrroooookkkkkaaaa') == -1", "assert candidate(croakOfFrogs='crocrocrocrocroakroakroak') == -1", "assert candidate...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given three integers n, m and k. Consider the following algorithm ...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given three integers n, m and k. Consider the following algorithm to find the maximum element of an array of po...
[ "assert candidate(n=15, m=30, k=7) == 115201714", "assert candidate(n=40, m=20, k=20) == 494331990", "assert candidate(n=40, m=15, k=15) == 696143324", "assert candidate(n=15, m=15, k=15) == 1", "assert candidate(n=15, m=5, k=4) == 319448936", "assert candidate(n=15, m=3, k=2) == 7174452", "assert candi...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=15, m=30, k=7) == 115201714", "assert candidate(n=40, m=20, k=20) == 494331990", "assert candidate(n=40, m=15, k=15) == 696143324", "assert candidate(n=15, m=15, k=15) == 1", "assert candidate(n=15, m=5, k=4) == 319448936", "assert candidate(n=15, m=3, k=...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nThere are several cards arranged in a row, and each card has an associated...
You are an expert Python programmer. 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 several cards arranged in a row, and each card has an associated number of points. The points are given in th...
[ "assert candidate(cardPoints=[5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5], k=10) == 50", "assert candidate(cardPoints=[10000, 1000...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(cardPoints=[5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5], k=10) == 50", "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:\nGiven a 2D integer array nums, return all elements of nums in diagonal ord...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given a 2D integer array nums, return all elements of nums in diagonal order as shown in the below images.   Constraint...
[ "assert candidate(nums=[[1], [2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12, 13], [14, 15, 16, 17, 18, 19], [20, 21, 22, 23, 24, 25, 26], [27, 28, 29, 30, 31, 32, 33, 34]]) == [1, 2, 5, 3, 9, 6, 4, 14, 10, 7, 20, 15, 11, 8, 27, 21, 16, 12, 28, 22, 17, 13, 29, 23, 18, 30, 24, 19, 31, 25, 32, 26, 33, 34]", "assert candida...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums=[[1], [2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12, 13], [14, 15, 16, 17, 18, 19], [20, 21, 22, 23, 24, 25, 26], [27, 28, 29, 30, 31, 32, 33, 34]]) == [1, 2, 5, 3, 9, 6, 4, 14, 10, 7, 20, 15, 11, 8, 27, 21, 16, 12, 28, 22, 17, 13, 29, 23, 18, 30, 24, 19, 31, 25, 32, 26, 33, 34...
[ { "role": "user", "content": "You are an expert Python programmer. You will 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 tree where each path going from the root to any leaf form a...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given a binary tree where each path going from the root to any leaf form a valid sequence, check if a given string is a...
[ "assert candidate(root=tree_node([5, 4, 8, 11, None, 13, 4, 7, 2, None, None, 5, 1]), arr=[5, 8, 4, 5]) == True", "assert candidate(root=tree_node([5, 1, 2, 3, None, 6, 7, 4, None, None, None, None, 8]), arr=[5, 1, 3, 4]) == True", "assert candidate(root=tree_node([1, 2, 3, None, 4, None, 5, 6, None, 7, 8]), ar...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(root=tree_node([5, 4, 8, 11, None, 13, 4, 7, 2, None, None, 5, 1]), arr=[5, 8, 4, 5]) == True", "assert candidate(root=tree_node([5, 1, 2, 3, None, 6, 7, 4, None, None, None, None, 8]), arr=[5, 1, 3, 4]) == True", "assert candidate(root=tree_node([1, 2, 3, None, 4, Non...
[ { "role": "user", "content": "You are an expert Python programmer. You will 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: s1 and s2 with the same size, check if some permutation...
You are an expert Python programmer. 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: s1 and s2 with the same size, check if some permutation of string s1 can break some permutation of s...
[ "assert candidate(s1='qrstuv', s2='vwxyza') == False", "assert candidate(s1='abacabadabacaba', s2='zxyzyxzyxzyxzyxzyx') == True", "assert candidate(s1='aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz', s2='zzzzyyxwwvvuttsrrqqponnmlkkjjiihhggffeeeeddccbbaa') == False", "assert candidate(s1='abcdefghijk', ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s1='qrstuv', s2='vwxyza') == False", "assert candidate(s1='abacabadabacaba', s2='zxyzyxzyxzyxzyxzyx') == True", "assert candidate(s1='aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz', s2='zzzzyyxwwvvuttsrrqqponnmlkkjjiihhggffeeeeddccbbaa') == False", "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:\nGiven an array of integers nums and an integer limit, return the size of t...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given an array of integers nums and an integer limit, return the size of the longest non-empty subarray such that the a...
[ "assert candidate(nums=[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39], limit=10) == 6", "assert candidate(nums=[5, 2, 3, 4, 1, 5, 2], limit=3) == 4", "assert candidate(nums=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1], limit=0) == 10", "assert candidate(nums=[100, 1, 101, 2, 102, 3, 103, 4, 104...
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], limit=10) == 6", "assert candidate(nums=[5, 2, 3, 4, 1, 5, 2], limit=3) == 4", "assert candidate(nums=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1], limit=0) == 10", "assert candidate(nums=[100, 1, ...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an m x n matrix mat that has its rows sorted in non-decreasi...
You are an expert Python programmer. You 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 matrix mat that has its rows sorted in non-decreasing order and an integer k. You are allowed to...
[ "assert candidate(mat=[[5, 8, 12, 18], [1, 3, 7, 11], [2, 4, 6, 10], [9, 13, 15, 17]], k=100) == 33", "assert candidate(mat=[[1000, 2000, 3000, 4000], [500, 1500, 2500, 3500], [100, 1100, 2100, 3100], [50, 1050, 2050, 3050]], k=10) == 3650", "assert candidate(mat=[[1, 2, 3, 4, 5], [6, 7, 8, 9, 10], [11, 12, 13,...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(mat=[[5, 8, 12, 18], [1, 3, 7, 11], [2, 4, 6, 10], [9, 13, 15, 17]], k=100) == 33", "assert candidate(mat=[[1000, 2000, 3000, 4000], [500, 1500, 2500, 3500], [100, 1100, 2100, 3100], [50, 1050, 2050, 3050]], k=10) == 3650", "assert candidate(mat=[[1, 2, 3, 4, 5], [6, 7...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an integer array target and an integer n.\nYou have an empty...
You are an expert Python programmer. You 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 target and an integer n. You have an empty stack with the two following operations: "Pu...
[ "assert candidate(target=[5, 7, 11, 13], n=15) == ['Push', 'Pop', 'Push', 'Pop', 'Push', 'Pop', 'Push', 'Pop', 'Push', 'Push', 'Pop', 'Push', 'Push', 'Pop', 'Push', 'Pop', 'Push', 'Pop', 'Push', 'Push', 'Pop', 'Push']", "assert candidate(target=[3, 5, 7, 8, 10], n=15) == ['Push', 'Pop', 'Push', 'Pop', 'Push', 'Pu...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(target=[5, 7, 11, 13], n=15) == ['Push', 'Pop', 'Push', 'Pop', 'Push', 'Pop', 'Push', 'Pop', 'Push', 'Push', 'Pop', 'Push', 'Push', 'Pop', 'Push', 'Pop', 'Push', 'Pop', 'Push', 'Push', 'Pop', 'Push']", "assert candidate(target=[3, 5, 7, 8, 10], n=15) == ['Push', 'Pop', 'Pu...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven an array of integers arr.\nWe want to select three indices i, j and ...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given an array of integers arr. We want to select three indices i, j and k where (0 <= i < j <= k < arr.length). Let's ...
[ "assert candidate(arr=[256, 512, 1024, 2048, 4096, 8192, 16384, 32768]) == 0", "assert candidate(arr=[1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10]) == 385", "assert candidate(arr=[23, 45, 67, 89, 12, 34, 56, 78, 90, 11, 22, 33, 44, 55, 66, 77, 88, 99, 10, 20]) == 0", "assert candidate(arr=[10...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(arr=[256, 512, 1024, 2048, 4096, 8192, 16384, 32768]) == 0", "assert candidate(arr=[1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10]) == 385", "assert candidate(arr=[23, 45, 67, 89, 12, 34, 56, 78, 90, 11, 22, 33, 44, 55, 66, 77, 88, 99, 10, 20]) == 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 rectangular pizza represented as a rows x cols matrix containing t...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given a rectangular pizza represented as a rows x cols matrix containing the following characters: 'A' (an apple) and '...
[ "assert candidate(pizza=['AAAAA', 'AAAAA', '.....', '.....', '.....'], k=3) == 14", "assert candidate(pizza=['A...', '....', '....', 'A...'], k=2) == 3", "assert candidate(pizza=['AAAAA', 'AA.AA', 'AA.AA', 'AA.AA', 'AAAAA'], k=5) == 346", "assert candidate(pizza=['A..', 'AA.', '...'], k=3) == 1", "assert ca...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(pizza=['AAAAA', 'AAAAA', '.....', '.....', '.....'], k=3) == 14", "assert candidate(pizza=['A...', '....', '....', 'A...'], k=2) == 3", "assert candidate(pizza=['AAAAA', 'AA.AA', 'AA.AA', 'AA.AA', 'AAAAA'], k=5) == 346", "assert candidate(pizza=['A..', 'AA.', '...'...
[ { "role": "user", "content": "You are an expert Python programmer. You will 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, return a list of all simplified fractions between 0 an...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given an integer n, return a list of all simplified fractions between 0 and 1 (exclusive) such that the denominator is ...
[ "assert candidate(n=5) == ['1/2', '1/3', '1/4', '1/5', '2/3', '2/5', '3/4', '3/5', '4/5']", "assert candidate(n=4) == ['1/2', '1/3', '1/4', '2/3', '3/4']", "assert candidate(n=8) == ['1/2', '1/3', '1/4', '1/5', '1/6', '1/7', '1/8', '2/3', '2/5', '2/7', '3/4', '3/5', '3/7', '3/8', '4/5', '4/7', '5/6', '5/7', '5/...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=5) == ['1/2', '1/3', '1/4', '1/5', '2/3', '2/5', '3/4', '3/5', '4/5']", "assert candidate(n=4) == ['1/2', '1/3', '1/4', '2/3', '3/4']", "assert candidate(n=8) == ['1/2', '1/3', '1/4', '1/5', '1/6', '1/7', '1/8', '2/3', '2/5', '2/7', '3/4', '3/5', '3/7', '3/8', '4/5',...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven a sentence text (A sentence is a string of space-separated words) in...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Given a sentence text (A sentence is a string of space-separated words) in the following format: First letter is in up...
[ "assert candidate(text='Despite the harsh conditions, the resilient hikers forged ahead') == 'The the harsh ahead hikers forged despite resilient conditions,'", "assert candidate(text='The rapid expansion of artificial intelligence is fascinating') == 'Of is the rapid expansion artificial fascinating intelligence...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(text='Despite the harsh conditions, the resilient hikers forged ahead') == 'The the harsh ahead hikers forged despite resilient conditions,'", "assert candidate(text='The rapid expansion of artificial intelligence is fascinating') == 'Of is the rapid expansion artificial 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:\nAlice is throwing n darts on a very large wall. You are given an array dar...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: Alice is throwing n darts on a very large wall. You are given an array darts where darts[i] = [xi, yi] is the position ...
[ "assert candidate(darts=[[1000, 1000], [2000, 2000], [3000, 3000], [4000, 4000], [5000, 5000]], r=1000) == 2", "assert candidate(darts=[[0, 0], [1, 1], [2, 2], [3, 3], [4, 4], [5, 5], [6, 6], [7, 7], [8, 8], [9, 9]], r=2) == 3", "assert candidate(darts=[[-3, 0], [3, 0], [2, 6], [5, 4], [0, 9], [7, 8]], r=5) == ...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(darts=[[1000, 1000], [2000, 2000], [3000, 3000], [4000, 4000], [5000, 5000]], r=1000) == 2", "assert candidate(darts=[[0, 0], [1, 1], [2, 2], [3, 3], [4, 4], [5, 5], [6, 6], [7, 7], [8, 8], [9, 9]], r=2) == 3", "assert candidate(darts=[[-3, 0], [3, 0], [2, 6], [5, 4], ...
[ { "role": "user", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven a string s and an integer k, return the maximum number of vowel lett...
You are an expert Python programmer. 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 maximum number of vowel letters in any substring of s with length k. Vowe...
[ "assert candidate(s='bbbbbbaaaaa', k=5) == 5", "assert candidate(s='ababababab', k=5) == 3", "assert candidate(s='rhythms', k=5) == 0", "assert candidate(s='aaaaaaaaaaaaaaaaaaaaaa', k=10) == 10", "assert candidate(s='abcdefghijklmnopqrstuvwxyz', k=26) == 5", "assert candidate(s='aeeeeeeeeeeeeeeeeeeeeeeeee...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(s='bbbbbbaaaaa', k=5) == 5", "assert candidate(s='ababababab', k=5) == 3", "assert candidate(s='rhythms', k=5) == 0", "assert candidate(s='aaaaaaaaaaaaaaaaaaaaaa', k=10) == 10", "assert candidate(s='abcdefghijklmnopqrstuvwxyz', k=26) == 5", "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 two arrays nums1 and nums2.\nReturn the maximum dot product between ...
You are an expert Python programmer. 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 arrays nums1 and nums2. Return the maximum dot product between non-empty subsequences of nums1 and nums2 with...
[ "assert candidate(nums1=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100], nums2=[10]) == 1000", "assert candidate(nums1=[1, -1, 2, -2, 3, -3], nums2=[3, -3, 2, -2, 1, -1]) == 24", "assert candidate(nums1=[1, 2, 3], nums2=[4, 5, 6, 7, 8, 9, 10, 11, 12, 13]) == 74", "assert candidate(nums1=[100, -100, 200, -200], nums...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(nums1=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100], nums2=[10]) == 1000", "assert candidate(nums1=[1, -1, 2, -2, 3, -3], nums2=[3, -3, 2, -2, 1, -1]) == 24", "assert candidate(nums1=[1, 2, 3], nums2=[4, 5, 6, 7, 8, 9, 10, 11, 12, 13]) == 74", "assert candidate(nums1=[...
[ { "role": "user", "content": "You are an expert Python programmer. You will be 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 rectangular cake of size h x w and two arrays of integers ...
You are an expert Python programmer. You 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 rectangular cake of size h x w and two arrays of integers horizontalCuts and verticalCuts where: horiz...
[ "assert candidate(h=800, w=600, horizontalCuts=[100, 300, 500, 700], verticalCuts=[150, 300, 450, 600]) == 30000", "assert candidate(h=10, w=10, horizontalCuts=[2, 4, 6, 8], verticalCuts=[2, 4, 6, 8]) == 4", "assert candidate(h=100, w=200, horizontalCuts=[10, 90], verticalCuts=[20, 180]) == 12800", "assert ca...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(h=800, w=600, horizontalCuts=[100, 300, 500, 700], verticalCuts=[150, 300, 450, 600]) == 30000", "assert candidate(h=10, w=10, horizontalCuts=[2, 4, 6, 8], verticalCuts=[2, 4, 6, 8]) == 4", "assert candidate(h=100, w=200, horizontalCuts=[10, 90], verticalCuts=[20, 180]...
[ { "role": "user", "content": "You are an expert Python programmer. You will 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 numbered from 0 to n - 1 and n - 1 roads such that ther...
You are an expert Python programmer. 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 numbered from 0 to n - 1 and n - 1 roads such that there is only one way to travel between two diffe...
[ "assert candidate(n=7, connections=[[1, 0], [2, 0], [3, 1], [4, 0], [5, 0], [6, 4]]) == 0", "assert candidate(n=10, connections=[[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9]]) == 9", "assert candidate(n=9, connections=[[0, 1], [0, 2], [0, 3], [1, 4], [2, 5], [2, 6], [3, 7], [4, 8]]) ==...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(n=7, connections=[[1, 0], [2, 0], [3, 1], [4, 0], [5, 0], [6, 4]]) == 0", "assert candidate(n=10, connections=[[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9]]) == 9", "assert candidate(n=9, connections=[[0, 1], [0, 2], [0, 3], [1, 4], [2, 5], [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 2n balls of k distinct colors. You will be given an integer array ba...
You are an expert Python programmer. 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 2n balls of k distinct colors. You will be given an integer array balls of size k where balls[i] is the number of...
[ "assert candidate(balls=[1, 2, 3]) == 0.3", "assert candidate(balls=[3, 3, 1, 1]) == 0.5714285714285714", "assert candidate(balls=[3, 2, 1, 1, 1]) == 0.2571428571428571", "assert candidate(balls=[2, 2, 1, 1, 1, 1]) == 0.5142857142857142", "assert candidate(balls=[2, 2, 2, 2, 2, 2]) == 1.0", "assert candid...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(balls=[1, 2, 3]) == 0.3", "assert candidate(balls=[3, 3, 1, 1]) == 0.5714285714285714", "assert candidate(balls=[3, 2, 1, 1, 1]) == 0.2571428571428571", "assert candidate(balls=[2, 2, 1, 1, 1, 1]) == 0.5142857142857142", "assert candidate(balls=[2, 2, 2, 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:\nThere is a row of m houses in a small city, each house must be painted 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: There is a row of m houses in a small city, each house must be painted with one of the n colors (labeled from 1 to n), ...
[ "assert candidate(houses=[0, 0, 0, 0, 0, 0, 0], cost=[[1, 4, 3], [3, 2, 1], [2, 1, 4], [1, 3, 2], [4, 3, 1], [2, 1, 3], [3, 2, 4]], m=7, n=3, target=4) == 10", "assert candidate(houses=[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], cost=[[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [2, 3, 4, 5, 6, 7, 8, 9, 10, 11], [3, 4, 5, 6, 7, 8, 9, 10...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(houses=[0, 0, 0, 0, 0, 0, 0], cost=[[1, 4, 3], [3, 2, 1], [2, 1, 4], [1, 3, 2], [4, 3, 1], [2, 1, 3], [3, 2, 4]], m=7, n=3, target=4) == 10", "assert candidate(houses=[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], cost=[[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [2, 3, 4, 5, 6, 7, 8, 9, 10, 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 array of integers arr and an integer target.\nYou have to...
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. ### Question: You are given an array of integers arr and an integer target. You have to find two non-overlapping sub-arrays of arr ea...
[ "assert candidate(arr=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200], target=400) == -1", "assert candidate(arr=[25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25], target=50) == 4", "assert candidate(arr=[100, 200, 300, 400, 500, 100, 20...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(arr=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200], target=400) == -1", "assert candidate(arr=[25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25], target=50) == 4", "assert candidate(arr=[100, 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 array houses where houses[i] is the location of the ith house al...
You are an expert Python programmer. 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 array houses where houses[i] is the location of the ith house along a street and an integer k, allocate k mai...
[ "assert candidate(houses=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], k=5) == 20", "assert candidate(houses=[2, 5, 8, 11, 14, 17, 20, 23, 26, 29, 32, 35, 38, 41, 44, 47, 50], k=5) == 42", "assert candidate(houses=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160,...
newfacade/LeetCodeDataset
{ "constraints": [ "assert candidate(houses=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], k=5) == 20", "assert candidate(houses=[2, 5, 8, 11, 14, 17, 20, 23, 26, 29, 32, 35, 38, 41, 44, 47, 50], k=5) == 42", "assert candidate(houses=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110,...