prompt listlengths 1 1 | query stringlengths 578 3.33k | constraints listlengths 10 10 | data_source stringclasses 1
value | extra_info dict |
|---|---|---|---|---|
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an m x n matrix maze (0-indexed) with empty cells (represent... | You are an expert Python programmer. 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 maze (0-indexed) with empty cells (represented as '.') and walls (represented as '+'). Yo... | [
"assert candidate(maze=[['.', '+']], entrance=[0, 0]) == -1",
"assert candidate(maze=[['.', '.', '.'], ['.', '.', '.'], ['.', '.', '.']], entrance=[0, 1]) == 1",
"assert candidate(maze=[['.', '.', '.', '.'], ['.', '.', '.', '.'], ['.', '.', '.', '.'], ['.', '.', '.', '.']], entrance=[0, 0]) == 1",
"assert can... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(maze=[['.', '+']], entrance=[0, 0]) == -1",
"assert candidate(maze=[['.', '.', '.'], ['.', '.', '.'], ['.', '.', '.']], entrance=[0, 1]) == 1",
"assert candidate(maze=[['.', '.', '.', '.'], ['.', '.', '.', '.'], ['.', '.', '.', '.'], ['.', '.', '.', '.']], entrance=[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:\nAlice and Bob take turns playing a game, with Alice starting first.\nYou a... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
Alice and Bob take turns playing a game, with Alice starting first.
You are given a string num of even length consistin... | [
"assert candidate(num='7777777777????????????????') == True",
"assert candidate(num='99999999998765432100') == True",
"assert candidate(num='99999999990000000000') == True",
"assert candidate(num='1010101010??????????????????????') == True",
"assert candidate(num='99?9?9?9') == True",
"assert candidate(nu... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(num='7777777777????????????????') == True",
"assert candidate(num='99999999998765432100') == True",
"assert candidate(num='99999999990000000000') == True",
"assert candidate(num='1010101010??????????????????????') == True",
"assert candidate(num='99?9?9?9') == ... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nThere is a country of n cities numbered from 0 to n - 1 where all the citi... | You are an expert Python programmer. 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 country of n cities numbered from 0 to n - 1 where all the cities are connected by bi-directional roads. The... | [
"assert candidate(maxTime=50, edges=[[0, 1, 10], [1, 2, 20], [2, 3, 15], [3, 4, 10], [4, 5, 10], [0, 3, 25], [1, 4, 20]], passingFees=[10, 20, 30, 40, 50, 60]) == 140",
"assert candidate(maxTime=400, edges=[[0, 1, 30], [1, 2, 30], [2, 3, 30], [3, 4, 30], [0, 2, 50], [1, 3, 50], [2, 4, 50], [0, 3, 70], [1, 4, 70],... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(maxTime=50, edges=[[0, 1, 10], [1, 2, 20], [2, 3, 15], [3, 4, 10], [4, 5, 10], [0, 3, 25], [1, 4, 20]], passingFees=[10, 20, 30, 40, 50, 60]) == 140",
"assert candidate(maxTime=400, edges=[[0, 1, 30], [1, 2, 30], [2, 3, 30], [3, 4, 30], [0, 2, 50], [1, 3, 50], [2, 4, 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 a string s, return the number of unique palindromes of length three ... | You are an expert Python programmer. 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 number of unique palindromes of length three that are a subsequence of s.
Note that even i... | [
"assert candidate(s='abcba') == 3",
"assert candidate(s='abacabadabacaba') == 11",
"assert candidate(s='aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz') == 0",
"assert candidate(s='aabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabba') == 4",
"assert candidate(s='aaabaaaabaaaabaaaabaaaabaaaab... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(s='abcba') == 3",
"assert candidate(s='abacabadabacaba') == 11",
"assert candidate(s='aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz') == 0",
"assert candidate(s='aabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabba') == 4",
"assert candidate(s='... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given two integers m and n. Consider an m x n grid where each cell... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given two integers m and n. Consider an m x n grid where each cell is initially white. You can paint each cell ... | [
"assert candidate(m=5, n=800) == 253729951",
"assert candidate(m=5, n=1) == 48",
"assert candidate(m=4, n=100) == 80216004",
"assert candidate(m=4, n=999) == 772309689",
"assert candidate(m=4, n=9) == 128643282",
"assert candidate(m=5, n=5) == 580986",
"assert candidate(m=3, n=300) == 748221310",
"ass... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(m=5, n=800) == 253729951",
"assert candidate(m=5, n=1) == 48",
"assert candidate(m=4, n=100) == 80216004",
"assert candidate(m=4, n=999) == 772309689",
"assert candidate(m=4, n=9) == 128643282",
"assert candidate(m=5, n=5) == 580986",
"assert candidate(... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an m x n integer matrix points (0-indexed). Starting with 0 ... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given an m x n integer matrix points (0-indexed). Starting with 0 points, you want to maximize the number of po... | [
"assert candidate(points=[[5, 10], [10, 5]]) == 19",
"assert candidate(points=[[1, 10, 2, 9, 3, 8, 4, 7, 5, 6], [10, 1, 9, 2, 8, 3, 7, 4, 6, 5], [5, 6, 4, 7, 3, 8, 2, 9, 1, 10]]) == 24",
"assert candidate(points=[[10, 15, 20, 25], [25, 20, 15, 10], [10, 20, 30, 40], [40, 30, 20, 10]]) == 121",
"assert candida... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(points=[[5, 10], [10, 5]]) == 19",
"assert candidate(points=[[1, 10, 2, 9, 3, 8, 4, 7, 5, 6], [10, 1, 9, 2, 8, 3, 7, 4, 6, 5], [5, 6, 4, 7, 3, 8, 2, 9, 1, 10]]) == 24",
"assert candidate(points=[[10, 15, 20, 25], [25, 20, 15, 10], [10, 20, 30, 40], [40, 30, 20, 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:\nThere is a rooted tree consisting of n nodes numbered 0 to n - 1. Each nod... | You are an expert Python programmer. 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 rooted tree consisting of n nodes numbered 0 to n - 1. Each node's number denotes its unique genetic value (... | [
"assert candidate(parents=[0, 0, 0, 1, 1, 2, 2, 3, 3], queries=[[0, 10], [1, 20], [2, 30], [3, 40], [4, 50], [5, 60], [6, 70], [7, 80], [8, 90]]) == [0, 0, 0, 0, 0, 0, 0, 0, 0]",
"assert candidate(parents=[-1, 0, 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... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(parents=[0, 0, 0, 1, 1, 2, 2, 3, 3], queries=[[0, 10], [1, 20], [2, 30], [3, 40], [4, 50], [5, 60], [6, 70], [7, 80], [8, 90]]) == [0, 0, 0, 0, 0, 0, 0, 0, 0]",
"assert candidate(parents=[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 integer arrays arrays where each arrays[i] is sorted 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 array of integer arrays arrays where each arrays[i] is sorted in strictly increasing order, return an integer ... | [
"assert candidate(arrays=[[2, 3, 6, 8], [1, 2, 3, 5, 6, 7, 10], [2, 3, 4, 6, 9]]) == [2, 3, 6]",
"assert candidate(arrays=[[1, 5, 9, 13, 17, 21, 25, 29], [2, 5, 8, 11, 14, 17, 20, 23, 26], [3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29]]) == [5, 17]",
"assert candidate(arrays=[[1, 4, 7, 10, 13, 16], [1, 3,... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(arrays=[[2, 3, 6, 8], [1, 2, 3, 5, 6, 7, 10], [2, 3, 4, 6, 9]]) == [2, 3, 6]",
"assert candidate(arrays=[[1, 5, 9, 13, 17, 21, 25, 29], [2, 5, 8, 11, 14, 17, 20, 23, 26], [3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29]]) == [5, 17]",
"assert candidate(arrays=[[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 is a long and thin painting that can be represented by a number line... | You are an expert Python programmer. 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 long and thin painting that can be represented by a number line. The painting was painted with multiple over... | [
"assert candidate(segments=[[1, 100000, 1000000000]]) == [[1, 100000, 1000000000]]",
"assert candidate(segments=[[100, 200, 500], [150, 250, 1000], [200, 300, 1500], [175, 225, 1200], [225, 275, 2200], [275, 325, 2500]]) == [[100, 150, 500], [150, 175, 1500], [175, 200, 2700], [200, 225, 3700], [225, 250, 4700], ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(segments=[[1, 100000, 1000000000]]) == [[1, 100000, 1000000000]]",
"assert candidate(segments=[[100, 200, 500], [150, 250, 1000], [200, 300, 1500], [175, 225, 1200], [225, 275, 2200], [275, 325, 2500]]) == [[100, 150, 500], [150, 175, 1500], [175, 200, 2700], [200, 225, 37... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 standing in a queue, and they numbered from 0 to n - 1 ... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
There are n people standing in a queue, and they numbered from 0 to n - 1 in left to right order. You are given an arra... | [
"assert candidate(heights=[10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11]) == [2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0]",
"assert candidate(heights=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == [1, 1, 1, 1, 1, ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(heights=[10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11]) == [2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0]",
"assert candidate(heights=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a string num, which represents a large integer. You are also... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given a string num, which represents a large integer. You are also given a 0-indexed integer array change of le... | [
"assert candidate(num='99999999999999999999', change=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) == '99999999999999999999'",
"assert candidate(num='1234567890', change=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == '2345678990'",
"assert candidate(num='1357924680', change=[9, 9, 9, 9, 9, 9, 9, 9, 9, 9]) == '9999999999'",
"assert ca... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(num='99999999999999999999', change=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) == '99999999999999999999'",
"assert candidate(num='1234567890', change=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == '2345678990'",
"assert candidate(num='1357924680', change=[9, 9, 9, 9, 9, 9, 9, 9, 9, 9]) == '9... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nThere is a survey that consists of n questions where each question's answe... | You are an expert Python programmer. 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 survey that consists of n questions where each question's answer is either 0 (no) or 1 (yes).
The survey was... | [
"assert candidate(students=[[0, 0, 0], [1, 1, 1], [0, 1, 0]], mentors=[[1, 1, 1], [0, 0, 0], [1, 0, 1]]) == 6",
"assert candidate(students=[[1, 1, 1, 1], [0, 0, 0, 0]], mentors=[[1, 1, 1, 1], [0, 0, 0, 0]]) == 8",
"assert candidate(students=[[1, 0, 1, 0, 1, 0, 1], [0, 1, 0, 1, 0, 1, 0], [1, 0, 1, 0, 1, 0, 1], [... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(students=[[0, 0, 0], [1, 1, 1], [0, 1, 0]], mentors=[[1, 1, 1], [0, 0, 0], [1, 0, 1]]) == 6",
"assert candidate(students=[[1, 1, 1, 1], [0, 0, 0, 0]], mentors=[[1, 1, 1, 1], [0, 0, 0, 0]]) == 8",
"assert candidate(students=[[1, 0, 1, 0, 1, 0, 1], [0, 1, 0, 1, 0, 1, 0],... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nDue to a bug, there are many duplicate folders in a file system. You are g... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
Due to a bug, there are many duplicate folders in a file system. You are given a 2D array paths, where paths[i] is an a... | [
"assert candidate(paths=[['folder1', 'subfolder1', 'deepsub1'], ['folder2', 'subfolder2', 'deepsub2'], ['folder1', 'subfolder1', 'deepsub3'], ['folder2', 'subfolder2', 'deepsub3'], ['folder1', 'subfolder2'], ['folder2', 'subfolder2'], ['folder3', 'subfolder3']]) == [['folder1', 'subfolder1', 'deepsub1'], ['folder1'... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(paths=[['folder1', 'subfolder1', 'deepsub1'], ['folder2', 'subfolder2', 'deepsub2'], ['folder1', 'subfolder1', 'deepsub3'], ['folder2', 'subfolder2', 'deepsub3'], ['folder1', 'subfolder2'], ['folder2', 'subfolder2'], ['folder3', 'subfolder3']]) == [['folder1', 'subfolder1', 'd... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an integer array nums of size n. You are asked to solve n qu... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given an integer array nums of size n. You are asked to solve n queries for each integer i in the range 0 <= i ... | [
"assert candidate(nums=[2, 1, 3, 2, 1, 4, 3, 2, 1, 5, 4, 3, 2, 1, 6, 5, 4, 3, 2, 1, 7, 6, 5, 4, 3, 2, 1]) == [7, 6, 5, 4, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]",
"assert candidate(nums=[10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == [10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 1,... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[2, 1, 3, 2, 1, 4, 3, 2, 1, 5, 4, 3, 2, 1, 6, 5, 4, 3, 2, 1, 7, 6, 5, 4, 3, 2, 1]) == [7, 6, 5, 4, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]",
"assert candidate(nums=[10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == [10, 9, 8, ... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nThere are n projects numbered from 0 to n - 1. You are given an integer ar... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
There are n projects numbered from 0 to n - 1. You are given an integer array milestones where each milestones[i] denot... | [
"assert candidate(milestones=[2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]) == 40",
"assert candidate(milestones=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]) == 120",
"assert candidate(milestones=[10000, 20000, 30000, 40000, 50000, 60000, 70000, 80000, 90000, 100000]) == 550000",
"asser... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(milestones=[2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]) == 40",
"assert candidate(milestones=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]) == 120",
"assert candidate(milestones=[10000, 20000, 30000, 40000, 50000, 60000, 70000, 80000, 90000, 1000... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nA sequence is special if it consists of a positive number of 0s, followed ... | You are an expert Python programmer. 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 sequence is special if it consists of a positive number of 0s, followed by a positive number of 1s, then a positive n... | [
"assert candidate(nums=[0, 0, 0, 1, 1, 2, 2, 2, 1, 1, 2, 2, 2, 0, 1, 2]) == 4047",
"assert candidate(nums=[0, 1, 1, 2, 0, 1, 2, 2, 1, 2, 0, 1, 2, 2, 1, 0, 1, 2, 2]) == 2847",
"assert candidate(nums=[2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0]) == 0",
"assert candidate(nums=[0, 0, 1... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[0, 0, 0, 1, 1, 2, 2, 2, 1, 1, 2, 2, 2, 0, 1, 2]) == 4047",
"assert candidate(nums=[0, 1, 1, 2, 0, 1, 2, 2, 1, 2, 0, 1, 2, 2, 1, 0, 1, 2, 2]) == 2847",
"assert candidate(nums=[2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0]) == 0",
"ass... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nThere are n unique virus variants in an infinite 2D grid. You are given a ... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
There are n unique virus variants in an infinite 2D grid. You are given a 2D array points, where points[i] = [xi, yi] r... | [
"assert candidate(points=[[5, 5], [6, 5], [7, 5], [8, 5], [9, 5], [10, 5]], k=5) == 2",
"assert candidate(points=[[1, 10], [10, 1], [10, 10], [5, 5]], k=4) == 9",
"assert candidate(points=[[1, 1], [1, 2], [1, 3], [1, 4], [1, 5]], k=4) == 2",
"assert candidate(points=[[10, 10], [20, 20], [30, 30]], k=2) == 10"... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(points=[[5, 5], [6, 5], [7, 5], [8, 5], [9, 5], [10, 5]], k=5) == 2",
"assert candidate(points=[[1, 10], [10, 1], [10, 10], [5, 5]], k=4) == 9",
"assert candidate(points=[[1, 1], [1, 2], [1, 3], [1, 4], [1, 5]], k=4) == 2",
"assert candidate(points=[[10, 10], [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:\nYou are currently designing a dynamic array. You are given a 0-indexed int... | You are an expert Python programmer. 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 currently designing a dynamic array. You are given a 0-indexed integer array nums, where nums[i] is the number ... | [
"assert candidate(nums=[1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024], k=5) == 81",
"assert candidate(nums=[10, 20, 30], k=1) == 10",
"assert candidate(nums=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120], k=4) == 90",
"assert candidate(nums=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024], k=5) == 81",
"assert candidate(nums=[10, 20, 30], k=1) == 10",
"assert candidate(nums=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120], k=4) == 90",
"assert candidate(nums=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed integer array piles, where piles[i] represents t... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given a 0-indexed integer array piles, where piles[i] represents the number of stones in the ith pile, and an i... | [
"assert candidate(piles=[10000, 10000, 10000], k=10000) == 3",
"assert candidate(piles=[10, 10, 10], k=1) == 25",
"assert candidate(piles=[9999, 9998, 9997, 9996, 9995, 9994, 9993, 9992, 9991, 9990], k=5000) == 10",
"assert candidate(piles=[5000, 5000, 5000, 5000, 5000], k=25000) == 5",
"assert candidate(pi... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(piles=[10000, 10000, 10000], k=10000) == 3",
"assert candidate(piles=[10, 10, 10], k=1) == 25",
"assert candidate(piles=[9999, 9998, 9997, 9996, 9995, 9994, 9993, 9992, 9991, 9990], k=5000) == 10",
"assert candidate(piles=[5000, 5000, 5000, 5000, 5000], k=25000) ==... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 build some obstacle courses. You are given a 0-indexed integer... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You want to build some obstacle courses. You are given a 0-indexed integer array obstacles of length n, where obstacles... | [
"assert candidate(obstacles=[1, 3, 5, 7, 9, 2, 4, 6, 8, 10]) == [1, 2, 3, 4, 5, 2, 3, 4, 5, 6]",
"assert candidate(obstacles=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]) == [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2]",
"assert candidate(obstacles=[2, 4, 6, 8, 10, 12, 14, 1... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(obstacles=[1, 3, 5, 7, 9, 2, 4, 6, 8, 10]) == [1, 2, 3, 4, 5, 2, 3, 4, 5, 6]",
"assert candidate(obstacles=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]) == [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2]",
"assert candidate(obstacles=[... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nConsider a function that implements an algorithm similar to Binary Search.... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
Consider a function that implements an algorithm similar to Binary Search. The function has two input parameters: seque... | [
"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, 35, 36, 37, 38, 39, 40]) == 40",
"assert candidate(nums=[100, 1, 101, 2, 102, 3, 103, 4, 104, 5]) == 0",
"assert candidate(nums=[33, 21, 45, 19, 50, 27, 39, 40, ... | 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, 35, 36, 37, 38, 39, 40]) == 40",
"assert candidate(nums=[100, 1, 101, 2, 102, 3, 103, 4, 104, 5]) == 0",
"assert candidate(nums=[33, 21,... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed array nums of distinct integers. You want to rea... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given a 0-indexed array nums of distinct integers. You want to rearrange the elements in the array such that ev... | [
"assert candidate(nums=[1, 3, 5, 7, 9, 11, 13]) == [1, 9, 3, 11, 5, 13, 7]",
"assert candidate(nums=[10, 5, 1, 6, 2]) == [1, 6, 2, 10, 5]",
"assert candidate(nums=[100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110]) == [100, 106, 101, 107, 102, 108, 103, 109, 104, 110, 105]",
"assert candidate(nums=[8, 1,... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[1, 3, 5, 7, 9, 11, 13]) == [1, 9, 3, 11, 5, 13, 7]",
"assert candidate(nums=[10, 5, 1, 6, 2]) == [1, 6, 2, 10, 5]",
"assert candidate(nums=[100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110]) == [100, 106, 101, 107, 102, 108, 103, 109, 104, 110, 105]",
"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:\nThere is a 1-based binary matrix where 0 represents land and 1 represents ... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
There is a 1-based binary matrix where 0 represents land and 1 represents water. You are given integers row and col rep... | [
"assert candidate(row=6, col=5, cells=[[1, 1], [1, 2], [1, 3], [1, 4], [1, 5], [2, 5], [3, 5], [4, 5], [5, 5], [6, 5], [6, 4], [6, 3], [6, 2], [6, 1], [5, 1], [5, 2], [5, 3], [5, 4], [4, 4], [4, 3], [4, 2], [4, 1], [3, 1], [3, 2], [3, 3], [3, 4], [2, 4], [2, 3], [2, 2], [2, 1]]) == 4",
"assert candidate(row=5, co... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(row=6, col=5, cells=[[1, 1], [1, 2], [1, 3], [1, 4], [1, 5], [2, 5], [3, 5], [4, 5], [5, 5], [6, 5], [6, 4], [6, 3], [6, 2], [6, 1], [5, 1], [5, 2], [5, 3], [5, 4], [4, 4], [4, 3], [4, 2], [4, 1], [3, 1], [3, 2], [3, 3], [3, 4], [2, 4], [2, 3], [2, 2], [2, 1]]) == 4",
"ass... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven the root of a binary tree, return the number of nodes where the valu... | You are an expert Python programmer. 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 number of nodes where the value of the node is equal to the sum of the valu... | [
"assert candidate(root=tree_node([15, 7, 8, 3, 4, 3, 5, 1, 2, 1, 3, 1, 2, 1, 2])) == 3",
"assert candidate(root=tree_node([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15])) == 0",
"assert candidate(root=tree_node([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])) ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(root=tree_node([15, 7, 8, 3, 4, 3, 5, 1, 2, 1, 3, 1, 2, 1, 2])) == 3",
"assert candidate(root=tree_node([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15])) == 0",
"assert candidate(root=tree_node([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an n x n integer matrix. You can do the following operation ... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given an n x n integer matrix. You can do the following operation any number of times:
Choose any two adjacent... | [
"assert candidate(matrix=[[1, -1], [-1, 1]]) == 4",
"assert candidate(matrix=[[-1, 0, 1], [0, -2, 0], [1, 0, -1]]) == 6",
"assert candidate(matrix=[[-1, 2, -3], [4, -5, 6], [-7, 8, -9], [10, -11, 12], [-13, 14, -15]]) == 120",
"assert candidate(matrix=[[-1, 0, 1], [-2, 0, 2], [-3, 0, 3]]) == 12",
"assert ca... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(matrix=[[1, -1], [-1, 1]]) == 4",
"assert candidate(matrix=[[-1, 0, 1], [0, -2, 0], [1, 0, -1]]) == 6",
"assert candidate(matrix=[[-1, 2, -3], [4, -5, 6], [-7, 8, -9], [10, -11, 12], [-13, 14, -15]]) == 120",
"assert candidate(matrix=[[-1, 0, 1], [-2, 0, 2], [-3, 0... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are in a city that consists of n intersections numbered from 0 to n - ... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are in a city that consists of n intersections numbered from 0 to n - 1 with bi-directional roads between some inte... | [
"assert candidate(n=8, roads=[[0, 1, 4], [0, 2, 1], [1, 2, 2], [1, 3, 5], [2, 3, 1], [2, 4, 2], [3, 4, 3], [3, 5, 1], [4, 5, 2], [4, 6, 1], [5, 6, 2], [5, 7, 3], [6, 7, 1]]) == 1",
"assert candidate(n=12, roads=[[0, 1, 1], [0, 2, 2], [1, 2, 3], [1, 3, 4], [2, 3, 5], [2, 4, 6], [3, 4, 7], [3, 5, 8], [4, 5, 9], [4,... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(n=8, roads=[[0, 1, 4], [0, 2, 1], [1, 2, 2], [1, 3, 5], [2, 3, 1], [2, 4, 2], [3, 4, 3], [3, 5, 1], [4, 5, 2], [4, 6, 1], [5, 6, 2], [5, 7, 3], [6, 7, 1]]) == 1",
"assert candidate(n=12, roads=[[0, 1, 1], [0, 2, 2], [1, 2, 3], [1, 3, 4], [2, 3, 5], [2, 4, 6], [3, 4, 7], [3... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven an array of strings nums containing n unique binary strings each of ... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
Given an array of strings nums containing n unique binary strings each of length n, return a binary string of length n ... | [
"assert candidate(nums=['1100', '0011', '1010', '0101']) == '0000'",
"assert candidate(nums=['1111', '1000', '0100', '0001', '0010', '0110', '1001', '1101']) == '00000000'",
"assert candidate(nums=['00', '01']) == '11'",
"assert candidate(nums=['00000', '00001', '00010', '00011', '00100', '00101', '00110', '0... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=['1100', '0011', '1010', '0101']) == '0000'",
"assert candidate(nums=['1111', '1000', '0100', '0001', '0010', '0110', '1001', '1101']) == '00000000'",
"assert candidate(nums=['00', '01']) == '11'",
"assert candidate(nums=['00000', '00001', '00010', '00011', '0... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an m x n integer matrix mat and an integer target.\nChoose o... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given an m x n integer matrix mat and an integer target.
Choose one integer from each row in the matrix such th... | [
"assert candidate(mat=[[1, 3, 5, 7, 9], [2, 4, 6, 8, 10], [11, 13, 15, 17, 19]], target=25) == 1",
"assert candidate(mat=[[1, 3, 5, 7, 9, 11, 13], [2, 4, 6, 8, 10, 12, 14], [15, 17, 19, 21, 23, 25, 27]], target=50) == 0",
"assert candidate(mat=[[1, 100, 200], [2, 150, 250], [3, 200, 300], [4, 250, 350]], target... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(mat=[[1, 3, 5, 7, 9], [2, 4, 6, 8, 10], [11, 13, 15, 17, 19]], target=25) == 1",
"assert candidate(mat=[[1, 3, 5, 7, 9, 11, 13], [2, 4, 6, 8, 10, 12, 14], [15, 17, 19, 21, 23, 25, 27]], target=50) == 0",
"assert candidate(mat=[[1, 100, 200], [2, 150, 250], [3, 200, 300... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an integer n representing the length of an unknown array tha... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given an integer n representing the length of an unknown array that you are trying to recover. You are also giv... | [
"assert candidate(n=5, sums=[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) == [0, 0, 0, 0, 0]",
"assert candidate(n=5, sums=[31, 17, 21, 18, 12, 13, 19, 14, 20, 24, 8, 11, 9, 5, 4, 10, 0, 15, 7, 3, 16, 6, 2, 1, 23, 22, 16, 25, 26, 30, 27, 29, 31]) == [1, 2, 4, 8, 16]",
"assert candidate(n=6, sums... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(n=5, sums=[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) == [0, 0, 0, 0, 0]",
"assert candidate(n=5, sums=[31, 17, 21, 18, 12, 13, 19, 14, 20, 24, 8, 11, 9, 5, 4, 10, 0, 15, 7, 3, 16, 6, 2, 1, 23, 22, 16, 25, 26, 30, 27, 29, 31]) == [1, 2, 4, 8, 16]",
"a... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given two 0-indexed binary arrays nums1 and nums2. Find the widest... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given two 0-indexed binary arrays nums1 and nums2. Find the widest pair of indices (i, j) such that i <= j and ... | [
"assert candidate(nums1=[1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0], nums2=[0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1]) == 12",
"assert candidate(nums1=[1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0], nums2=[0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1]) == 16",
"assert candidate(nums1=[1, 0, 1, 1, 1, 0, 1, 0, 1, 1], nums... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums1=[1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0], nums2=[0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1]) == 12",
"assert candidate(nums1=[1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0], nums2=[0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1]) == 16",
"assert candidate(nums1=[1, 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:\nYou are given an array of strings nums and an integer k. Each string in 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:
You are given an array of strings nums and an integer k. Each string in nums represents an integer without leading zero... | [
"assert candidate(nums=['100000000000000000000000000000000000000000000000000000000000000', '99999999999999999999999999999999999999999999999999999999999999'], k=1) == '100000000000000000000000000000000000000000000000000000000000000'",
"assert candidate(nums=['0', '0'], k=2) == '0'",
"assert candidate(nums=['1234... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=['100000000000000000000000000000000000000000000000000000000000000', '99999999999999999999999999999999999999999999999999999999999999'], k=1) == '100000000000000000000000000000000000000000000000000000000000000'",
"assert candidate(nums=['0', '0'], k=2) == '0'",
"ass... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nThere are n tasks assigned to you. The task times are represented as an in... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
There are n tasks assigned to you. The task times are represented as an integer array tasks of length n, where the ith ... | [
"assert candidate(tasks=[14, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], sessionTime=14) == 2",
"assert candidate(tasks=[10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1], sessionTime=11) == 7",
"assert candidate(tasks=[2, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7], sessionTime=12) == 6",
"assert candidate(tasks=[7, 7... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(tasks=[14, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], sessionTime=14) == 2",
"assert candidate(tasks=[10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1], sessionTime=11) == 7",
"assert candidate(tasks=[2, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7], sessionTime=12) == 6",
"a... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a binary string binary. A subsequence of binary is considere... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given a binary string binary. A subsequence of binary is considered good if it is not empty and has no leading ... | [
"assert candidate(binary='00000') == 1",
"assert candidate(binary='111111111111111111111111') == 24",
"assert candidate(binary='1001001001001001') == 1351",
"assert candidate(binary='010101010101010101010101010101010101010101010101010') == 951279875",
"assert candidate(binary='100100100100100100100100100100... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(binary='00000') == 1",
"assert candidate(binary='111111111111111111111111') == 24",
"assert candidate(binary='1001001001001001') == 1351",
"assert candidate(binary='010101010101010101010101010101010101010101010101010') == 951279875",
"assert candidate(binary='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 playing a game of tag with your friends. In tag, people are divide... | You are an expert Python programmer. 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 playing a game of tag with your friends. In tag, people are divided into two teams: people who are "it", and pe... | [
"assert candidate(team=[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], dist=12) == 2",
"assert candidate(team=[0, 0, 0, 0, 0, 0, 0, 1], dist=2) == 1",
"assert candidate(team=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], dist=5) == 5",
"assert candidate(team=[1, 1, ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(team=[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], dist=12) == 2",
"assert candidate(team=[0, 0, 0, 0, 0, 0, 0, 1], dist=2) == 1",
"assert candidate(team=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], dist=5) == 5",
"as... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed m x n binary matrix land where a 0 represents a ... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given a 0-indexed m x n binary matrix land where a 0 represents a hectare of forested land and a 1 represents a... | [
"assert candidate(land=[[1, 0, 0, 1, 0], [0, 1, 1, 0, 1], [0, 1, 1, 0, 1], [1, 0, 0, 1, 0], [0, 1, 1, 0, 1]]) == [[0, 0, 0, 0], [0, 3, 0, 3], [1, 1, 2, 2], [1, 4, 2, 4], [3, 0, 3, 0], [3, 3, 3, 3], [4, 1, 4, 2], [4, 4, 4, 4]]",
"assert candidate(land=[[1, 0, 1], [0, 0, 0], [1, 1, 1]]) == [[0, 0, 0, 0], [0, 2, 0, ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(land=[[1, 0, 0, 1, 0], [0, 1, 1, 0, 1], [0, 1, 1, 0, 1], [1, 0, 0, 1, 0], [0, 1, 1, 0, 1]]) == [[0, 0, 0, 0], [0, 3, 0, 3], [1, 1, 2, 2], [1, 4, 2, 4], [3, 0, 3, 0], [3, 3, 3, 3], [4, 1, 4, 2], [4, 4, 4, 4]]",
"assert candidate(land=[[1, 0, 1], [0, 0, 0], [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 integer array nums. We call a subset of nums good if its ... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given an integer array nums. We call a subset of nums good if its product can be represented as a product of on... | [
"assert candidate(nums=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) == 0",
"assert candidate(nums=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29]) == 1047552.0",
"assert candidate(nums=[1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5]) == 142.0",
"assert candidate(nums=[8, 9, 1... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) == 0",
"assert candidate(nums=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29]) == 1047552.0",
"assert candidate(nums=[1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5]) == 142.0",
"ass... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nThere are n rooms you need to visit, labeled from 0 to n - 1. Each day is ... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
There are n rooms you need to visit, labeled from 0 to n - 1. Each day is labeled, starting from 0. You will go in and ... | [
"assert candidate(nextVisit=[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) == 1048574",
"assert candidate(nextVisit=[0, 2, 1, 0, 3, 2, 1, 0, 4, 3, 2, 1, 0, 5, 4, 3, 2, 1, 0, 6, 5, 4, 3, 2, 1, 0]) == 40131408",
"assert candidate(nextVisit=[0, 1, 0, 3, 2, 1, 0, 5, 4, 3, 2, 1, 0, 7, 6, 5, 4, 3, 2, 1... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nextVisit=[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) == 1048574",
"assert candidate(nextVisit=[0, 2, 1, 0, 3, 2, 1, 0, 4, 3, 2, 1, 0, 5, 4, 3, 2, 1, 0, 6, 5, 4, 3, 2, 1, 0]) == 40131408",
"assert candidate(nextVisit=[0, 1, 0, 3, 2, 1, 0, 5, 4, 3, 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 three integers, k, digit1, and digit2, you want to find the smallest... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
Given three integers, k, digit1, and digit2, you want to find the smallest integer that is:
Larger than k,
A multiple ... | [
"assert candidate(k=500, digit1=0, digit2=5) == 5000",
"assert candidate(k=43, digit1=4, digit2=3) == 344",
"assert candidate(k=500, digit1=3, digit2=7) == -1",
"assert candidate(k=999999999, digit1=9, digit2=9) == -1",
"assert candidate(k=7, digit1=1, digit2=7) == 77",
"assert candidate(k=200, digit1=5, ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(k=500, digit1=0, digit2=5) == 5000",
"assert candidate(k=43, digit1=4, digit2=3) == 344",
"assert candidate(k=500, digit1=3, digit2=7) == -1",
"assert candidate(k=999999999, digit1=9, digit2=9) == -1",
"assert candidate(k=7, digit1=1, digit2=7) == 77",
"ass... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given n rectangles represented by a 0-indexed 2D integer array rec... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given n rectangles represented by a 0-indexed 2D integer array rectangles, where rectangles[i] = [widthi, heigh... | [
"assert candidate(rectangles=[[10, 20], [15, 30], [20, 40], [25, 50], [30, 60], [35, 70], [40, 80], [45, 90]]) == 28",
"assert candidate(rectangles=[[1, 100000], [2, 200000], [3, 300000], [4, 400000], [5, 500000], [6, 600000], [7, 700000], [8, 800000], [9, 900000], [10, 1000000]]) == 45",
"assert candidate(rect... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(rectangles=[[10, 20], [15, 30], [20, 40], [25, 50], [30, 60], [35, 70], [40, 80], [45, 90]]) == 28",
"assert candidate(rectangles=[[1, 100000], [2, 200000], [3, 300000], [4, 400000], [5, 500000], [6, 600000], [7, 700000], [8, 800000], [9, 900000], [10, 1000000]]) == 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:\nGiven a string s, find two disjoint palindromic subsequences of s such tha... | You are an expert Python programmer. 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, find two disjoint palindromic subsequences of s such that the product of their lengths is maximized. ... | [
"assert candidate(s='abcddcbaabcddcba') == 64",
"assert candidate(s='aabbbbaa') == 16",
"assert candidate(s='deified') == 12",
"assert candidate(s='zzzzzyzzzz') == 25",
"assert candidate(s='noonappaloopnoon') == 56",
"assert candidate(s='xyzzazxy') == 15",
"assert candidate(s='rotor') == 6",
"assert c... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(s='abcddcbaabcddcba') == 64",
"assert candidate(s='aabbbbaa') == 16",
"assert candidate(s='deified') == 12",
"assert candidate(s='zzzzzyzzzz') == 25",
"assert candidate(s='noonappaloopnoon') == 56",
"assert candidate(s='xyzzazxy') == 15",
"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:\nA Fibonacci tree is a binary tree created using the order function order(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 Fibonacci tree is a binary tree created using the order function order(n):
order(0) is the empty tree.
order(1) is a... | [
"assert candidate(n=63) == True",
"assert candidate(n=2) == True",
"assert candidate(n=42) == True",
"assert candidate(n=24) == True",
"assert candidate(n=10) == True",
"assert candidate(n=51) == True",
"assert candidate(n=25) == False",
"assert candidate(n=69) == True",
"assert candidate(n=100) == ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(n=63) == True",
"assert candidate(n=2) == True",
"assert candidate(n=42) == True",
"assert candidate(n=24) == True",
"assert candidate(n=10) == True",
"assert candidate(n=51) == True",
"assert candidate(n=25) == False",
"assert candidate(n=69) == Tr... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 array original is transformed into a doubled array changed by 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:
An integer array original is transformed into a doubled array changed by appending twice the value of every element in ... | [
"assert candidate(changed=[11, 22, 33, 44, 55, 66, 77, 88, 99, 110, 121, 132, 143, 154, 165, 176, 187, 198, 220, 242, 264, 286, 308, 330, 352, 374, 396, 440, 484, 528, 572, 616, 660, 704, 748, 792, 880, 968, 1056, 1144, 1232, 1320, 1408, 1496, 1584, 1760, 1936, 2112, 2288, 2464, 2640, 2816, 2992, 3168, 3520, 3872, ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(changed=[11, 22, 33, 44, 55, 66, 77, 88, 99, 110, 121, 132, 143, 154, 165, 176, 187, 198, 220, 242, 264, 286, 308, 330, 352, 374, 396, 440, 484, 528, 572, 616, 660, 704, 748, 792, 880, 968, 1056, 1144, 1232, 1320, 1408, 1496, 1584, 1760, 1936, 2112, 2288, 2464, 2640, 2816, 299... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 points on a road you are driving your taxi on. The n points 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:
There are n points on a road you are driving your taxi on. The n points on the road are labeled from 1 to n in the dire... | [
"assert candidate(n=5000, rides=[[1, 2500, 2500], [2501, 5000, 2500], [1, 5000, 5000]]) == 9999",
"assert candidate(n=10, rides=[[1, 3, 2], [2, 5, 3], [4, 8, 2], [6, 10, 3]]) == 13",
"assert candidate(n=15, rides=[[1, 2, 1], [2, 3, 2], [3, 4, 3], [4, 5, 4], [5, 6, 5], [6, 7, 6], [7, 8, 7], [8, 9, 8], [9, 10, 9]... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(n=5000, rides=[[1, 2500, 2500], [2501, 5000, 2500], [1, 5000, 5000]]) == 9999",
"assert candidate(n=10, rides=[[1, 3, 2], [2, 5, 3], [4, 8, 2], [6, 10, 3]]) == 13",
"assert candidate(n=15, rides=[[1, 2, 1], [2, 3, 2], [3, 4, 3], [4, 5, 4], [5, 6, 5], [6, 7, 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 an integer array nums. In one operation, you can replace any... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given an integer array nums. In one operation, you can replace any element in nums with any integer.
nums is co... | [
"assert candidate(nums=[1, 1000000000]) == 1",
"assert candidate(nums=[1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000, 2, 11, 101, 1001, 10001, 100001, 1000001, 10000001, 100000001, 1000000001]) == 16",
"assert candidate(nums=[1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024]) == 7",
"as... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[1, 1000000000]) == 1",
"assert candidate(nums=[1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000, 2, 11, 101, 1001, 10001, 100001, 1000001, 10000001, 100000001, 1000000001]) == 16",
"assert candidate(nums=[1, 2, 4, 8, 16, 32, 64, 128, 256,... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed integer array nums. For each index i (1 <= i <= ... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given a 0-indexed integer array nums. For each index i (1 <= i <= nums.length - 2) the beauty of nums[i] equals... | [
"assert candidate(nums=[1, 3, 2, 4, 3, 5, 4, 6, 5, 7, 6, 8, 7, 9, 8, 10, 9, 11, 10, 12]) == 0",
"assert candidate(nums=[5, 1, 4, 3, 6, 8, 2, 9, 7, 10]) == 1",
"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]) == 56",
"assert... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[1, 3, 2, 4, 3, 5, 4, 6, 5, 7, 6, 8, 7, 9, 8, 10, 9, 11, 10, 12]) == 0",
"assert candidate(nums=[5, 1, 4, 3, 6, 8, 2, 9, 7, 10]) == 1",
"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, 2... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a string s of length n, and an integer k. You are tasked to ... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given a string s of length n, and an integer k. You are tasked to find the longest subsequence repeated k times... | [
"assert candidate(s='letsleetcode', k=2) == 'let'",
"assert candidate(s='abcabcabcabcabc', k=5) == 'abc'",
"assert candidate(s='aaaabbbbcccc', k=2) == 'cc'",
"assert candidate(s='aabbccddeeefffggg', k=2) == 'g'",
"assert candidate(s='aaaabbbbccccddddeeeeffffgggghhhhiiii', k=3) == 'i'",
"assert candidate(s... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(s='letsleetcode', k=2) == 'let'",
"assert candidate(s='abcabcabcabcabc', k=5) == 'abc'",
"assert candidate(s='aaaabbbbcccc', k=2) == 'cc'",
"assert candidate(s='aabbccddeeefffggg', k=2) == 'g'",
"assert candidate(s='aaaabbbbccccddddeeeeffffgggghhhhiiii', k=3) =... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nA perfectly straight street is represented by a number line. The street ha... | You are an expert Python programmer. 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 perfectly straight street is represented by a number line. The street has building(s) on it and is represented by a 2... | [
"assert candidate(buildings=[[1, 10, 1], [2, 8, 2], [3, 7, 3], [4, 6, 4]]) == [[1, 3, 1], [3, 7, 2], [7, 10, 1]]",
"assert candidate(buildings=[[0, 3, 1], [1, 4, 2], [2, 5, 3], [3, 6, 4], [4, 7, 5]]) == [[0, 2, 1], [2, 3, 2], [3, 4, 3], [4, 6, 4], [6, 7, 5]]",
"assert candidate(buildings=[[1, 5, 10], [2, 4, 20]... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(buildings=[[1, 10, 1], [2, 8, 2], [3, 7, 3], [4, 6, 4]]) == [[1, 3, 1], [3, 7, 2], [7, 10, 1]]",
"assert candidate(buildings=[[0, 3, 1], [1, 4, 2], [2, 5, 3], [3, 6, 4], [4, 7, 5]]) == [[0, 2, 1], [2, 3, 2], [3, 4, 3], [4, 6, 4], [6, 7, 5]]",
"assert candidate(building... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed 2D array grid of size 2 x n, where grid[r][c] re... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given a 0-indexed 2D array grid of size 2 x n, where grid[r][c] represents the number of points at position (r,... | [
"assert candidate(grid=[[100000, 1, 100000, 1, 100000, 1], [1, 100000, 1, 100000, 1, 100000]]) == 100002",
"assert candidate(grid=[[100, 200, 300, 400, 500], [500, 400, 300, 200, 100]]) == 900",
"assert candidate(grid=[[1, 2, 3, 4, 5], [5, 4, 3, 2, 1]]) == 9",
"assert candidate(grid=[[1, 100, 1], [100, 1, 100... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(grid=[[100000, 1, 100000, 1, 100000, 1], [1, 100000, 1, 100000, 1, 100000]]) == 100002",
"assert candidate(grid=[[100, 200, 300, 400, 500], [500, 400, 300, 200, 100]]) == 900",
"assert candidate(grid=[[1, 2, 3, 4, 5], [5, 4, 3, 2, 1]]) == 9",
"assert candidate(grid... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 board, representing the current state of a c... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given an m x n matrix board, representing the current state of a crossword puzzle. The crossword contains lower... | [
"assert candidate(board=[['#', '#', '#', '#', '#'], ['#', ' ', ' ', ' ', '#'], ['#', ' ', '#', ' ', '#'], ['#', ' ', ' ', ' ', '#'], ['#', '#', '#', '#', '#']], word='test') == False",
"assert candidate(board=[[' ', ' ', ' ', ' '], ['#', 'a', 'b', '#'], [' ', ' ', ' ', ' '], ['#', 'd', 'c', '#']], word='abcd') ==... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(board=[['#', '#', '#', '#', '#'], ['#', ' ', ' ', ' ', '#'], ['#', ' ', '#', ' ', '#'], ['#', ' ', ' ', ' ', '#'], ['#', '#', '#', '#', '#']], word='test') == False",
"assert candidate(board=[[' ', ' ', ' ', ' '], ['#', 'a', 'b', '#'], [' ', ' ', ' ', ' '], ['#', 'd', 'c',... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a string s that contains digits 0-9, addition symbols '+', a... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given a string s that contains digits 0-9, addition symbols '+', and multiplication symbols '*' only, represent... | [
"assert candidate(s='1*2*3*4*5', answers=[120, 20, 60, 30, 10, 240, 15, 40, 6]) == 5",
"assert candidate(s='4*3+2*8+1*7+6', answers=[63, 59, 66, 71, 60, 69, 64, 73, 68, 61]) == 0",
"assert candidate(s='1+2*3+4*5', answers=[14, 23, 13, 47, 23, 53]) == 2",
"assert candidate(s='4*2+1*3+5*6+7', answers=[51, 49, 6... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(s='1*2*3*4*5', answers=[120, 20, 60, 30, 10, 240, 15, 40, 6]) == 5",
"assert candidate(s='4*3+2*8+1*7+6', answers=[63, 59, 66, 71, 60, 69, 64, 73, 68, 61]) == 0",
"assert candidate(s='1+2*3+4*5', answers=[14, 23, 13, 47, 23, 53]) == 2",
"assert candidate(s='4*2+1*3... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nA perfectly straight street is represented by a number line. The street ha... | You are an expert Python programmer. 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 perfectly straight street is represented by a number line. The street has street lamp(s) on it and is represented by ... | [
"assert candidate(lights=[[1, 0], [2, 1], [3, 2], [4, 3], [5, 4], [6, 5], [7, 6], [8, 7], [9, 8], [10, 9]]) == 1",
"assert candidate(lights=[[0, 1], [1, 1], [2, 1], [3, 1], [4, 1], [5, 1], [6, 1], [7, 1], [8, 1], [9, 1], [10, 1], [11, 1], [12, 1], [13, 1], [14, 1], [15, 1], [16, 1], [17, 1], [18, 1], [19, 1], [20... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(lights=[[1, 0], [2, 1], [3, 2], [4, 3], [5, 4], [6, 5], [7, 6], [8, 7], [9, 8], [10, 9]]) == 1",
"assert candidate(lights=[[0, 1], [1, 1], [2, 1], [3, 1], [4, 1], [5, 1], [6, 1], [7, 1], [8, 1], [9, 1], [10, 1], [11, 1], [12, 1], [13, 1], [14, 1], [15, 1], [16, 1], [17, 1]... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven an array of digit strings nums and a digit string target, return the... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
Given an array of digit strings nums and a digit string target, return the number of pairs of indices (i, j) (where i !... | [
"assert candidate(nums=['50', '5', '500'], target='505') == 1",
"assert candidate(nums=['22', '222', '2', '2222'], target='222222') == 2",
"assert candidate(nums=['13', '31', '1', '3'], target='1331') == 1",
"assert candidate(nums=['0', '0', '0', '0'], target='00') == 12",
"assert candidate(nums=['1', '1', ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=['50', '5', '500'], target='505') == 1",
"assert candidate(nums=['22', '222', '2', '2222'], target='222222') == 2",
"assert candidate(nums=['13', '31', '1', '3'], target='1331') == 1",
"assert candidate(nums=['0', '0', '0', '0'], target='00') == 12",
"asse... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nA teacher is writing a test with n true/false questions, with 'T' denoting... | You are an expert Python programmer. 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 teacher is writing a test with n true/false questions, with 'T' denoting true and 'F' denoting false. He wants to con... | [
"assert candidate(answerKey='TTFTTFTT', k=1) == 5",
"assert candidate(answerKey='TTFFFFFFFFFFFFFFFFFT', k=3) == 20",
"assert candidate(answerKey='TFFTFFTFFTFFTFFTFFTFFTFFTFFT', k=21) == 28",
"assert candidate(answerKey='TFFTFTFTFFTTFTFT', k=3) == 9",
"assert candidate(answerKey='TTTTTTFTTTTTFTTTTTFTTTTT', k... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(answerKey='TTFTTFTT', k=1) == 5",
"assert candidate(answerKey='TTFFFFFFFFFFFFFFFFFT', k=3) == 20",
"assert candidate(answerKey='TFFTFFTFFTFFTFFTFFTFFTFFTFFT', k=21) == 28",
"assert candidate(answerKey='TFFTFTFTFFTTFTFT', k=3) == 9",
"assert candidate(answerKey=... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 observations of n + m 6-sided dice rolls with each face numbered ... | You are an expert Python programmer. 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 observations of n + m 6-sided dice rolls with each face numbered from 1 to 6. n of the observations went missi... | [
"assert candidate(rolls=[3, 3, 3, 3, 3], mean=5, n=5) == []",
"assert candidate(rolls=[1, 6, 1, 6, 1, 6], mean=4, n=3) == [5, 5, 5]",
"assert candidate(rolls=[1, 2, 2, 3, 3, 4, 5, 6], mean=3, n=10) == [3, 3, 3, 3, 3, 3, 3, 3, 2, 2]",
"assert candidate(rolls=[1, 2, 3], mean=4, n=3) == [6, 6, 6]",
"assert can... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(rolls=[3, 3, 3, 3, 3], mean=5, n=5) == []",
"assert candidate(rolls=[1, 6, 1, 6, 1, 6], mean=4, n=3) == [5, 5, 5]",
"assert candidate(rolls=[1, 2, 2, 3, 3, 4, 5, 6], mean=3, n=10) == [3, 3, 3, 3, 3, 3, 3, 3, 2, 2]",
"assert candidate(rolls=[1, 2, 3], mean=4, n=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:\nAlice and Bob continue their games with stones. There is a row of n stones... | You are an expert Python programmer. 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 stones. There is a row of n stones, and each stone has an associated value. You... | [
"assert candidate(stones=[2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]) == False",
"assert candidate(stones=[10000, 9999, 9998, 9997, 9996, 9995, 9994, 9993, 9992, 9991]) == False",
"assert candidate(stones=[2, 5, 8, 11, 14, 17, 20, 23, 26, 29, 32, 35, 38, 41, 44, 47... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(stones=[2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]) == False",
"assert candidate(stones=[10000, 9999, 9998, 9997, 9996, 9995, 9994, 9993, 9992, 9991]) == False",
"assert candidate(stones=[2, 5, 8, 11, 14, 17, 20, 23, 26, 2... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a string s, an integer k, a letter letter, and an integer re... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given a string s, an integer k, a letter letter, and an integer repetition.
Return the lexicographically smalle... | [
"assert candidate(s='zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz', k=50, letter='z', repetition=10) == 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz'",
"assert candidate(s='abracadabra', k=7, letter='a', repetition=3) == 'aaaabra'",
"assert candidate(s='azbzczdz', k=4, lette... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(s='zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz', k=50, letter='z', repetition=10) == 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz'",
"assert candidate(s='abracadabra', k=7, letter='a', repetition=3) == 'aaaabra'",
"assert candidate... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a binary array nums containing only the integers 0 and 1. Re... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given a binary array nums containing only the integers 0 and 1. Return the number of subarrays in nums that hav... | [
"assert candidate(nums=[0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1]) == 78",
"assert candidate(nums=[0, 0, 0, 0, 0, 0]) == 0",
"assert candidate(nums=[1, 1, 0, 0, 1, 1, 0, 0]) == 13",
"assert candidate(nums=[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]... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1]) == 78",
"assert candidate(nums=[0, 0, 0, 0, 0, 0]) == 0",
"assert candidate(nums=[1, 1, 0, 0, 1, 1, 0, 0]) == 13",
"assert candidate(nums=[1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0,... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 2D integer grid of size m x n and an integer x. In one ope... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given a 2D integer grid of size m x n and an integer x. In one operation, you can add x to or subtract x from a... | [
"assert candidate(grid=[[7, 14, 21], [28, 35, 42], [49, 56, 63]], x=7) == 20",
"assert candidate(grid=[[1, 2], [3, 4], [5, 7]], x=2) == -1",
"assert candidate(grid=[[10, 20, 30], [20, 30, 40], [30, 40, 50]], x=10) == 8",
"assert candidate(grid=[[101, 102, 103], [104, 105, 106], [107, 108, 109]], x=1) == 20",
... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(grid=[[7, 14, 21], [28, 35, 42], [49, 56, 63]], x=7) == 20",
"assert candidate(grid=[[1, 2], [3, 4], [5, 7]], x=2) == -1",
"assert candidate(grid=[[10, 20, 30], [20, 30, 40], [30, 40, 50]], x=10) == 8",
"assert candidate(grid=[[101, 102, 103], [104, 105, 106], [107... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an integer array nums of 2 * n integers. You need to partiti... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given an integer array nums of 2 * n integers. You need to partition nums into two arrays of length n to minimi... | [
"assert candidate(nums=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) == 0",
"assert candidate(nums=[1, 2, -3, 4, -5, 6, -7, 8, -9, 10, -11, 12, -13, 14, -15, 16]) == 0",
"assert candidate(nums=[100000, -100000, 200000, -200000, 300000, -300000, 400000, -400000, 500000, -500000, 600000, -600000, 700000, -700... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) == 0",
"assert candidate(nums=[1, 2, -3, 4, -5, 6, -7, 8, -9, 10, -11, 12, -13, 14, -15, 16]) == 0",
"assert candidate(nums=[100000, -100000, 200000, -200000, 300000, -300000, 400000, -400000, 500000, -500000, 6000... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 subarray of a 0-indexed integer array is a contiguous non-empty sequence... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
A subarray of a 0-indexed integer array is a contiguous non-empty sequence of elements within an array.
The alternating... | [
"assert candidate(nums=[100000, -100000, 100000, -100000, 100000, -100000]) == 600000",
"assert candidate(nums=[10, -10, 20, -20, 30, -30, 40, -40, 50, -50, 60]) == 360",
"assert candidate(nums=[10, -1, 11, -2, 12, -3, 13, -4, 14, -5]) == 75",
"assert candidate(nums=[1, 2, 3, 4, 5]) == 5",
"assert candidate... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[100000, -100000, 100000, -100000, 100000, -100000]) == 600000",
"assert candidate(nums=[10, -10, 20, -20, 30, -30, 40, -40, 50, -50, 60]) == 360",
"assert candidate(nums=[10, -1, 11, -2, 12, -3, 13, -4, 14, -5]) == 75",
"assert candidate(nums=[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:\nThere are n pieces arranged in a line, and each piece is colored either by... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
There are n pieces arranged in a line, and each piece is colored either by 'A' or by 'B'. You are given a string colors... | [
"assert candidate(colors='AABBBAAABBBAAABBB') == False",
"assert candidate(colors='BBBAAAABBAAAABBAAAABBB') == True",
"assert candidate(colors='AAABAAABAAABAAABA') == True",
"assert candidate(colors='BAAABAAABAAABBB') == True",
"assert candidate(colors='BBBBBAAAABBBBBAAAABBBBBAAAABBBBBAAAABBBBBAAAABBBBB') =... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(colors='AABBBAAABBBAAABBB') == False",
"assert candidate(colors='BBBAAAABBAAAABBAAAABBB') == True",
"assert candidate(colors='AAABAAABAAABAAABA') == True",
"assert candidate(colors='BAAABAAABAAABBB') == True",
"assert candidate(colors='BBBBBAAAABBBBBAAAABBBBBAA... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 network of n servers, labeled from 0 to n - 1. You are given a ... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
There is a network of n servers, labeled from 0 to n - 1. You are given a 2D integer array edges, where edges[i] = [ui,... | [
"assert candidate(edges=[[0, 1], [0, 2], [1, 3], [1, 4], [2, 5], [2, 6], [3, 7], [3, 8], [4, 9], [4, 10]], patience=[0, 15, 10, 20, 5, 12, 8, 6, 4, 7, 3]) == 11",
"assert candidate(edges=[[0, 1], [0, 2], [1, 3], [2, 4], [3, 5], [4, 6], [5, 7], [6, 8], [7, 9], [8, 10], [10, 11], [11, 12], [12, 13], [13, 14], [14, ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(edges=[[0, 1], [0, 2], [1, 3], [1, 4], [2, 5], [2, 6], [3, 7], [3, 8], [4, 9], [4, 10]], patience=[0, 15, 10, 20, 5, 12, 8, 6, 4, 7, 3]) == 11",
"assert candidate(edges=[[0, 1], [0, 2], [1, 3], [2, 4], [3, 5], [4, 6], [5, 7], [6, 8], [7, 9], [8, 10], [10, 11], [11, 12], [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 sorted 0-indexed integer arrays nums1 and nums2 as well as an in... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
Given two sorted 0-indexed integer arrays nums1 and nums2 as well as an integer k, return the kth (1-based) smallest pr... | [
"assert candidate(nums1=[-1, -1, -1, -1], nums2=[-1, -1, -1, -1], k=10) == 1",
"assert candidate(nums1=[-10, -5, 0, 5, 10], nums2=[-10, -5, 0, 5, 10], k=25) == 100",
"assert candidate(nums1=[-5, -3, -1, 1, 3, 5], nums2=[-6, -4, -2, 0, 2, 4, 6], k=15) == -4",
"assert candidate(nums1=[1, 3, 5, 7, 9], nums2=[-9,... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums1=[-1, -1, -1, -1], nums2=[-1, -1, -1, -1], k=10) == 1",
"assert candidate(nums1=[-10, -5, 0, 5, 10], nums2=[-10, -5, 0, 5, 10], k=25) == 100",
"assert candidate(nums1=[-5, -3, -1, 1, 3, 5], nums2=[-6, -4, -2, 0, 2, 4, 6], k=15) == -4",
"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:\nGiven an integer array nums, find the maximum possible bitwise OR of a sub... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
Given an integer array nums, find the maximum possible bitwise OR of a subset of nums and return the number of differen... | [
"assert candidate(nums=[3, 6, 12, 24, 48, 96, 192, 384]) == 21",
"assert candidate(nums=[5, 10, 15, 20, 25, 30, 35, 40]) == 150",
"assert candidate(nums=[5, 10, 15, 20, 25, 30]) == 44",
"assert candidate(nums=[14, 7, 3, 1, 14, 7, 3, 1]) == 189",
"assert candidate(nums=[15, 15, 15, 15]) == 15",
"assert can... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[3, 6, 12, 24, 48, 96, 192, 384]) == 21",
"assert candidate(nums=[5, 10, 15, 20, 25, 30, 35, 40]) == 150",
"assert candidate(nums=[5, 10, 15, 20, 25, 30]) == 44",
"assert candidate(nums=[14, 7, 3, 1, 14, 7, 3, 1]) == 189",
"assert candidate(nums=[15, 15, 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 city is represented as a bi-directional connected graph with n vertices ... | You are an expert Python programmer. 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 city is represented as a bi-directional connected graph with n vertices where each vertex is labeled from 1 to n (inc... | [
"assert candidate(n=4, edges=[[1, 2], [2, 3], [3, 4], [1, 4]], time=2, change=3) == 8",
"assert candidate(n=10, edges=[[1, 2], [1, 3], [2, 4], [2, 5], [3, 6], [3, 7], [4, 8], [5, 9], [6, 10], [7, 8], [9, 10]], time=2, change=4) == 12",
"assert candidate(n=6, edges=[[1, 2], [1, 3], [2, 4], [2, 5], [3, 5], [4, 6]... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(n=4, edges=[[1, 2], [2, 3], [3, 4], [1, 4]], time=2, change=3) == 8",
"assert candidate(n=10, edges=[[1, 2], [1, 3], [2, 4], [2, 5], [3, 6], [3, 7], [4, 8], [5, 9], [6, 10], [7, 8], [9, 10]], time=2, change=4) == 12",
"assert candidate(n=6, edges=[[1, 2], [1, 3], [2, 4... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nAn integer x is numerically balanced if for every digit d in the number x,... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
An integer x is numerically balanced if for every digit d in the number x, there are exactly d occurrences of that digi... | [
"assert candidate(n=1222233333) == 1223334444",
"assert candidate(n=5555544332211) == 5555544333144",
"assert candidate(n=1224444) == 1242444",
"assert candidate(n=123456789) == 126266666",
"assert candidate(n=98765) == 122333",
"assert candidate(n=122111333) == 122666666",
"assert candidate(n=5555555) ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(n=1222233333) == 1223334444",
"assert candidate(n=5555544332211) == 5555544333144",
"assert candidate(n=1224444) == 1242444",
"assert candidate(n=123456789) == 126266666",
"assert candidate(n=98765) == 122333",
"assert candidate(n=122111333) == 122666666",
... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 binary tree rooted at 0 consisting of n nodes. The nodes are la... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
There is a binary tree rooted at 0 consisting of n nodes. The nodes are labeled from 0 to n - 1. You are given a 0-inde... | [
"assert candidate(parents=[-1, 0, 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, 25, 25]) == 1",
"assert candidate(parents=[-1, 1, 1, 2, 2, 3, 3]) == 1",
"assert candidate(parents=[-1, 0, ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(parents=[-1, 0, 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, 25, 25]) == 1",
"assert candidate(parents=[-1, 1, 1, 2, 2, 3, 3]) == 1",
"assert c... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an integer n, which indicates that there are n courses label... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given an integer n, which indicates that there are n courses labeled from 1 to n. You are also given a 2D integ... | [
"assert candidate(n=13, relations=[[1, 3], [2, 3], [3, 4], [3, 5], [4, 6], [5, 6], [6, 7], [6, 8], [7, 9], [8, 9], [9, 10], [10, 11], [11, 12], [12, 13]], time=[4, 3, 5, 2, 6, 7, 8, 9, 3, 4, 10, 1, 2]) == 51",
"assert candidate(n=7, relations=[[1, 4], [2, 4], [3, 4], [1, 5], [2, 5], [3, 5], [4, 6], [5, 6], [4, 7]... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(n=13, relations=[[1, 3], [2, 3], [3, 4], [3, 5], [4, 6], [5, 6], [6, 7], [6, 8], [7, 9], [8, 9], [9, 10], [10, 11], [11, 12], [12, 13]], time=[4, 3, 5, 2, 6, 7, 8, 9, 3, 4, 10, 1, 2]) == 51",
"assert candidate(n=7, relations=[[1, 4], [2, 4], [3, 4], [1, 5], [2, 5], [3, 5],... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a string sentence containing words separated by spaces, and ... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given a string sentence containing words separated by spaces, and an integer k. Your task is to separate senten... | [
"assert candidate(sentence='short words only', k=5) == 0",
"assert candidate(sentence='testing edge cases with very small k', k=3) == inf",
"assert candidate(sentence='this is a rather long sentence that needs to be broken down into smaller parts efficiently', k=10) == inf",
"assert candidate(sentence='machin... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(sentence='short words only', k=5) == 0",
"assert candidate(sentence='testing edge cases with very small k', k=3) == inf",
"assert candidate(sentence='this is a rather long sentence that needs to be broken down into smaller parts efficiently', k=10) == inf",
"assert... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed 2D integer array of events where events[i] = [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 a 0-indexed 2D integer array of events where events[i] = [startTimei, endTimei, valuei]. The ith event st... | [
"assert candidate(events=[[1, 2, 1000000], [2, 3, 900000], [3, 4, 800000], [4, 5, 700000], [5, 6, 600000], [6, 7, 500000], [7, 8, 400000], [8, 9, 300000], [9, 10, 200000], [10, 11, 100000]]) == 1800000",
"assert candidate(events=[[1, 3, 2], [4, 5, 2], [2, 4, 3]]) == 4",
"assert candidate(events=[[1, 1, 1000000]... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(events=[[1, 2, 1000000], [2, 3, 900000], [3, 4, 800000], [4, 5, 700000], [5, 6, 600000], [6, 7, 500000], [7, 8, 400000], [8, 9, 300000], [9, 10, 200000], [10, 11, 100000]]) == 1800000",
"assert candidate(events=[[1, 3, 2], [4, 5, 2], [2, 4, 3]]) == 4",
"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:\nThere is a long table with a line of plates and candles arranged on top of... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
There is a long table with a line of plates and candles arranged on top of it. You are given a 0-indexed string s consi... | [
"assert candidate(s='***||****|**|', queries=[[0, 4], [5, 8], [9, 11]]) == [0, 0, 0]",
"assert candidate(s='***||***', queries=[[0, 5], [2, 4]]) == [0, 0]",
"assert candidate(s='*|*|*|*|*|*|*|*|*|*|*|', queries=[[0, 11], [1, 10], [2, 9], [3, 8]]) == [5, 4, 3, 2]",
"assert candidate(s='***|**|*****|**||**|*', ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(s='***||****|**|', queries=[[0, 4], [5, 8], [9, 11]]) == [0, 0, 0]",
"assert candidate(s='***||***', queries=[[0, 5], [2, 4]]) == [0, 0]",
"assert candidate(s='*|*|*|*|*|*|*|*|*|*|*|', queries=[[0, 11], [1, 10], [2, 9], [3, 8]]) == [5, 4, 3, 2]",
"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:\nA critical point in a linked list is defined as either a local maxima or 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 critical point in a linked list is defined as either a local maxima or a local minima.
A node is a local maxima if th... | [
"assert candidate(head=list_node([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1])) == [-1, -1]",
"assert candidate(head=list_node([9, 8, 7, 6, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10])) == [-1, -1]",
"assert candidate(head=list_node([1, 2, 3, 4, 5])) == [-1, -1]",
"assert candidate(head=list_no... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(head=list_node([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1])) == [-1, -1]",
"assert candidate(head=list_node([9, 8, 7, 6, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10])) == [-1, -1]",
"assert candidate(head=list_node([1, 2, 3, 4, 5])) == [-1, -1]",
"as... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed integer array nums containing distinct numbers, ... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given a 0-indexed integer array nums containing distinct numbers, an integer start, and an integer goal. There ... | [
"assert candidate(nums=[13, 26, 39, 52, 65, 78, 91, 104, 117, 130], start=100, goal=200) == 2",
"assert candidate(nums=[100, 200, 300], start=500, goal=1000) == 2",
"assert candidate(nums=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100], start=50, goal=990) == 10",
"assert candidate(nums=[500, 500, 500], start=1, go... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[13, 26, 39, 52, 65, 78, 91, 104, 117, 130], start=100, goal=200) == 2",
"assert candidate(nums=[100, 200, 300], start=500, goal=1000) == 2",
"assert candidate(nums=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100], start=50, goal=990) == 10",
"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:\nAn original string, consisting of lowercase English letters, can be encode... | You are an expert Python programmer. 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 original string, consisting of lowercase English letters, can be encoded by the following steps:
Arbitrarily split ... | [
"assert candidate(s1='1234', s2='1234') == True",
"assert candidate(s1='h3ll0', s2='hello') == False",
"assert candidate(s1='abcdefghij10k11l12m13n14o15p16q17r18s19t20u21v22w23x24y25z26', s2='abcdefghijklmnopqrstuvwxyz1234567891011121314151617181920212223242526') == False",
"assert candidate(s1='a5b3c2d', s2=... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(s1='1234', s2='1234') == True",
"assert candidate(s1='h3ll0', s2='hello') == False",
"assert candidate(s1='abcdefghij10k11l12m13n14o15p16q17r18s19t20u21v22w23x24y25z26', s2='abcdefghijklmnopqrstuvwxyz1234567891011121314151617181920212223242526') == False",
"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:\nA room is represented by a 0-indexed 2D binary matrix room where a 0 repre... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
A room is represented by a 0-indexed 2D binary matrix room where a 0 represents an empty space and a 1 represents a spa... | [
"assert candidate(room=[[0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 1, 0], [0, 0, 0, 0, 0, 0], [0, 1, 0, 1, 0, 1], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]]) == 14",
"assert candidate(room=[[0, 0, 0, 0, 0], [0, 1, 1, 1, 0], [0, 0, 0, 0, 0], [0, 1, 0, 1, 0], [0, 0, 0, 0, 0]]) == 16",
"assert candidate(room=[[0, 0, 0, 0, 0, 0... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(room=[[0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 1, 0], [0, 0, 0, 0, 0, 0], [0, 1, 0, 1, 0, 1], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]]) == 14",
"assert candidate(room=[[0, 0, 0, 0, 0], [0, 1, 1, 1, 0], [0, 0, 0, 0, 0], [0, 1, 0, 1, 0], [0, 0, 0, 0, 0]]) == 16",
"assert candidat... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven a string word, return the sum of the number of vowels ('a', 'e', 'i'... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
Given a string word, return the sum of the number of vowels ('a', 'e', 'i', 'o', and 'u') in every substring of word.
A... | [
"assert candidate(word='abcdefghijklmnopqrstuvwxyz') == 604",
"assert candidate(word='bcbcbcbcbcbcbcbcbcbc') == 0",
"assert candidate(word='xyzaeiouxyzaeiouxyz') == 820",
"assert candidate(word='characters') == 78",
"assert candidate(word='zzzzzzzzzzz') == 0",
"assert candidate(word='o') == 1",
"assert ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(word='abcdefghijklmnopqrstuvwxyz') == 604",
"assert candidate(word='bcbcbcbcbcbcbcbcbcbc') == 0",
"assert candidate(word='xyzaeiouxyzaeiouxyz') == 820",
"assert candidate(word='characters') == 78",
"assert candidate(word='zzzzzzzzzzz') == 0",
"assert candid... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an integer n indicating there are n specialty retail stores.... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given an integer n indicating there are n specialty retail stores. There are m product types of varying amounts... | [
"assert candidate(n=3, quantities=[100, 100, 100]) == 100",
"assert candidate(n=10000, quantities=[10000, 9999, 9998, 9997, 9996, 9995, 9994, 9993, 9992, 9991]) == 10",
"assert candidate(n=60000, quantities=[15000, 15000, 15000, 15000, 15000, 15000]) == 2",
"assert candidate(n=90000, quantities=[10, 20, 30, 4... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(n=3, quantities=[100, 100, 100]) == 100",
"assert candidate(n=10000, quantities=[10000, 9999, 9998, 9997, 9996, 9995, 9994, 9993, 9992, 9991]) == 10",
"assert candidate(n=60000, quantities=[15000, 15000, 15000, 15000, 15000, 15000]) == 2",
"assert candidate(n=90000... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed string s consisting of only lowercase English le... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given a 0-indexed string s consisting of only lowercase English letters, and an integer count. A substring of s... | [
"assert candidate(s='mississippiississippiississippi', count=4) == 4",
"assert candidate(s='zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz', count=15) == 52",
"assert candidate(s='abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz', count=2) == 1",
"assert candidate(s='aaaabbbbccccddddee... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(s='mississippiississippiississippi', count=4) == 4",
"assert candidate(s='zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz', count=15) == 52",
"assert candidate(s='abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz', count=2) == 1",
"assert cand... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 2D integer array items where items[i] = [pricei, beautyi] ... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given a 2D integer array items where items[i] = [pricei, beautyi] denotes the price and beauty of an item respe... | [
"assert candidate(items=[[5, 5], [5, 6], [5, 7], [5, 8], [5, 9]], queries=[1, 2, 3, 4, 5, 6]) == [0, 0, 0, 0, 9, 9]",
"assert candidate(items=[[1, 1000], [2, 900], [3, 800], [4, 700], [5, 600]], queries=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == [1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000]",
"assert ca... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(items=[[5, 5], [5, 6], [5, 7], [5, 8], [5, 9]], queries=[1, 2, 3, 4, 5, 6]) == [0, 0, 0, 0, 9, 9]",
"assert candidate(items=[[1, 1000], [2, 900], [3, 800], [4, 700], [5, 600]], queries=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == [1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 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 maze consists of n rooms numbered from 1 to n, and some rooms are connec... | You are an expert Python programmer. 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 maze consists of n rooms numbered from 1 to n, and some rooms are connected by corridors. You are given a 2D integer ... | [
"assert candidate(n=10, corridors=[[1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10], [10, 1], [1, 4], [3, 6], [5, 8], [7, 10]]) == 0",
"assert candidate(n=9, corridors=[[1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 1], [1, 3], [3, 5], [5, 7], [7, 9], [9, 3], [2, 4], [4... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(n=10, corridors=[[1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10], [10, 1], [1, 4], [3, 6], [5, 8], [7, 10]]) == 0",
"assert candidate(n=9, corridors=[[1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 1], [1, 3], [3, 5], [5, 7], [7,... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou want to water n plants in your garden with a watering can. The plants ... | You are an expert Python programmer. 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 water n plants in your garden with a watering can. The plants are arranged in a row and are labeled from 0 ... | [
"assert candidate(plants=[10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], capacity=20) == 152",
"assert candidate(plants=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(plants=[10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], capacity=20) == 152",
"assert candidate(plants=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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:\nA k-mirror number is a positive integer without leading zeros that reads 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 k-mirror number is a positive integer without leading zeros that reads the same both forward and backward in base-10 ... | [
"assert candidate(k=4, n=25) == 38898160",
"assert candidate(k=4, n=22) == 22726545",
"assert candidate(k=6, n=28) == 19806423",
"assert candidate(k=5, n=10) == 1940",
"assert candidate(k=2, n=1) == 1",
"assert candidate(k=7, n=19) == 91104965",
"assert candidate(k=6, n=20) == 156389",
"assert candida... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(k=4, n=25) == 38898160",
"assert candidate(k=4, n=22) == 22726545",
"assert candidate(k=6, n=28) == 19806423",
"assert candidate(k=5, n=10) == 1940",
"assert candidate(k=2, n=1) == 1",
"assert candidate(k=7, n=19) == 91104965",
"assert candidate(k=6, n=... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed string s consisting of only lowercase English le... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given a 0-indexed string s consisting of only lowercase English letters. Return the number of substrings in s t... | [
"assert candidate(s='abaacababa') == 28",
"assert candidate(s='xyzzyxzyxzyxzyxzyxzyx') == 84",
"assert candidate(s='repaper') == 10",
"assert candidate(s='nootnootnootnootnootnoot') == 120",
"assert candidate(s='xyzxyzxyzxyzxyzxyzxyzxyzxyzxyz') == 165",
"assert candidate(s='mississippi') == 24",
"assert... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(s='abaacababa') == 28",
"assert candidate(s='xyzzyxzyxzyxzyxzyxzyx') == 84",
"assert candidate(s='repaper') == 10",
"assert candidate(s='nootnootnootnootnootnoot') == 120",
"assert candidate(s='xyzxyzxyzxyzxyzxyzxyzxyzxyzxyz') == 165",
"assert candidate(s='... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nThere is an m x n grid, where (0, 0) is the top-left cell and (m - 1, n - ... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
There is an m x n grid, where (0, 0) is the top-left cell and (m - 1, n - 1) is the bottom-right cell. You are given an... | [
"assert candidate(startPos=[5, 5], homePos=[0, 0], rowCosts=[1, 1, 1, 1, 1, 1], colCosts=[1, 1, 1, 1, 1, 1]) == 10",
"assert candidate(startPos=[3, 1], homePos=[0, 3], rowCosts=[5, 10, 15, 20], colCosts=[1, 2, 3, 4]) == 37",
"assert candidate(startPos=[0, 5], homePos=[5, 0], rowCosts=[2, 2, 2, 2, 2, 2], colCost... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(startPos=[5, 5], homePos=[0, 0], rowCosts=[1, 1, 1, 1, 1, 1], colCosts=[1, 1, 1, 1, 1, 1]) == 10",
"assert candidate(startPos=[3, 1], homePos=[0, 3], rowCosts=[5, 10, 15, 20], colCosts=[1, 2, 3, 4]) == 37",
"assert candidate(startPos=[0, 5], homePos=[5, 0], rowCosts=[2... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nA farmer has a rectangular grid of land with m rows and n columns that 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:
A farmer has a rectangular grid of land with m rows and n columns that can be divided into unit cells. Each cell is eit... | [
"assert candidate(grid=[[1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1]]) == 24",
"assert candidate(grid=[[0, 0, 1, 0, 0], [0, 1, 1, 1, 0], [1, 1, 1, 1, 1], [0, 1, 1, 1, 0], [0, 0, 1, 0, 0], [0, 0, 0, 0, 0], [0, 0, 1, 0, 0], [0, 1, 1... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(grid=[[1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1]]) == 24",
"assert candidate(grid=[[0, 0, 1, 0, 0], [0, 1, 1, 1, 0], [1, 1, 1, 1, 1], [0, 1, 1, 1, 0], [0, 0, 1, 0, 0], [0, 0, 0, 0, 0], [0... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed array nums of n integers, and an integer k.\nThe... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given a 0-indexed array nums of n integers, and an integer k.
The k-radius average for a subarray of nums cente... | [
"assert candidate(nums=[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39], k=5) == [-1, -1, -1, -1, -1, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, -1, -1, -1, -1, -1]",
"assert candidate(nums=[100, 200, 300, 400, 500, 600, 700, 800, 900, 1000], k=5) == [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39], k=5) == [-1, -1, -1, -1, -1, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, -1, -1, -1, -1, -1]",
"assert candidate(nums=[100, 200, 300, 400, 500, 600, 700, 800, 900, 1000], k=5) == [-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 a 0-indexed array of distinct integers nums.\nThere is an el... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given a 0-indexed array of distinct integers nums.
There is an element in nums that has the lowest value and an... | [
"assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9]) == 2",
"assert candidate(nums=[10, 2, 8, 6, 7, 3, 5, 1, 9, 4]) == 4",
"assert candidate(nums=[3, 7, 1, 9, 5, 2, 8, 4, 6]) == 4",
"assert candidate(nums=[0, -4, 19, 1, 8, -2, -3, 5]) == 3",
"assert candidate(nums=[10, 9, 8, 7, 6, 5, 4, 3, 2, 1]) == 2",
"a... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9]) == 2",
"assert candidate(nums=[10, 2, 8, 6, 7, 3, 5, 1, 9, 4]) == 4",
"assert candidate(nums=[3, 7, 1, 9, 5, 2, 8, 4, 6]) == 4",
"assert candidate(nums=[0, -4, 19, 1, 8, -2, -3, 5]) == 3",
"assert candidate(nums=[10, 9, 8, 7, 6... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an integer n indicating there are n people numbered from 0 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 an integer n indicating there are n people numbered from 0 to n - 1. You are also given a 0-indexed 2D in... | [
"assert candidate(n=5, meetings=[[3, 4, 2], [1, 2, 1], [2, 3, 1]], firstPerson=1) == [0, 1, 2, 3, 4]",
"assert candidate(n=10, meetings=[[0, 4, 5], [4, 5, 5], [0, 1, 6], [1, 2, 6], [2, 3, 7], [3, 4, 7], [4, 6, 8], [5, 7, 9], [6, 8, 10], [7, 9, 11]], firstPerson=4) == [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]",
"assert can... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(n=5, meetings=[[3, 4, 2], [1, 2, 1], [2, 3, 1]], firstPerson=1) == [0, 1, 2, 3, 4]",
"assert candidate(n=10, meetings=[[0, 4, 5], [4, 5, 5], [0, 1, 6], [1, 2, 6], [2, 3, 7], [3, 4, 7], [4, 6, 8], [5, 7, 9], [6, 8, 10], [7, 9, 11]], firstPerson=4) == [0, 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:\nA series of highways connect n cities numbered from 0 to n - 1. You are gi... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
A series of highways connect n cities numbered from 0 to n - 1. You are given a 2D integer array highways where highway... | [
"assert candidate(n=9, highways=[[0, 1, 8], [0, 2, 6], [0, 3, 10], [1, 2, 4], [1, 3, 12], [1, 4, 14], [2, 4, 5], [2, 5, 7], [3, 4, 9], [3, 5, 11], [3, 6, 13], [4, 5, 3], [4, 6, 15], [4, 7, 17], [5, 6, 6], [5, 7, 8], [5, 8, 10], [6, 7, 2], [6, 8, 4], [7, 8, 1]], discounts=6) == 10",
"assert candidate(n=12, highway... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(n=9, highways=[[0, 1, 8], [0, 2, 6], [0, 3, 10], [1, 2, 4], [1, 3, 12], [1, 4, 14], [2, 4, 5], [2, 5, 7], [3, 4, 9], [3, 5, 11], [3, 6, 13], [4, 5, 3], [4, 6, 15], [4, 7, 17], [5, 6, 6], [5, 7, 8], [5, 8, 10], [6, 7, 2], [6, 8, 4], [7, 8, 1]], discounts=6) == 10",
"assert ... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given the root of a binary tree with n nodes. Each node is uniquel... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given the root of a binary tree with n nodes. Each node is uniquely assigned a value from 1 to n. You are also ... | [
"assert candidate(root=tree_node([5, 1, 2, 3, 6, None, 4, 7, 8, None, None, 9, 10, None, None, 11, 12, None, None, 13, 14, None, None, 15, 16]), startValue=7, destValue=16) == 'URRR'",
"assert candidate(root=tree_node([1, 2]), startValue=2, destValue=1) == 'U'",
"assert candidate(root=tree_node([100, 50, 150, 2... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(root=tree_node([5, 1, 2, 3, 6, None, 4, 7, 8, None, None, 9, 10, None, None, 11, 12, None, None, 13, 14, None, None, 15, 16]), startValue=7, destValue=16) == 'URRR'",
"assert candidate(root=tree_node([1, 2]), startValue=2, destValue=1) == 'U'",
"assert candidate(root=t... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed 2D integer array pairs where pairs[i] = [starti,... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given a 0-indexed 2D integer array pairs where pairs[i] = [starti, endi]. An arrangement of pairs is valid if f... | [
"assert candidate(pairs=[[1, 2], [2, 3], [3, 1], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 4]]) == [[1, 2], [2, 3], [3, 1]]",
"assert candidate(pairs=[[1, 2], [2, 3], [3, 4], [4, 5], [5, 1], [1, 3], [3, 5], [5, 2], [2, 4], [4, 1]]) == [[1, 3], [3, 5], [5, 2], [2, 4], [4, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(pairs=[[1, 2], [2, 3], [3, 1], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 4]]) == [[1, 2], [2, 3], [3, 1]]",
"assert candidate(pairs=[[1, 2], [2, 3], [3, 4], [4, 5], [5, 1], [1, 3], [3, 5], [5, 2], [2, 4], [4, 1]]) == [[1, 3], [3, 5], [5, 2], [2, 4], [4, 1], [1, 2], [2, 3... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an integer array nums and an integer k. Find the largest eve... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given an integer array nums and an integer k. Find the largest even sum of any subsequence of nums that has a l... | [
"assert candidate(nums=[10, 21, 32, 43, 54, 65, 76, 87, 98, 109], k=4) == 370",
"assert candidate(nums=[100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80], k=10) == 954",
"assert candidate(nums=[1, 3, 5], k=1) == -1",
"assert candidate(nums=[15, 15, 15, 15, 15, 15, 15, 15, 15... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[10, 21, 32, 43, 54, 65, 76, 87, 98, 109], k=4) == 370",
"assert candidate(nums=[100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80], k=10) == 954",
"assert candidate(nums=[1, 3, 5], k=1) == -1",
"assert candidate(nums=[15, 15,... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou and a gang of thieves are planning on robbing a bank. You are given a ... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You and a gang of thieves are planning on robbing a bank. You are given a 0-indexed integer array security, where secur... | [
"assert candidate(security=[2, 2, 2, 2, 2, 2, 2, 2, 2, 2], time=2) == [2, 3, 4, 5, 6, 7]",
"assert candidate(security=[5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9], time=3) == [5]",
"assert candidate(security=[9, 8, 7, 6, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 2, 1], time=4) == [4]",
"assert candidate(security=[1, ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(security=[2, 2, 2, 2, 2, 2, 2, 2, 2, 2], time=2) == [2, 3, 4, 5, 6, 7]",
"assert candidate(security=[5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9], time=3) == [5]",
"assert candidate(security=[9, 8, 7, 6, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 2, 1], time=4) == [4]",
"ass... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a list of bombs. The range of a bomb is defined as the area ... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given a list of bombs. The range of a bomb is defined as the area where its effect can be felt. This area is in... | [
"assert candidate(bombs=[[1, 1, 5], [1, 6, 5], [6, 1, 5], [6, 6, 5], [3, 3, 1]]) == 5",
"assert candidate(bombs=[[50, 50, 15], [60, 50, 20], [70, 50, 10], [50, 60, 25], [50, 70, 12], [50, 80, 5]]) == 6",
"assert candidate(bombs=[[0, 0, 10], [20, 20, 10], [10, 10, 15], [30, 30, 20]]) == 3",
"assert candidate(b... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(bombs=[[1, 1, 5], [1, 6, 5], [6, 1, 5], [6, 6, 5], [3, 3, 1]]) == 5",
"assert candidate(bombs=[[50, 50, 15], [60, 50, 20], [70, 50, 10], [50, 60, 25], [50, 70, 12], [50, 80, 5]]) == 6",
"assert candidate(bombs=[[0, 0, 10], [20, 20, 10], [10, 10, 15], [30, 30, 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:\nYou are given an integer array nums. The range of a subarray of nums is th... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given an integer array nums. The range of a subarray of nums is the difference between the largest and smallest... | [
"assert candidate(nums=[100, 100, 100, 100]) == 0",
"assert candidate(nums=[1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2]) == 190",
"assert candidate(nums=[15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]) == 560",
"assert candidate(nums=[-1, 0, 1, -1, 0, 1, -1, 0, 1]) == 66",
"assert candid... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[100, 100, 100, 100]) == 0",
"assert candidate(nums=[1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2]) == 190",
"assert candidate(nums=[15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]) == 560",
"assert candidate(nums=[-1, 0, 1, -1, 0, 1, -1, 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:\nAlice and Bob want to water n plants in their garden. The plants are arran... | You are an expert Python programmer. 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 want to water n plants in their garden. The plants are arranged in a row and are labeled from 0 to n - 1 ... | [
"assert candidate(plants=[1, 10, 1, 10, 1, 10, 1, 10], capacityA=10, capacityB=10) == 6",
"assert candidate(plants=[5, 8, 6, 7, 5, 4, 3, 2, 1, 9], capacityA=10, capacityB=8) == 7",
"assert candidate(plants=[10, 5, 15, 20, 25, 30, 35, 40, 45, 50], capacityA=25, capacityB=30) == 8",
"assert candidate(plants=[8,... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(plants=[1, 10, 1, 10, 1, 10, 1, 10], capacityA=10, capacityB=10) == 6",
"assert candidate(plants=[5, 8, 6, 7, 5, 4, 3, 2, 1, 9], capacityA=10, capacityB=8) == 7",
"assert candidate(plants=[10, 5, 15, 20, 25, 30, 35, 40, 45, 50], capacityA=25, capacityB=30) == 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:\nFruits are available at some positions on an infinite x-axis. You are give... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
Fruits are available at some positions on an infinite x-axis. You are given a 2D integer array fruits where fruits[i] =... | [
"assert candidate(fruits=[[1, 100], [5, 200], [10, 300], [15, 400], [20, 500]], startPos=10, k=18) == 1200",
"assert candidate(fruits=[[1, 5], [10, 10], [20, 15], [30, 20], [40, 25], [50, 30]], startPos=25, k=20) == 45",
"assert candidate(fruits=[[1, 1000], [5, 1000], [10, 1000], [15, 1000], [20, 1000], [25, 10... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(fruits=[[1, 100], [5, 200], [10, 300], [15, 400], [20, 500]], startPos=10, k=18) == 1200",
"assert candidate(fruits=[[1, 5], [10, 10], [20, 15], [30, 20], [40, 25], [50, 30]], startPos=25, k=20) == 45",
"assert candidate(fruits=[[1, 1000], [5, 1000], [10, 1000], [15, 1... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed integer array candies, where candies[i] represen... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given a 0-indexed integer array candies, where candies[i] represents the flavor of the ith candy. Your mom want... | [
"assert candidate(candies=[1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10], k=7) == 7",
"assert candidate(candies=[2, 4, 5], k=0) == 3",
"assert candidate(candies=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], k=20) == 10",
"assert candidate(candie... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(candies=[1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10], k=7) == 7",
"assert candidate(candies=[2, 4, 5], k=0) == 3",
"assert candidate(candies=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], k=20) == 10",
... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed string s and a 0-indexed integer array spaces th... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given a 0-indexed string s and a 0-indexed integer array spaces that describes the indices in the original stri... | [
"assert candidate(s='SoftwareEngineering', spaces=[8, 21]) == 'Software Engineering'",
"assert candidate(s='MultipleWords', spaces=[5, 13]) == 'Multi pleWords'",
"assert candidate(s='LeetcodeHelpsMeLearn', spaces=[8, 13, 15]) == 'Leetcode Helps Me Learn'",
"assert candidate(s='CloudComputing', spaces=[5, 15])... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(s='SoftwareEngineering', spaces=[8, 21]) == 'Software Engineering'",
"assert candidate(s='MultipleWords', spaces=[5, 13]) == 'Multi pleWords'",
"assert candidate(s='LeetcodeHelpsMeLearn', spaces=[8, 13, 15]) == 'Leetcode Helps Me Learn'",
"assert candidate(s='Cloud... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an integer array prices representing the daily price history... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given an integer array prices representing the daily price history of a stock, where prices[i] is the stock pri... | [
"assert candidate(prices=[5, 4, 3, 2, 1]) == 15",
"assert candidate(prices=[7, 6, 5, 4, 3, 2, 1, 8, 7, 6, 5, 4, 3, 2, 1, 9, 8, 7, 6, 5, 4, 3, 2, 1]) == 109",
"assert candidate(prices=[100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69,... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(prices=[5, 4, 3, 2, 1]) == 15",
"assert candidate(prices=[7, 6, 5, 4, 3, 2, 1, 8, 7, 6, 5, 4, 3, 2, 1, 9, 8, 7, 6, 5, 4, 3, 2, 1]) == 109",
"assert candidate(prices=[100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.