prompt listlengths 1 1 | query stringlengths 578 3.33k | constraints listlengths 10 10 | data_source stringclasses 1
value | extra_info dict |
|---|---|---|---|---|
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven an array of integers arr and an integer k. Find the least number 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 integers arr and an integer k. Find the least number of unique integers after removing exactly k elem... | [
"assert candidate(arr=[1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4], k=5) == 2",
"assert candidate(arr=[5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5], k=10) == 1",
"assert candidate(arr=[7, 7, 7, 7, 8, 8, 8, 9, 9, 10, 10, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 13], k=10) == 3",... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(arr=[1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4], k=5) == 2",
"assert candidate(arr=[5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5], k=10) == 1",
"assert candidate(arr=[7, 7, 7, 7, 8, 8, 8, 9, 9, 10, 10, 11, 11, 11, 12, 12, 12, 12, 13, 13, ... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 bloomDay, an integer m and an integer k.\nY... | You are an expert Python programmer. 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 bloomDay, an integer m and an integer k.
You want to make m bouquets. To make a bouquet,... | [
"assert candidate(bloomDay=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], m=10, k=2) == 1",
"assert candidate(bloomDay=[20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1], m=5, k=4) == 20",
"assert candidate(bloomDay=[10, 1, 10, 1, 10, 1, 10, 1, 10, 1], m=4, k=2) == 10",
"as... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(bloomDay=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], m=10, k=2) == 1",
"assert candidate(bloomDay=[20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1], m=5, k=4) == 20",
"assert candidate(bloomDay=[10, 1, 10, 1, 10, 1, 10, 1, 10, 1]... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven an array of strings names of size n. You will create n folders in yo... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
Given an array of strings names of size n. You will create n folders in your file system such that, at the ith minute, ... | [
"assert candidate(names=['report', 'report', 'report(1)', 'report(2)', 'report', 'report(1)', 'report', 'report(1)(1)', 'report(3)', 'report(4)', 'report(2)(2)', 'report(5)', 'report(2)', 'report(6)', 'report(7)']) == ['report', 'report(1)', 'report(1)(1)', 'report(2)', 'report(3)', 'report(1)(2)', 'report(4)', 're... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(names=['report', 'report', 'report(1)', 'report(2)', 'report', 'report(1)', 'report', 'report(1)(1)', 'report(3)', 'report(4)', 'report(2)(2)', 'report(5)', 'report(2)', 'report(6)', 'report(7)']) == ['report', 'report(1)', 'report(1)(1)', 'report(2)', 'report(3)', 'report(1)(... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given two positive integers n and k. A factor of an integer n is d... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given two positive integers n and k. A factor of an integer n is defined as an integer i where n % i == 0.
Cons... | [
"assert candidate(n=72, k=9) == 18",
"assert candidate(n=97, k=2) == 97",
"assert candidate(n=225, k=8) == 75",
"assert candidate(n=500, k=8) == 50",
"assert candidate(n=225, k=5) == 15",
"assert candidate(n=64, k=7) == 64",
"assert candidate(n=256, k=7) == 64",
"assert candidate(n=15, k=3) == 5",
"... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(n=72, k=9) == 18",
"assert candidate(n=97, k=2) == 97",
"assert candidate(n=225, k=8) == 75",
"assert candidate(n=500, k=8) == 50",
"assert candidate(n=225, k=5) == 15",
"assert candidate(n=64, k=7) == 64",
"assert candidate(n=256, k=7) == 64",
"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 a binary array nums, you should delete one element from it.\nReturn ... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
Given a binary array nums, you should delete one element from it.
Return the size of the longest non-empty subarray con... | [
"assert candidate(nums=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0]) == 20",
"assert candidate(nums=[0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1]) == 3",
"assert candidate(nums=[1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0... | 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, 0]) == 20",
"assert candidate(nums=[0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1]) == 3",
"assert candidate(nums=[1, 0, 1, 0, 1, 0, 1, 0, 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:\nYou are given an integer n, which indicates that there are n courses label... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given an integer n, which indicates that there are n courses labeled from 1 to n. You are also given an array r... | [
"assert candidate(n=10, relations=[[1, 5], [1, 6], [2, 5], [2, 6], [3, 7], [3, 8], [4, 9], [4, 10], [5, 10], [6, 10], [7, 10], [8, 10]], k=3) == 4",
"assert candidate(n=15, relations=[[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]], k=3) =... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(n=10, relations=[[1, 5], [1, 6], [2, 5], [2, 6], [3, 7], [3, 8], [4, 9], [4, 10], [5, 10], [6, 10], [7, 10], [8, 10]], k=3) == 4",
"assert candidate(n=15, relations=[[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,... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven an array of integers arr of even length n and an integer k.\nWe want... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
Given an array of integers arr of even length n and an integer k.
We want to divide the array into exactly n / 2 pairs ... | [
"assert candidate(arr=[-1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15, -16], k=5) == False",
"assert candidate(arr=[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23], k=4) == True",
"assert candidate(arr=[0, 0, 0, 0], k=3) == True",
"assert candidate(arr=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100], k... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(arr=[-1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15, -16], k=5) == False",
"assert candidate(arr=[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23], k=4) == True",
"assert candidate(arr=[0, 0, 0, 0], k=3) == True",
"assert candidate(arr=[10, 20, 30, 40, ... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an array of integers nums and an integer target.\nReturn the... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given an array of integers nums and an integer target.
Return the number of non-empty subsequences of nums such... | [
"assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], target=15) == 1002",
"assert candidate(nums=[10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10], target=20) == 1048575",
"assert candidate(nums=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], target=2) == 1048575"... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], target=15) == 1002",
"assert candidate(nums=[10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10], target=20) == 1048575",
"assert candidate(nums=[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:\nYou are given an array points containing the coordinates of points on a 2D... | You are an expert Python programmer. 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 points containing the coordinates of points on a 2D plane, sorted by the x-values, where points[... | [
"assert candidate(points=[[1, 5], [4, 3], [6, 7], [8, 2], [10, 8]], k=5) == 19",
"assert candidate(points=[[1, 3], [5, 10], [8, 15], [10, 7], [12, 20], [16, 5], [20, 25]], k=10) == 53",
"assert candidate(points=[[-1, 1], [0, 0], [1, -1], [2, 2], [3, -3], [4, 4], [5, -5], [6, 6]], k=2) == 12",
"assert candidat... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(points=[[1, 5], [4, 3], [6, 7], [8, 2], [10, 8]], k=5) == 19",
"assert candidate(points=[[1, 3], [5, 10], [8, 15], [10, 7], [12, 20], [16, 5], [20, 25]], k=10) == 53",
"assert candidate(points=[[-1, 1], [0, 0], [1, -1], [2, 2], [3, -3], [4, 4], [5, -5], [6, 6]], k=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:\nWe have a wooden plank of the length n units. Some ants are walking on 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:
We have a wooden plank of the length n units. Some ants are walking on the plank, each ant moves with a speed of 1 unit... | [
"assert candidate(n=8000, left=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100], right=[7900, 7910, 7920, 7930, 7940, 7950, 7960, 7970, 7980, 7990]) == 100",
"assert candidate(n=15000, left=[], right=[0, 3000, 6000, 9000, 12000, 15000]) == 15000",
"assert candidate(n=10000, left=[500, 1000, 1500, 2000, 2500, 3000, 350... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(n=8000, left=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100], right=[7900, 7910, 7920, 7930, 7940, 7950, 7960, 7970, 7980, 7990]) == 100",
"assert candidate(n=15000, left=[], right=[0, 3000, 6000, 9000, 12000, 15000]) == 15000",
"assert candidate(n=10000, left=[500, 1000, 15... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a string num representing the digits of a very large integer... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given a string num representing the digits of a very large integer and an integer k. You are allowed to swap an... | [
"assert candidate(num='198765432', k=20) == '123479865'",
"assert candidate(num='99999999999999999999', k=1000) == '99999999999999999999'",
"assert candidate(num='59585756555453525150', k=100) == '01234555555556987555'",
"assert candidate(num='9876543210123456789098765432101234567890', k=300) == '000011112222... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(num='198765432', k=20) == '123479865'",
"assert candidate(num='99999999999999999999', k=1000) == '99999999999999999999'",
"assert candidate(num='59585756555453525150', k=100) == '01234555555556987555'",
"assert candidate(num='987654321012345678909876543210123456789... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 array nums consisting of n positive integers. You comput... | You are an expert Python programmer. 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 array nums consisting of n positive integers. You computed the sum of all non-empty continuous subarr... | [
"assert candidate(nums=[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29], n=15, left=50, right=100) == 5098",
"assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], n=20, left=150, right=250) == 9201",
"assert candidate(nums=[7, 14, 21, 28, 35, 42, 49, 56, 63, 70, ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29], n=15, left=50, right=100) == 5098",
"assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], n=20, left=150, right=250) == 9201",
"assert candidate(nums=[7, 14, 21, 28,... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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.\nIn one move, you can choose one elem... | You are an expert Python programmer. 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 move, you can choose one element of nums and change it to any value.
Return... | [
"assert candidate(nums=[5, 3, 2, 4, 1, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]) == 11",
"assert candidate(nums=[1]) == 0",
"assert candidate(nums=[100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500]) == 1100",
"assert candidate(nums=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[5, 3, 2, 4, 1, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]) == 11",
"assert candidate(nums=[1]) == 0",
"assert candidate(nums=[100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500]) == 1100",
"assert candidate(nums=[10, 20, 30, 40, 50, 60, ... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven a binary string s, return the number of substrings with all characte... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
Given a binary string s, return the number of substrings with all characters 1's. Since the answer may be too large, re... | [
"assert candidate(s='11111111111111111111') == 210",
"assert candidate(s='111100001111') == 20",
"assert candidate(s='1111101111') == 25",
"assert candidate(s='0101010101010101010101010101010101010101010101010101010101010101010101010101010101') == 41",
"assert candidate(s='110110110110110') == 15",
"asser... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(s='11111111111111111111') == 210",
"assert candidate(s='111100001111') == 20",
"assert candidate(s='1111101111') == 25",
"assert candidate(s='0101010101010101010101010101010101010101010101010101010101010101010101010101010101') == 41",
"assert candidate(s='11011... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 undirected weighted graph of n nodes (0-indexed), represe... | You are an expert Python programmer. 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 undirected weighted graph of n nodes (0-indexed), represented by an edge list where edges[i] = [a, b] ... | [
"assert candidate(n=7, edges=[[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [0, 6], [1, 3], [2, 4], [3, 5]], succProb=[0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.01], start_node=0, end_node=6) == 0.7",
"assert candidate(n=6, edges=[[0, 1], [1, 2], [2, 3], [3, 4], [4, 5]], succProb=[0.1, 0.2, 0.3, 0.4, 0.5],... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(n=7, edges=[[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [0, 6], [1, 3], [2, 4], [3, 5]], succProb=[0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.01], start_node=0, end_node=6) == 0.7",
"assert candidate(n=6, edges=[[0, 1], [1, 2], [2, 3], [3, 4], [4, 5]], succProb=[0.... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nA delivery company wants to build a new service center in a new city. 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:
A delivery company wants to build a new service center in a new city. The company knows the positions of all the custom... | [
"assert candidate(positions=[[5, 5], [5, 10], [5, 15], [10, 5], [10, 10], [10, 15], [15, 5], [15, 10], [15, 15], [20, 20], [20, 30], [30, 20], [30, 30]]) == 129.78753195123062",
"assert candidate(positions=[[2, 2], [2, 3], [3, 2], [3, 3]]) == 2.8284271247461903",
"assert candidate(positions=[[1, 1], [2, 2], [3,... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(positions=[[5, 5], [5, 10], [5, 15], [10, 5], [10, 10], [10, 15], [15, 5], [15, 10], [15, 15], [20, 20], [20, 30], [30, 20], [30, 30]]) == 129.78753195123062",
"assert candidate(positions=[[2, 2], [2, 3], [3, 2], [3, 3]]) == 2.8284271247461903",
"assert candidate(posit... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 tree (i.e. a connected, undirected graph that has no cycle... | You are an expert Python programmer. 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 tree (i.e. a connected, undirected graph that has no cycles) consisting of n nodes numbered from 0 to n... | [
"assert candidate(n=15, edges=[[0, 1], [0, 2], [0, 3], [1, 4], [1, 5], [2, 6], [2, 7], [3, 8], [3, 9], [4, 10], [4, 11], [5, 12], [5, 13], [6, 14]], labels='abcabcabcabcabc') == [5, 4, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]",
"assert candidate(n=30, edges=[[0, 1], [0, 2], [1, 3], [1, 4], [2, 5], [2, 6], [3, 7], [... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(n=15, edges=[[0, 1], [0, 2], [0, 3], [1, 4], [1, 5], [2, 6], [2, 7], [3, 8], [3, 9], [4, 10], [4, 11], [5, 12], [5, 13], [6, 14]], labels='abcabcabcabcabc') == [5, 4, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]",
"assert candidate(n=30, edges=[[0, 1], [0, 2], [1, 3], [1, 4], [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:\n\nWinston was given the above mysterious function func. He has an integer ... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
Winston was given the above mysterious function func. He has an integer array arr and an integer target and he wants t... | [
"assert candidate(arr=[31, 15, 7, 3, 1, 1, 3, 7, 15, 31, 15, 7, 3, 1, 1, 3, 7, 15, 31, 15, 7, 3, 1, 1, 3, 7, 15, 31, 15, 7, 3, 1], target=10) == 3",
"assert candidate(arr=[1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10], target=5) == 0",
"assert candidate(arr=[1, 2, 4, 8, 16, 32, 64, 128, 256, 512... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(arr=[31, 15, 7, 3, 1, 1, 3, 7, 15, 31, 15, 7, 3, 1, 1, 3, 7, 15, 31, 15, 7, 3, 1, 1, 3, 7, 15, 31, 15, 7, 3, 1], target=10) == 3",
"assert candidate(arr=[1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10], target=5) == 0",
"assert candidate(arr=[1, 2, 4, 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:\nGiven an array of integers arr, return the number of subarrays with an odd... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
Given an array of integers arr, return the number of subarrays with an odd sum.
Since the answer can be very large, ret... | [
"assert candidate(arr=[100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1]) == 110",
"assert candidate(arr=[99, 98, 97, 96, 95, 94, 93, 92, 91, 90]) == 30",
"assert candidate(arr=[100, 1, 100, 1, 100, 1, 100, 1, 100, 1]) == 30",
"assert candidate(arr=[99, 100, 101]) == 4",
"asser... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(arr=[100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1]) == 110",
"assert candidate(arr=[99, 98, 97, 96, 95, 94, 93, 92, 91, 90]) == 30",
"assert candidate(arr=[100, 1, 100, 1, 100, 1, 100, 1, 100, 1]) == 30",
"assert candidate(arr=[99,... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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.\nA split is called good if you can split s into ... | You are an expert Python programmer. 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.
A split is called good if you can split s into two non-empty strings sleft and sright where t... | [
"assert candidate(s='abcdabcdabcdabcdabcdabcdabcdabcd') == 25",
"assert candidate(s='aabbbcc') == 2",
"assert candidate(s='abacabadabacaba') == 0",
"assert candidate(s='aabbccddeeff') == 1",
"assert candidate(s='aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzzzzzzzzzzzzzzzzzzzzzzzzz') == 1",
"assert ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(s='abcdabcdabcdabcdabcdabcdabcdabcd') == 25",
"assert candidate(s='aabbbcc') == 2",
"assert candidate(s='abacabadabacaba') == 0",
"assert candidate(s='aabbccddeeff') == 1",
"assert candidate(s='aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzzzzzzzzzzzzzzzz... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an integer array target. You have an integer array initial 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 integer array target. You have an integer array initial of the same size as target with all elements i... | [
"assert candidate(target=[1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1]) == 11",
"assert candidate(target=[1, 10, 2, 9, 3, 8, 4, 7, 5, 6, 5, 6, 4, 7, 3, 8, 2, 9, 1, 10]) == 51",
"assert candidate(target=[100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(target=[1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1]) == 11",
"assert candidate(target=[1, 10, 2, 9, 3, 8, 4, 7, 5, 6, 5, 6, 4, 7, 3, 8, 2, 9, 1, 10]) == 51",
"assert candidate(target=[100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 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:\nRun-length encoding is a string compression method that works by replacing... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
Run-length encoding is a string compression method that works by replacing consecutive identical characters (repeated 2... | [
"assert candidate(s='abababababababababababababab', k=10) == 10",
"assert candidate(s='abcdabcdabcd', k=6) == 5",
"assert candidate(s='aaabbbcccddddeeefffggghhhiiijjjkkklllmmmnnnooopppqqqrrrssstttuuuvvvwwwww', k=30) == 26",
"assert candidate(s='abacabadabacaba', k=5) == 6",
"assert candidate(s='aaaaaaaaaabb... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(s='abababababababababababababab', k=10) == 10",
"assert candidate(s='abcdabcdabcd', k=6) == 5",
"assert candidate(s='aaabbbcccddddeeefffggghhhiiijjjkkklllmmmnnnooopppqqqrrrssstttuuuvvvwwwww', k=30) == 26",
"assert candidate(s='abacabadabacaba', k=5) == 6",
"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 an integer array arr of distinct integers and an integer k.\nA game ... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
Given an integer array arr of distinct integers and an integer k.
A game will be played between the first two elements ... | [
"assert candidate(arr=[7, 10, 5, 3, 8], k=3) == 10",
"assert candidate(arr=[999999, 999998, 999997, 999996, 999995, 999994, 999993, 999992, 999991, 999990], k=7) == 999999",
"assert candidate(arr=[1, 25, 3, 4, 5, 6, 7, 8, 9, 10], k=4) == 25",
"assert candidate(arr=[1, 2, 3, 4, 5], k=1) == 2",
"assert candid... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(arr=[7, 10, 5, 3, 8], k=3) == 10",
"assert candidate(arr=[999999, 999998, 999997, 999996, 999995, 999994, 999993, 999992, 999991, 999990], k=7) == 999999",
"assert candidate(arr=[1, 25, 3, 4, 5, 6, 7, 8, 9, 10], k=4) == 25",
"assert candidate(arr=[1, 2, 3, 4, 5], k... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven an n x n binary grid, in one step you can choose two adjacent rows o... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
Given an n x n binary grid, in one step you can choose two adjacent rows of the grid and swap them.
A grid is said to b... | [
"assert candidate(grid=[[0, 1, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0], [0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0]]) == 6",
"assert candidate(grid=[[1, 1, 1, 1, 1, 1, 1, 1], [0, 1, 1, 1, 1, 1, 1, 1], [0, 0, 1, 1, 1, 1, 1, 1], [0, 0, 0, 1, 1, 1, ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(grid=[[0, 1, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0], [0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0]]) == 6",
"assert candidate(grid=[[1, 1, 1, 1, 1, 1, 1, 1], [0, 1, 1, 1, 1, 1, 1, 1], [0, 0, 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:\nGiven a parentheses string s containing only the characters '(' and ')'. A... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
Given a parentheses string s containing only the characters '(' and ')'. A parentheses string is balanced if:
Any left... | [
"assert candidate(s='))())(') == 3",
"assert candidate(s='(()))(()))(()))') == 3",
"assert candidate(s='(()))(()(()(())))()()(()(()(()))))(()))(()))') == 16",
"assert candidate(s='(()))(()))(()))(()))(()))(()))(()))(()))') == 8",
"assert candidate(s='(()))(()(()(()))())') == 8",
"assert candidate(s='(()((... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(s='))())(') == 3",
"assert candidate(s='(()))(()))(()))') == 3",
"assert candidate(s='(()))(()(()(())))()()(()(()(()))))(()))(()))') == 16",
"assert candidate(s='(()))(()))(()))(()))(()))(()))(()))(()))') == 8",
"assert candidate(s='(()))(()(()(()))())') == 8",... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a string s. An awesome substring is a non-empty substring of... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given a string s. An awesome substring is a non-empty substring of s such that we can make any number of swaps ... | [
"assert candidate(s='111222333444555666') == 7",
"assert candidate(s='1111111') == 7",
"assert candidate(s='2468024680246802468') == 19",
"assert candidate(s='1232112321') == 10",
"assert candidate(s='1234321987897898765456543213212345654321234321') == 27",
"assert candidate(s='999988887777666655554444333... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(s='111222333444555666') == 7",
"assert candidate(s='1111111') == 7",
"assert candidate(s='2468024680246802468') == 19",
"assert candidate(s='1232112321') == 10",
"assert candidate(s='1234321987897898765456543213212345654321234321') == 27",
"assert candidate... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven two positive integers n and k, the binary string Sn is formed as fol... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
Given two positive integers n and k, the binary string Sn is formed as follows:
S1 = "0"
Si = Si - 1 + "1" + reverse(i... | [
"assert candidate(n=10, k=1023) == '1'",
"assert candidate(n=7, k=40) == '1'",
"assert candidate(n=9, k=255) == '1'",
"assert candidate(n=13, k=8192) == '1'",
"assert candidate(n=18, k=262143) == '1'",
"assert candidate(n=17, k=32767) == '1'",
"assert candidate(n=3, k=5) == '0'",
"assert candidate(n=1... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(n=10, k=1023) == '1'",
"assert candidate(n=7, k=40) == '1'",
"assert candidate(n=9, k=255) == '1'",
"assert candidate(n=13, k=8192) == '1'",
"assert candidate(n=18, k=262143) == '1'",
"assert candidate(n=17, k=32767) == '1'",
"assert candidate(n=3, k=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:\nWe have n cities and m bi-directional roads where roads[i] = [ai, bi] conn... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
We have n cities and m bi-directional roads where roads[i] = [ai, bi] connects city ai with city bi. Each city has a na... | [
"assert candidate(n=10, roads=[[0, 1], [0, 2], [1, 3], [1, 4], [2, 5], [2, 6], [3, 7], [4, 8], [5, 9], [6, 7], [7, 8], [8, 9]], names=['LAX', 'HOU', 'ATL', 'DFW', 'DEN', 'PHX', 'SEA', 'ORD', 'SLC', 'JFK'], targetPath=['ATL', 'DFW', 'DEN', 'PHX', 'SEA', 'ORD', 'SLC', 'JFK', 'HOU', 'LAX']) == [0, 1, 4, 1, 3, 7, 8, 4,... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(n=10, roads=[[0, 1], [0, 2], [1, 3], [1, 4], [2, 5], [2, 6], [3, 7], [4, 8], [5, 9], [6, 7], [7, 8], [8, 9]], names=['LAX', 'HOU', 'ATL', 'DFW', 'DEN', 'PHX', 'SEA', 'ORD', 'SLC', 'JFK'], targetPath=['ATL', 'DFW', 'DEN', 'PHX', 'SEA', 'ORD', 'SLC', 'JFK', 'HOU', 'LAX']) == [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 have an array arr of length n where arr[i] = (2 * i) + 1 for all valid... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You have an array arr of length n where arr[i] = (2 * i) + 1 for all valid values of i (i.e., 0 <= i < n).
In one opera... | [
"assert candidate(n=7500) == 14062500",
"assert candidate(n=1200) == 360000",
"assert candidate(n=6667) == 11112222",
"assert candidate(n=5) == 6",
"assert candidate(n=5001) == 6252500",
"assert candidate(n=50) == 625",
"assert candidate(n=7000) == 12250000",
"assert candidate(n=200) == 10000",
"ass... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(n=7500) == 14062500",
"assert candidate(n=1200) == 360000",
"assert candidate(n=6667) == 11112222",
"assert candidate(n=5) == 6",
"assert candidate(n=5001) == 6252500",
"assert candidate(n=50) == 625",
"assert candidate(n=7000) == 12250000",
"assert... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven a list of strings dict where all the strings are of the same length.... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
Given a list of strings dict where all the strings are of the same length.
Return true if there are 2 strings that only... | [
"assert candidate(dict=['same', 'sane', 'scan', 'sack', 'seam']) == True",
"assert candidate(dict=['aabbccdd', 'aabbccde', 'aabbccee', 'aabbccff']) == True",
"assert candidate(dict=['pneumonoultramicroscopicsilicovolcanoconiosis', 'pneumonoultramicroscopicsilicovolcanoconiosi', 'pneumonoultramicroscopicsilicovo... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(dict=['same', 'sane', 'scan', 'sack', 'seam']) == True",
"assert candidate(dict=['aabbccdd', 'aabbccde', 'aabbccee', 'aabbccff']) == True",
"assert candidate(dict=['pneumonoultramicroscopicsilicovolcanoconiosis', 'pneumonoultramicroscopicsilicovolcanoconiosi', 'pneumon... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 directed acyclic graph, with n vertices numbered from 0 to n-1, an... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
Given a directed acyclic graph, with n vertices numbered from 0 to n-1, and an array edges where edges[i] = [fromi, toi... | [
"assert candidate(n=18, edges=[[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10], [10, 11], [11, 12], [12, 13], [13, 14], [14, 15], [15, 16], [16, 17]]) == [0]",
"assert candidate(n=12, edges=[[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10], [10, 11], ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(n=18, edges=[[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10], [10, 11], [11, 12], [12, 13], [13, 14], [14, 15], [15, 16], [16, 17]]) == [0]",
"assert candidate(n=12, edges=[[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [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. You have an integer array arr of the ... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given an integer array nums. You have an integer array arr of the same length with all values set to 0 initiall... | [
"assert candidate(nums=[63, 127, 255, 511, 1023]) == 49",
"assert candidate(nums=[5, 10, 15, 20, 25, 30]) == 21",
"assert candidate(nums=[256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144]) == 29",
"assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]) == 37",
"a... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[63, 127, 255, 511, 1023]) == 49",
"assert candidate(nums=[5, 10, 15, 20, 25, 30]) == 21",
"assert candidate(nums=[256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144]) == 29",
"assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 3n piles of coins of varying size, you and your friends will tak... | You are an expert Python programmer. 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 3n piles of coins of varying size, you and your friends will take piles of coins as follows:
In each step, y... | [
"assert candidate(piles=[1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 10000, 11000, 12000, 13000, 14000, 15000]) == 50000",
"assert candidate(piles=[3333, 3332, 3331, 3330, 3329, 3328, 3327, 3326, 3325, 3324, 3323, 3322, 3321, 3320, 3319, 3318, 3317, 3316, 3315, 3314, 3313, 3312, 3311, 3310, 3309, 3308, ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(piles=[1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 10000, 11000, 12000, 13000, 14000, 15000]) == 50000",
"assert candidate(piles=[3333, 3332, 3331, 3330, 3329, 3328, 3327, 3326, 3325, 3324, 3323, 3322, 3321, 3320, 3319, 3318, 3317, 3316, 3315, 3314, 3313, 3312, 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 arr that represents a permutation of numbers from 1 to n.\n... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
Given an array arr that represents a permutation of numbers from 1 to n.
You have a binary string of size n that initia... | [
"assert candidate(arr=[3, 1, 4, 2, 5, 6, 7, 8, 9, 10], m=3) == -1",
"assert candidate(arr=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], m=5) == 5",
"assert candidate(arr=[1, 11, 2, 12, 3, 13, 4, 14, 5, 15, 6, 16, 7, 17, 8, 18, 9, 19, 10, 20], m=10) == -1",
"assert candidate(arr=[1, 3, 5, 2, 4], m=2) == -1",
"assert cand... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(arr=[3, 1, 4, 2, 5, 6, 7, 8, 9, 10], m=3) == -1",
"assert candidate(arr=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], m=5) == 5",
"assert candidate(arr=[1, 11, 2, 12, 3, 13, 4, 14, 5, 15, 6, 16, 7, 17, 8, 18, 9, 19, 10, 20], m=10) == -1",
"assert candidate(arr=[1, 3, 5, 2, 4], ... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nThere are several stones arranged in a row, and each stone has an associat... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
There are several stones arranged in a row, and each stone has an associated value which is an integer given in the arr... | [
"assert candidate(stoneValue=[50, 25, 75, 100, 200, 150, 300, 50, 25, 75, 100, 200, 150, 300, 50]) == 1625",
"assert candidate(stoneValue=[1000000, 1000000]) == 1000000",
"assert candidate(stoneValue=[1000000, 1000000]) == 1000000",
"assert candidate(stoneValue=[7, 7, 7, 7, 7, 7, 7]) == 28",
"assert candida... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(stoneValue=[50, 25, 75, 100, 200, 150, 300, 50, 25, 75, 100, 200, 150, 300, 50]) == 1625",
"assert candidate(stoneValue=[1000000, 1000000]) == 1000000",
"assert candidate(stoneValue=[1000000, 1000000]) == 1000000",
"assert candidate(stoneValue=[7, 7, 7, 7, 7, 7, 7]... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven an array of integers nums, find the maximum length of a subarray whe... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
Given an array of integers nums, find the maximum length of a subarray where the product of all its elements is positiv... | [
"assert candidate(nums=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, -1, -2, -3, -4, -5, -6, -7, -8, -9, -10]) == 20",
"assert candidate(nums=[1, -2, 3, -4, 5, -6, 7, -8, 9, -10]) == 9",
"assert candidate(nums=[1000000000, -1000000000, 1000000000, -1000000000]) == 4",
"assert candidate(nums=[1, 2, 3, -4, 5, 0, -6, 7, 8,... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, -1, -2, -3, -4, -5, -6, -7, -8, -9, -10]) == 20",
"assert candidate(nums=[1, -2, 3, -4, 5, -6, 7, -8, 9, -10]) == 9",
"assert candidate(nums=[1000000000, -1000000000, 1000000000, -1000000000]) == 4",
"assert candidate(nums=[1... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an m x n binary grid grid where 1 represents land and 0 repr... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given an m x n binary grid grid where 1 represents land and 0 represents water. An island is a maximal 4-direct... | [
"assert candidate(grid=[[0, 1, 1, 0], [0, 1, 1, 0], [0, 0, 0, 0]]) == 2",
"assert candidate(grid=[[1, 1, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, 1], [1, 0, 0, 1, 1, 0, 1], [0, 0, 1, 1, 1, 1, 0], [1, 0, 0, 1, 1, 0, 1], [1, 1, 0, 0, 0, 0, 1], [1, 1, 1, 0, 0, 1, 1]]) == 0",
"assert candidate(grid=[[1, 1, 1, 0, 0, 0], [... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(grid=[[0, 1, 1, 0], [0, 1, 1, 0], [0, 0, 0, 0]]) == 2",
"assert candidate(grid=[[1, 1, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, 1], [1, 0, 0, 1, 1, 0, 1], [0, 0, 1, 1, 1, 1, 0], [1, 0, 0, 1, 1, 0, 1], [1, 1, 0, 0, 0, 0, 1], [1, 1, 1, 0, 0, 1, 1]]) == 0",
"assert candidate(gr... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven an array nums that represents a permutation of integers from 1 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:
Given an array nums that represents a permutation of integers from 1 to n. We are going to construct a binary search tr... | [
"assert candidate(nums=[50, 25, 75, 12, 37, 63, 87, 6, 18, 30, 42, 56, 70, 81, 93]) == 21964799",
"assert candidate(nums=[70, 35, 105, 17, 53, 59, 88, 126, 9, 26, 44, 50, 56, 81, 93, 112, 120, 130, 140, 150, 5, 13, 20, 29, 39, 42, 48, 51, 58, 76, 80, 85, 89, 91, 97, 100, 102, 107, 109, 113, 115, 117, 119, 121, 12... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[50, 25, 75, 12, 37, 63, 87, 6, 18, 30, 42, 56, 70, 81, 93]) == 21964799",
"assert candidate(nums=[70, 35, 105, 17, 53, 59, 88, 126, 9, 26, 44, 50, 56, 81, 93, 112, 120, 130, 140, 150, 5, 13, 20, 29, 39, 42, 48, 51, 58, 76, 80, 85, 89, 91, 97, 100, 102, 107, 109, 113,... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven an integer array arr, remove a subarray (can be empty) from arr such... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
Given an integer array arr, remove a subarray (can be empty) from arr such that the remaining elements in arr are non-d... | [
"assert candidate(arr=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 3, 4, 5, 6, 7, 8, 9, 10, 11]) == 8",
"assert candidate(arr=[1, 2, 3, 4, 5, 6, 7, 8, 9, 5, 6, 7, 8, 9, 10, 5, 6, 7, 8, 9]) == 10",
"assert candidate(arr=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 10,... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(arr=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 3, 4, 5, 6, 7, 8, 9, 10, 11]) == 8",
"assert candidate(arr=[1, 2, 3, 4, 5, 6, 7, 8, 9, 5, 6, 7, 8, 9, 10, 5, 6, 7, 8, 9]) == 10",
"assert candidate(arr=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 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:\nAlice and Bob have an undirected graph of n nodes and three types of edges... | You are an expert Python programmer. 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 have an undirected graph of n nodes and three types of edges:
Type 1: Can be traversed by Alice only.
Ty... | [
"assert candidate(n=6, edges=[[3, 1, 2], [3, 2, 3], [3, 3, 4], [3, 4, 5], [3, 5, 6], [1, 1, 2], [1, 3, 4], [1, 5, 6], [2, 2, 3], [2, 4, 5]]) == 5",
"assert candidate(n=8, edges=[[3, 1, 2], [3, 2, 3], [3, 3, 4], [3, 4, 5], [3, 5, 6], [3, 6, 7], [3, 7, 8], [1, 1, 2], [1, 2, 3], [1, 3, 4], [1, 4, 5], [1, 5, 6], [1, ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(n=6, edges=[[3, 1, 2], [3, 2, 3], [3, 3, 4], [3, 4, 5], [3, 5, 6], [1, 1, 2], [1, 3, 4], [1, 5, 6], [2, 2, 3], [2, 4, 5]]) == 5",
"assert candidate(n=8, edges=[[3, 1, 2], [3, 2, 3], [3, 3, 4], [3, 4, 5], [3, 5, 6], [3, 6, 7], [3, 7, 8], [1, 1, 2], [1, 2, 3], [1, 3, 4], [1,... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given two arrays of positive integers, boxes and warehouse, repres... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given two arrays of positive integers, boxes and warehouse, representing the heights of some boxes of unit widt... | [
"assert candidate(boxes=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100], warehouse=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == 1",
"assert candidate(boxes=[5, 10, 15, 20, 25, 30, 35, 40, 45, 50], warehouse=[50, 45, 40, 35, 30, 25, 20, 15, 10, 5]) == 10",
"assert candidate(boxes=[5, 5, 5, 5, 5], warehouse=[1, 2, 3, 4, 5, 6, 7... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(boxes=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100], warehouse=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == 1",
"assert candidate(boxes=[5, 10, 15, 20, 25, 30, 35, 40, 45, 50], warehouse=[50, 45, 40, 35, 30, 25, 20, 15, 10, 5]) == 10",
"assert candidate(boxes=[5, 5, 5, 5, 5], wareh... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 preferences for n friends, where n is always even.... | You are an expert Python programmer. 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 preferences for n friends, where n is always even.
For each person i, preferences[i] contains a... | [
"assert candidate(n=10, preferences=[[9, 8, 7, 6, 5, 4, 3, 2, 1, 0], [8, 7, 6, 5, 4, 3, 2, 1, 0, 9], [7, 6, 5, 4, 3, 2, 1, 0, 9, 8], [6, 5, 4, 3, 2, 1, 0, 9, 8, 7], [5, 4, 3, 2, 1, 0, 9, 8, 7, 6], [4, 3, 2, 1, 0, 9, 8, 7, 6, 5], [3, 2, 1, 0, 9, 8, 7, 6, 5, 4], [2, 1, 0, 9, 8, 7, 6, 5, 4, 3], [1, 0, 9, 8, 7, 6, 5, 4... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(n=10, preferences=[[9, 8, 7, 6, 5, 4, 3, 2, 1, 0], [8, 7, 6, 5, 4, 3, 2, 1, 0, 9], [7, 6, 5, 4, 3, 2, 1, 0, 9, 8], [6, 5, 4, 3, 2, 1, 0, 9, 8, 7], [5, 4, 3, 2, 1, 0, 9, 8, 7, 6], [4, 3, 2, 1, 0, 9, 8, 7, 6, 5], [3, 2, 1, 0, 9, 8, 7, 6, 5, 4], [2, 1, 0, 9, 8, 7, 6, 5, 4, 3], [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 points representing integer coordinates of some poi... | You are an expert Python programmer. 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 points representing integer coordinates of some points on a 2D-plane, where points[i] = [xi, yi]... | [
"assert candidate(points=[[-500000, -500000], [500000, 500000], [-400000, -400000], [400000, 400000], [-300000, -300000], [300000, 300000], [-200000, -200000], [200000, 200000], [-100000, -100000], [100000, 100000]]) == 2000000",
"assert candidate(points=[[-1, -1], [-2, -2], [-3, -3], [-4, -4], [-5, -5], [5, 5], ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(points=[[-500000, -500000], [500000, 500000], [-400000, -400000], [400000, 400000], [-300000, -300000], [300000, 300000], [-200000, -200000], [200000, 200000], [-100000, -100000], [100000, 100000]]) == 2000000",
"assert candidate(points=[[-1, -1], [-2, -2], [-3, -3], [-4, ... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven two strings s and t, transform string s into string t using the foll... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
Given two strings s and t, transform string s into string t using the following operation any number of times:
Choose ... | [
"assert candidate(s='102030405060708090', t='0000000000123456789') == False",
"assert candidate(s='98765432109876543210', t='00112233445566778899') == True",
"assert candidate(s='4321', t='1234') == True",
"assert candidate(s='9999888877776666555544443333222211110000', t='0000111122223333444455556666777788889... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(s='102030405060708090', t='0000000000123456789') == False",
"assert candidate(s='98765432109876543210', t='00112233445566778899') == True",
"assert candidate(s='4321', t='1234') == True",
"assert candidate(s='9999888877776666555544443333222211110000', t='0000111122... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven an array of positive integers nums, remove the smallest subarray (po... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
Given an array of positive integers nums, remove the smallest subarray (possibly empty) such that the sum of the remain... | [
"assert candidate(nums=[9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9], p=7) == 3",
"assert candidate(nums=[1000000000, 1000000000, 1000000000, 1000000000, 1000000000], p=1) == 0",
"assert candidate(nums=[1000000000, 999999999, 888888888, 777777777, 666666666, 55555... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9], p=7) == 3",
"assert candidate(nums=[1000000000, 1000000000, 1000000000, 1000000000, 1000000000], p=1) == 0",
"assert candidate(nums=[1000000000, 999999999, 888888888, 77... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 strange printer with the following two special requirements:\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 a strange printer with the following two special requirements:
On each turn, the printer will print a solid r... | [
"assert candidate(targetGrid=[[1, 1, 1, 1], [1, 1, 3, 3], [1, 1, 3, 4], [5, 5, 1, 4]]) == True",
"assert candidate(targetGrid=[[1, 1, 1, 1], [2, 2, 2, 2], [3, 3, 3, 3], [4, 4, 4, 4], [5, 5, 5, 5]]) == True",
"assert candidate(targetGrid=[[1, 2, 3, 4, 5], [2, 3, 4, 5, 1], [3, 4, 5, 1, 2], [4, 5, 1, 2, 3], [5, 1,... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(targetGrid=[[1, 1, 1, 1], [1, 1, 3, 3], [1, 1, 3, 4], [5, 5, 1, 4]]) == True",
"assert candidate(targetGrid=[[1, 1, 1, 1], [2, 2, 2, 2], [3, 3, 3, 3], [4, 4, 4, 4], [5, 5, 5, 5]]) == True",
"assert candidate(targetGrid=[[1, 2, 3, 4, 5], [2, 3, 4, 5, 1], [3, 4, 5, 1, 2]... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven a string s, return the maximum number of unique substrings that 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 a string s, return the maximum number of unique substrings that the given string can be split into.
You can split... | [
"assert candidate(s='abcdefg') == 7",
"assert candidate(s='abcdefabcdefabcdefabcdef') == 14",
"assert candidate(s='optimization') == 10",
"assert candidate(s='abababababababab') == 7",
"assert candidate(s='aaaabbbb') == 5",
"assert candidate(s='reviled') == 6",
"assert candidate(s='repaper') == 5",
"a... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(s='abcdefg') == 7",
"assert candidate(s='abcdefabcdefabcdefabcdef') == 14",
"assert candidate(s='optimization') == 10",
"assert candidate(s='abababababababab') == 7",
"assert candidate(s='aaaabbbb') == 5",
"assert candidate(s='reviled') == 6",
"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 a m x n matrix grid. Initially, you are located at the top-l... | You are an expert Python programmer. 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 m x n matrix grid. Initially, you are located at the top-left corner (0, 0), and in each step, you can ... | [
"assert candidate(grid=[[0, 0], [0, 0]]) == 0",
"assert candidate(grid=[[-1, 0, 1, 0, -1], [-1, 1, 0, 1, -1], [0, -1, 1, -1, 0], [1, -1, 0, 1, -1], [-1, 0, 1, 0, -1]]) == 1",
"assert candidate(grid=[[0, 1, 2, 3, 4], [4, 3, 2, 1, 0], [-1, -2, -3, -4, -5], [-5, -4, -3, -2, -1]]) == 0",
"assert candidate(grid=[[... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(grid=[[0, 0], [0, 0]]) == 0",
"assert candidate(grid=[[-1, 0, 1, 0, -1], [-1, 1, 0, 1, -1], [0, -1, 1, -1, 0], [1, -1, 0, 1, -1], [-1, 0, 1, 0, -1]]) == 1",
"assert candidate(grid=[[0, 1, 2, 3, 4], [4, 3, 2, 1, 0], [-1, -2, -3, -4, -5], [-5, -4, -3, -2, -1]]) == 0",
... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are the operator of a Centennial Wheel that has four gondolas, and eac... | You are an expert Python programmer. 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 the operator of a Centennial Wheel that has four gondolas, and each gondola has room for up to four people. You... | [
"assert candidate(customers=[4, 4, 4, 4, 4, 4, 4, 4, 4, 4], boardingCost=3, runningCost=15) == -1",
"assert candidate(customers=[4, 3, 2, 1, 0, 0, 0, 0, 0, 0], boardingCost=50, runningCost=2) == 4",
"assert candidate(customers=[100, 0, 0, 0, 0, 0, 0, 0, 0, 0], boardingCost=1, runningCost=2) == 25",
"assert ca... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(customers=[4, 4, 4, 4, 4, 4, 4, 4, 4, 4], boardingCost=3, runningCost=15) == -1",
"assert candidate(customers=[4, 3, 2, 1, 0, 0, 0, 0, 0, 0], boardingCost=50, runningCost=2) == 4",
"assert candidate(customers=[100, 0, 0, 0, 0, 0, 0, 0, 0, 0], boardingCost=1, runningCos... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven the root of a binary tree and a node u in the tree, return the neare... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
Given the root of a binary tree and a node u in the tree, return the nearest node on the same level that is to the righ... | [
"assert candidate(root=tree_node([1, 2, None, 3, 4, None, 5, None, None, 6, 7]), u=6) == None",
"assert candidate(root=tree_node([1]), u=1) == None",
"assert candidate(root=tree_node([1, 2]), u=2) == None",
"assert candidate(root=tree_node([1, 2, 3, 4, 5, 6, 7]), u=5) == None",
"assert candidate(root=tree_n... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(root=tree_node([1, 2, None, 3, 4, None, 5, None, None, 6, 7]), u=6) == None",
"assert candidate(root=tree_node([1]), u=1) == None",
"assert candidate(root=tree_node([1, 2]), u=2) == None",
"assert candidate(root=tree_node([1, 2, 3, 4, 5, 6, 7]), u=5) == None",
... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nLeetCode company workers use key-cards to unlock office doors. Each time 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:
LeetCode company workers use key-cards to unlock office doors. Each time a worker uses their key-card, the security sys... | [
"assert candidate(keyName=['charlie', 'charlie', 'charlie', 'charlie', 'charlie', 'charlie', 'charlie'], keyTime=['10:00', '10:10', '10:20', '10:30', '10:40', '11:00', '11:10']) == ['charlie']",
"assert candidate(keyName=['bob', 'bob', 'bob', 'bob', 'bob', 'bob'], keyTime=['23:50', '00:05', '00:10', '00:15', '00:... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(keyName=['charlie', 'charlie', 'charlie', 'charlie', 'charlie', 'charlie', 'charlie'], keyTime=['10:00', '10:10', '10:20', '10:30', '10:40', '11:00', '11:10']) == ['charlie']",
"assert candidate(keyName=['bob', 'bob', 'bob', 'bob', 'bob', 'bob'], keyTime=['23:50', '00:05',... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 arrays rowSum and colSum of non-negative integers where ... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given two arrays rowSum and colSum of non-negative integers where rowSum[i] is the sum of the elements in the i... | [
"assert candidate(rowSum=[25, 50, 75, 100], colSum=[10, 20, 30, 40, 95]) == [[10, 15, 0, 0, 0], [0, 5, 30, 15, 0], [0, 0, 0, 25, 50], [0, 0, 0, 0, 45]]",
"assert candidate(rowSum=[12, 9, 6], colSum=[10, 10, 7]) == [[10, 2, 0], [0, 8, 1], [0, 0, 6]]",
"assert candidate(rowSum=[100, 200, 300, 400], colSum=[200, 3... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(rowSum=[25, 50, 75, 100], colSum=[10, 20, 30, 40, 95]) == [[10, 15, 0, 0, 0], [0, 5, 30, 15, 0], [0, 0, 0, 25, 50], [0, 0, 0, 0, 45]]",
"assert candidate(rowSum=[12, 9, 6], colSum=[10, 10, 7]) == [[10, 2, 0], [0, 8, 1], [0, 0, 6]]",
"assert candidate(rowSum=[100, 200, ... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 points, an integer angle, and your location, where ... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given an array points, an integer angle, and your location, where location = [posx, posy] and points[i] = [xi, ... | [
"assert candidate(points=[[10, 10], [10, 20], [20, 10], [20, 20], [15, 15], [5, 5], [25, 25], [5, 25], [25, 5], [15, 5], [5, 15], [25, 15], [15, 25]], angle=120, location=[15, 15]) == 6",
"assert candidate(points=[[1, 10], [2, 20], [3, 30], [4, 40], [5, 50], [6, 60], [7, 70], [8, 80], [9, 90], [10, 100]], angle=3... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(points=[[10, 10], [10, 20], [20, 10], [20, 20], [15, 15], [5, 5], [25, 25], [5, 25], [25, 5], [15, 5], [5, 15], [25, 15], [15, 25]], angle=120, location=[15, 15]) == 6",
"assert candidate(points=[[1, 10], [2, 20], [3, 30], [4, 40], [5, 50], [6, 60], [7, 70], [8, 80], [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 an infrastructure of n cities with some number of roads connectin... | You are an expert Python programmer. 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 infrastructure of n cities with some number of roads connecting these cities. Each roads[i] = [ai, bi] indi... | [
"assert candidate(n=4, roads=[[0, 1], [0, 3], [1, 2], [1, 3]]) == 4",
"assert candidate(n=10, roads=[[0, 1], [0, 2], [0, 3], [1, 2], [1, 3], [2, 3], [4, 5], [4, 6], [5, 6], [7, 8], [7, 9], [8, 9]]) == 5",
"assert candidate(n=20, roads=[[0, 1], [0, 2], [1, 3], [1, 4], [2, 5], [2, 6], [3, 7], [3, 8], [4, 9], [4, ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(n=4, roads=[[0, 1], [0, 3], [1, 2], [1, 3]]) == 4",
"assert candidate(n=10, roads=[[0, 1], [0, 2], [0, 3], [1, 2], [1, 3], [2, 3], [4, 5], [4, 6], [5, 6], [7, 8], [7, 9], [8, 9]]) == 5",
"assert candidate(n=20, roads=[[0, 1], [0, 2], [1, 3], [1, 4], [2, 5], [2, 6], [3,... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an array of network towers towers, where towers[i] = [xi, yi... | You are an expert Python programmer. 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 network towers towers, where towers[i] = [xi, yi, qi] denotes the ith network tower with loca... | [
"assert candidate(towers=[[10, 10, 10], [20, 10, 20], [30, 10, 30], [10, 20, 20], [20, 20, 30], [30, 20, 40]], radius=10) == [30, 20]",
"assert candidate(towers=[[25, 25, 100], [30, 30, 200], [35, 35, 300], [40, 40, 400], [45, 45, 500], [50, 50, 600]], radius=15) == [50, 50]",
"assert candidate(towers=[[5, 5, 5... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(towers=[[10, 10, 10], [20, 10, 20], [30, 10, 30], [10, 20, 20], [20, 20, 30], [30, 20, 40]], radius=10) == [30, 20]",
"assert candidate(towers=[[25, 25, 100], [30, 30, 200], [35, 35, 300], [40, 40, 400], [45, 45, 500], [50, 50, 600]], radius=15) == [50, 50]",
"assert c... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven n points on a 1-D plane, where the ith point (from 0 to n-1) is at 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:
Given n points on a 1-D plane, where the ith point (from 0 to n-1) is at x = i, find the number of ways we can draw exa... | [
"assert candidate(n=500, k=100) == 698790075",
"assert candidate(n=250, k=100) == 47365034",
"assert candidate(n=100, k=10) == 697218647",
"assert candidate(n=950, k=400) == 686452764",
"assert candidate(n=250, k=75) == 928665746",
"assert candidate(n=150, k=50) == 703668401",
"assert candidate(n=5, k=2... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(n=500, k=100) == 698790075",
"assert candidate(n=250, k=100) == 47365034",
"assert candidate(n=100, k=10) == 697218647",
"assert candidate(n=950, k=400) == 686452764",
"assert candidate(n=250, k=75) == 928665746",
"assert candidate(n=150, k=50) == 703668401... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 even length consisting of digits from 0 to 9, ... | You are an expert Python programmer. 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 even length consisting of digits from 0 to 9, and two integers a and b.
You can apply eithe... | [
"assert candidate(s='1111111111', a=1, b=2) == '1010101010'",
"assert candidate(s='1212121212', a=4, b=6) == '1010101010'",
"assert candidate(s='595959595959595959', a=4, b=2) == '515151515151515151'",
"assert candidate(s='1111111111', a=9, b=9) == '0000000000'",
"assert candidate(s='1234567890', a=1, b=5) ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(s='1111111111', a=1, b=2) == '1010101010'",
"assert candidate(s='1212121212', a=4, b=6) == '1010101010'",
"assert candidate(s='595959595959595959', a=4, b=2) == '515151515151515151'",
"assert candidate(s='1111111111', a=9, b=9) == '0000000000'",
"assert candida... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are the manager of a basketball team. For the upcoming tournament, you... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are the manager of a basketball team. For the upcoming tournament, you want to choose the team with the highest ove... | [
"assert candidate(scores=[15, 30, 10, 20, 50], ages=[5, 10, 15, 20, 25]) == 95",
"assert candidate(scores=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], ages=[10, 10, 10, 10, 10, 10, 10, 10, 10, 10]) == 55",
"assert candidate(scores=[1000000, 1000000, 1000000], ages=[1, 1, 1]) == 3000000",
"assert candidate(scores=[10, 20,... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(scores=[15, 30, 10, 20, 50], ages=[5, 10, 15, 20, 25]) == 95",
"assert candidate(scores=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], ages=[10, 10, 10, 10, 10, 10, 10, 10, 10, 10]) == 55",
"assert candidate(scores=[1000000, 1000000, 1000000], ages=[1, 1, 1]) == 3000000",
"asser... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nA sequence of numbers is called arithmetic if it consists of at least two ... | You are an expert Python programmer. 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 of numbers is called arithmetic if it consists of at least two elements, and the difference between every tw... | [
"assert candidate(nums=[5, 5, 5, 5, 5], l=[0, 1, 2], r=[1, 2, 3]) == [True, True, True]",
"assert candidate(nums=[100, 200, 300, 400, 500, 600, 700, 800, 900, 1000], l=[0, 0, 0, 0], r=[3, 4, 5, 6]) == [True, True, True, True]",
"assert candidate(nums=[4, 3, 2, 1, 0, -1, -2, -3, -4], l=[0, 3, 4, 5], r=[8, 7, 6, ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[5, 5, 5, 5, 5], l=[0, 1, 2], r=[1, 2, 3]) == [True, True, True]",
"assert candidate(nums=[100, 200, 300, 400, 500, 600, 700, 800, 900, 1000], l=[0, 0, 0, 0], r=[3, 4, 5, 6]) == [True, True, True, True]",
"assert candidate(nums=[4, 3, 2, 1, 0, -1, -2, -3, -4], l=[... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 a hiker preparing for an upcoming hike. You are given heights, a 2... | You are an expert Python programmer. 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 a hiker preparing for an upcoming hike. You are given heights, a 2D array of size rows x columns, where heights... | [
"assert candidate(heights=[[1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [10, 9, 8, 7, 6, 5, 4, 3, 2, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]) == 0",
"assert candidate(heights=[[1, 6, 7, 5, 3, 1, 2, 6, 3, 10], [10, 1, 5, 8, 2, 10, 4, 10, 8, 7], [1, 9, 3, 5, 7, 4, 5, ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(heights=[[1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [10, 9, 8, 7, 6, 5, 4, 3, 2, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]) == 0",
"assert candidate(heights=[[1, 6, 7, 5, 3, 1, 2, 6, 3, 10], [10, 1, 5, 8, 2, 10, 4, 10, 8, 7],... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven an m x n matrix, return a new matrix answer where answer[row][col] 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 an m x n matrix, return a new matrix answer where answer[row][col] is the rank of matrix[row][col].
The rank is a... | [
"assert candidate(matrix=[[-5, -5, -5, -5], [-5, -5, -5, -5], [-5, -5, -5, -5], [-5, -5, -5, -5]]) == [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]",
"assert candidate(matrix=[[100, 200, 300, 400, 500], [500, 400, 300, 200, 100], [200, 300, 400, 500, 100], [400, 500, 100, 200, 300], [300, 100, 200, 300... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(matrix=[[-5, -5, -5, -5], [-5, -5, -5, -5], [-5, -5, -5, -5], [-5, -5, -5, -5]]) == [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]",
"assert candidate(matrix=[[100, 200, 300, 400, 500], [500, 400, 300, 200, 100], [200, 300, 400, 500, 100], [400, 500, 100, 200, 30... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven an integer n, return the number of strings of length n that consist ... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
Given an integer n, return the number of strings of length n that consist only of vowels (a, e, i, o, u) and are lexico... | [
"assert candidate(n=9) == 715",
"assert candidate(n=33) == 66045",
"assert candidate(n=15) == 3876",
"assert candidate(n=28) == 35960",
"assert candidate(n=3) == 35",
"assert candidate(n=7) == 330",
"assert candidate(n=22) == 14950",
"assert candidate(n=50) == 316251",
"assert candidate(n=8) == 495"... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(n=9) == 715",
"assert candidate(n=33) == 66045",
"assert candidate(n=15) == 3876",
"assert candidate(n=28) == 35960",
"assert candidate(n=3) == 35",
"assert candidate(n=7) == 330",
"assert candidate(n=22) == 14950",
"assert candidate(n=50) == 316251... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 heights representing the heights of buildin... | You are an expert Python programmer. 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 heights representing the heights of buildings, some bricks, and some ladders.
You start ... | [
"assert candidate(heights=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], bricks=18, ladders=1) == 9",
"assert candidate(heights=[1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10], bricks=15, ladders=3) == 19",
"assert candidate(heights=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(heights=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], bricks=18, ladders=1) == 9",
"assert candidate(heights=[1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10], bricks=15, ladders=3) == 19",
"assert candidate(heights=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 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:\nBob is standing at cell (0, 0), and he wants to reach destination: (row, 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:
Bob is standing at cell (0, 0), and he wants to reach destination: (row, column). He can only travel right and down. Yo... | [
"assert candidate(destination=[8, 7], k=650) == 'HHVHVHVHVHHVVVV'",
"assert candidate(destination=[13, 7], k=4000) == 'HHVHVVVVVVHHVHVVHVVV'",
"assert candidate(destination=[15, 1], k=1) == 'HVVVVVVVVVVVVVVV'",
"assert candidate(destination=[12, 5], k=1234) == 'HVVVHVVHVVVVHVVHV'",
"assert candidate(destina... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(destination=[8, 7], k=650) == 'HHVHVHVHVHHVVVV'",
"assert candidate(destination=[13, 7], k=4000) == 'HHVHVVVVVVHHVHVVHVVV'",
"assert candidate(destination=[15, 1], k=1) == 'HVVVVVVVVVVVVVVV'",
"assert candidate(destination=[12, 5], k=1234) == 'HVVVHVVHVVVVHVVHV'",
... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven the root of a binary tree, return the lowest common ancestor (LCA) o... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
Given the root of a binary tree, return the lowest common ancestor (LCA) of two given nodes, p and q. If either node p ... | [
"assert candidate(root=tree_node([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50]), p=17, q=49) == None",
"assert candidate(root=tree_node([3, 5, 1, 6, 2, 0, 8, None, None... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(root=tree_node([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50]), p=17, q=49) == None",
"assert candidate(root=tree_node([3, 5, 1,... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nA string s is called good if there are no two different characters in s th... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
A string s is called good if there are no two different characters in s that have the same frequency.
Given a string s,... | [
"assert candidate(s='zzzzzzzzzzyyyyyyyyyxxxxxxxwwwwwwvvvvuuuuutttttsssssrrrrqqqqppppooooonnnnmmmmlllkkkjjjiii') == 41",
"assert candidate(s='a') == 0",
"assert candidate(s='zzzzzzzzzzzyyyyyyyxxxxxxxwwwwwwvvvvuuuutttssrrqponmlkjihgfedcba') == 24",
"assert candidate(s='abcabcabc') == 3",
"assert candidate(s='... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(s='zzzzzzzzzzyyyyyyyyyxxxxxxxwwwwwwvvvvuuuuutttttsssssrrrrqqqqppppooooonnnnmmmmlllkkkjjjiii') == 41",
"assert candidate(s='a') == 0",
"assert candidate(s='zzzzzzzzzzzyyyyyyyxxxxxxxwwwwwwvvvvuuuutttssrrqponmlkjihgfedcba') == 24",
"assert candidate(s='abcabcabc') == ... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou have an inventory of different colored balls, and there is a customer ... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You have an inventory of different colored balls, and there is a customer that wants orders balls of any color.
The cus... | [
"assert candidate(inventory=[100, 200, 300, 400, 500], orders=1000) == 250500",
"assert candidate(inventory=[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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(inventory=[100, 200, 300, 400, 500], orders=1000) == 250500",
"assert candidate(inventory=[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, 1, 1,... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven an integer array instructions, you are asked to create a sorted arra... | You are an expert Python programmer. 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 instructions, you are asked to create a sorted array from the elements in instructions. You star... | [
"assert candidate(instructions=[1, 3, 3, 3, 2, 4, 2, 1, 2]) == 4",
"assert candidate(instructions=[1, 2, 3, 6, 5, 4]) == 3",
"assert candidate(instructions=[20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11]) == 75",
"assert candidate(instru... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(instructions=[1, 3, 3, 3, 2, 4, 2, 1, 2]) == 4",
"assert candidate(instructions=[1, 2, 3, 6, 5, 4]) == 3",
"assert candidate(instructions=[20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11]) == 75",
... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a string s consisting only of characters 'a' and 'b'.\nY... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given a string s consisting only of characters 'a' and 'b'.
You can delete any number of characters in s to... | [
"assert candidate(s='bbbbaaaaabbaaaab') == 6",
"assert candidate(s='abababababababababab') == 9",
"assert candidate(s='aaaaaabbbbbbaaaaaaabbbbbaaaaabbbbb') == 11",
"assert candidate(s='bbbb') == 0",
"assert candidate(s='abababababababababababababababababababababababababababababababababababababababababababab... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(s='bbbbaaaaabbaaaab') == 6",
"assert candidate(s='abababababababababab') == 9",
"assert candidate(s='aaaaaabbbbbbaaaaaaabbbbbaaaaabbbbb') == 11",
"assert candidate(s='bbbb') == 0",
"assert candidate(s='abababababababababababababababababababababababababababababa... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 certain bug's home is on the x-axis at position x. Help them get there f... | You are an expert Python programmer. 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 certain bug's home is on the x-axis at position x. Help them get there from position 0.
The bug jumps according to th... | [
"assert candidate(forbidden=[2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40], a=2, b=3, x=42) == -1",
"assert candidate(forbidden=[2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50], a=2, b=1, x=51) == -1",
"assert candidate(forbidden=[5, ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(forbidden=[2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40], a=2, b=3, x=42) == -1",
"assert candidate(forbidden=[2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50], a=2, b=1, x=51) == -1",
"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:\nTwo strings are considered close if you can attain one from the other usin... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
Two strings are considered close if you can attain one from the other using the following operations:
Operation 1: Swa... | [
"assert candidate(word1='leetcode', word2='codeleet') == True",
"assert candidate(word1='aaaaabbbbcccccccdddddddd', word2='ddddddddcccccccbbbbaaaaa') == True",
"assert candidate(word1='abcdefghijklmnopqrstuvwxyz', word2='abcdefghijklmnopqrstuvwxyz') == True",
"assert candidate(word1='abcde', word2='edcba') ==... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(word1='leetcode', word2='codeleet') == True",
"assert candidate(word1='aaaaabbbbcccccccdddddddd', word2='ddddddddcccccccbbbbaaaaa') == True",
"assert candidate(word1='abcdefghijklmnopqrstuvwxyz', word2='abcdefghijklmnopqrstuvwxyz') == True",
"assert candidate(word1... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 x. In one operation, yo... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given an integer array nums and an integer x. In one operation, you can either remove the leftmost or the right... | [
"assert candidate(nums=[3, 2, 20, 1, 1, 3], x=10) == 5",
"assert candidate(nums=[9, 8, 7, 6, 5, 4, 3, 2, 1], x=9) == 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], x=275) == 20",
"assert candidate(nums=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[3, 2, 20, 1, 1, 3], x=10) == 5",
"assert candidate(nums=[9, 8, 7, 6, 5, 4, 3, 2, 1], x=9) == 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], x=275) == 20",
"assert candidate(nums=[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 four integers, m, n, introvertsCount, and extrovertsCount. Y... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given four integers, m, n, introvertsCount, and extrovertsCount. You have an m x n grid, and there are two type... | [
"assert candidate(m=3, n=3, introvertsCount=3, extrovertsCount=3) == 550",
"assert candidate(m=3, n=4, introvertsCount=0, extrovertsCount=6) == 520",
"assert candidate(m=4, n=4, introvertsCount=4, extrovertsCount=2) == 600",
"assert candidate(m=2, n=2, introvertsCount=0, extrovertsCount=0) == 0",
"assert ca... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(m=3, n=3, introvertsCount=3, extrovertsCount=3) == 550",
"assert candidate(m=3, n=4, introvertsCount=0, extrovertsCount=6) == 520",
"assert candidate(m=4, n=4, introvertsCount=4, extrovertsCount=2) == 600",
"assert candidate(m=2, n=2, introvertsCount=0, extrovertsC... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nThe numeric value of a lowercase character is defined as its position (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:
The numeric value of a lowercase character is defined as its position (1-indexed) in the alphabet, so the numeric value... | [
"assert candidate(n=10, k=260) == 'zzzzzzzzzz'",
"assert candidate(n=12, k=300) == 'nzzzzzzzzzzz'",
"assert candidate(n=26, k=676) == 'zzzzzzzzzzzzzzzzzzzzzzzzzz'",
"assert candidate(n=6, k=156) == 'zzzzzz'",
"assert candidate(n=4, k=10) == 'aaag'",
"assert candidate(n=8, k=120) == 'aaamzzzz'",
"assert ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(n=10, k=260) == 'zzzzzzzzzz'",
"assert candidate(n=12, k=300) == 'nzzzzzzzzzzz'",
"assert candidate(n=26, k=676) == 'zzzzzzzzzzzzzzzzzzzzzzzzzz'",
"assert candidate(n=6, k=156) == 'zzzzzz'",
"assert candidate(n=4, k=10) == 'aaag'",
"assert candidate(n=8, k=... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an integer array nums. You can choose exactly one index (0-i... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given an integer array nums. You can choose exactly one index (0-indexed) and remove the element. Notice that t... | [
"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]) == 0",
"assert candidate(nums=[5, 3, 2, 4, 1, 6, 7, 8, 9, 10, 11, 12]) == 0",
"assert candidate(nums=[10000, 9999, 9998, 9997, 9996, 999... | 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]) == 0",
"assert candidate(nums=[5, 3, 2, 4, 1, 6, 7, 8, 9, 10, 11, 12]) == 0",
"assert candidate(nums=[10000, 99... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 tasks where tasks[i] = [actuali, minimumi]:\n\nactu... | You are an expert Python programmer. 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 tasks where tasks[i] = [actuali, minimumi]:
actuali is the actual amount of energy you spend to... | [
"assert candidate(tasks=[[9000, 10000], [8000, 9000], [7000, 8000], [6000, 7000], [5000, 6000], [4000, 5000]]) == 40000",
"assert candidate(tasks=[[100, 105], [10, 15], [1, 2], [5, 7], [20, 25], [30, 35], [40, 45], [50, 55], [60, 65], [70, 75]]) == 387",
"assert candidate(tasks=[[5, 10], [2, 8], [3, 5], [4, 7]]... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(tasks=[[9000, 10000], [8000, 9000], [7000, 8000], [6000, 7000], [5000, 6000], [4000, 5000]]) == 40000",
"assert candidate(tasks=[[100, 105], [10, 15], [1, 2], [5, 7], [20, 25], [30, 35], [40, 45], [50, 55], [60, 65], [70, 75]]) == 387",
"assert candidate(tasks=[[5, 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 two linked lists: list1 and list2 of sizes n and m respectiv... | You are an expert Python programmer. 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 linked lists: list1 and list2 of sizes n and m respectively.
Remove list1's nodes from the ath node t... | [
"assert is_same_list(candidate(list1=list_node([2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30]), a=3, b=12, list2=list_node([999, 888, 777, 666, 555, 444])), list_node([2, 4, 6, 999, 888, 777, 666, 555, 444, 28, 30]))",
"assert is_same_list(candidate(list1=list_node([6, 7, 8, 9, 10, 11, 12]), a=2, b=4, l... | newfacade/LeetCodeDataset | {
"constraints": [
"assert is_same_list(candidate(list1=list_node([2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30]), a=3, b=12, list2=list_node([999, 888, 777, 666, 555, 444])), list_node([2, 4, 6, 999, 888, 777, 666, 555, 444, 28, 30]))",
"assert is_same_list(candidate(list1=list_node([6, 7, 8, 9, 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 may recall that an array arr is a mountain array if and only if:\n\nar... | You are an expert Python programmer. 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 may recall that an array arr is a mountain array if and only if:
arr.length >= 3
There exists some index i (0-inde... | [
"assert candidate(nums=[1, 2, 1, 3, 2, 4, 3, 5, 4, 6, 5, 7, 6, 8, 7, 9, 8, 7, 6, 5, 4, 3, 2, 1]) == 7",
"assert candidate(nums=[1, 2, 3, 4, 5, 3, 2, 1, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]) == 3",
"assert candidate(nums=[1, 3, 5, 7, 9, 11, 10, 9, 7, 5, 3, 1, 2, 4, 6, 8, 10, 12]) == 6",
"assert candidate(nums=[1, 10... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[1, 2, 1, 3, 2, 4, 3, 5, 4, 6, 5, 7, 6, 8, 7, 9, 8, 7, 6, 5, 4, 3, 2, 1]) == 7",
"assert candidate(nums=[1, 2, 3, 4, 5, 3, 2, 1, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]) == 3",
"assert candidate(nums=[1, 3, 5, 7, 9, 11, 10, 9, 7, 5, 3, 1, 2, 4, 6, 8, 10, 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:\nGiven an integer array nums and a positive integer k, return the most comp... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
Given an integer array nums and a positive integer k, return the most competitive subsequence of nums of size k.
An arr... | [
"assert candidate(nums=[8, 6, 5, 7, 3, 4, 1, 2, 9, 0], k=4) == [1, 2, 9, 0]",
"assert candidate(nums=[1, 1, 2, 2, 3, 3, 4, 4, 5, 5], k=4) == [1, 1, 2, 2]",
"assert candidate(nums=[3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5, 9], k=6) == [1, 1, 2, 3, 5, 9]",
"assert candidate(nums=[1, 2, 3, 4, 5, 6, 7], k=5) == [1, 2, 3, ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[8, 6, 5, 7, 3, 4, 1, 2, 9, 0], k=4) == [1, 2, 9, 0]",
"assert candidate(nums=[1, 1, 2, 2, 3, 3, 4, 4, 5, 5], k=4) == [1, 1, 2, 2]",
"assert candidate(nums=[3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5, 9], k=6) == [1, 1, 2, 3, 5, 9]",
"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:\nYou are given an integer array nums of even length n and an integer limit.... | You are an expert Python programmer. 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 even length n and an integer limit. In one move, you can replace any integer fro... | [
"assert candidate(nums=[42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42], limit=84) == 0",
"assert candidate(nums=[30000, 30000, 30000, 30000, 30000, 30000, 30000, 30000, 30000, 30000, 30000, 30000], limit=60000) == 0",
"assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], limit=12) == 0",
"assert ca... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42], limit=84) == 0",
"assert candidate(nums=[30000, 30000, 30000, 30000, 30000, 30000, 30000, 30000, 30000, 30000, 30000, 30000], limit=60000) == 0",
"assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], limi... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an array nums of n positive integers.\nYou can perform two 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 array nums of n positive integers.
You can perform two types of operations on any element of the array... | [
"assert candidate(nums=[999999999, 1000000000, 999999998, 1000000001, 999999997, 1000000002]) == 5",
"assert candidate(nums=[1, 2, 9, 16]) == 7",
"assert candidate(nums=[1000000000, 1, 2, 3, 4, 5]) == 1953123",
"assert candidate(nums=[1024, 2048, 3072, 4096, 5120, 6144, 7168, 8192, 9216, 10240, 11264, 12288, ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[999999999, 1000000000, 999999998, 1000000001, 999999997, 1000000002]) == 5",
"assert candidate(nums=[1, 2, 9, 16]) == 7",
"assert candidate(nums=[1000000000, 1, 2, 3, 4, 5]) == 1953123",
"assert candidate(nums=[1024, 2048, 3072, 4096, 5120, 6144, 7168, 8192, ... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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.\nIn one operation, y... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given an integer array nums and an integer k.
In one operation, you can pick two numbers from the array whose s... | [
"assert candidate(nums=[1, 5, 7, 8, 2, 6, 3, 4], k=9) == 4",
"assert candidate(nums=[3, 1, 3, 4, 3, 5, 6, 2, 3, 1], k=6) == 4",
"assert candidate(nums=[1, 3, 3, 5, 7, 7, 5, 9, 9, 11, 11, 13], k=12) == 5",
"assert candidate(nums=[1, 3, 5, 7, 9], k=10) == 2",
"assert candidate(nums=[1, 1, 1, 1, 1, 1, 1, 1, 1,... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[1, 5, 7, 8, 2, 6, 3, 4], k=9) == 4",
"assert candidate(nums=[3, 1, 3, 4, 3, 5, 6, 2, 3, 1], k=6) == 4",
"assert candidate(nums=[1, 3, 3, 5, 7, 7, 5, 9, 9, 11, 11, 13], k=12) == 5",
"assert candidate(nums=[1, 3, 5, 7, 9], k=10) == 2",
"assert candidate(num... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an integer array nums and an integer k. You are asked to ... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given an integer array nums and an integer k. You are asked to distribute this array into k subsets of equal... | [
"assert candidate(nums=[1, 2, 3, 4, 5, 5, 6, 7, 8, 8, 9, 10, 11, 11, 12, 13], k=4) == 15",
"assert candidate(nums=[1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6, 6, 7], k=2) == -1",
"assert candidate(nums=[1, 2, 3, 4, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12], k=8) == 11",
"assert candidate(nums=[1, 2, 3, 4, 5, 6, 7... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[1, 2, 3, 4, 5, 5, 6, 7, 8, 8, 9, 10, 11, 11, 12, 13], k=4) == 15",
"assert candidate(nums=[1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6, 6, 7], k=2) == -1",
"assert candidate(nums=[1, 2, 3, 4, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12], k=8) == 11",
"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:\nA subsequence of a string s is considered a good palindromic subsequence i... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
A subsequence of a string s is considered a good palindromic subsequence if:
It is a subsequence of s.
It is a palindr... | [
"assert candidate(s='bbabab') == 4",
"assert candidate(s='abcdefghijklmnopqrstuvwxyzzyxwvutsrqponmlkjihgfedcba') == 52",
"assert candidate(s='abcdefghijjiabcdefghij') == 6",
"assert candidate(s='zzzzzzzzzzzzzzzzzzzz') == 2",
"assert candidate(s='abcdabcdabcdabcdabcd') == 8",
"assert candidate(s='abcabcabc... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(s='bbabab') == 4",
"assert candidate(s='abcdefghijklmnopqrstuvwxyzzyxwvutsrqponmlkjihgfedcba') == 52",
"assert candidate(s='abcdefghijjiabcdefghij') == 6",
"assert candidate(s='zzzzzzzzzzzzzzzzzzzz') == 2",
"assert candidate(s='abcdabcdabcdabcdabcd') == 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 sorted in non-decreasing order.\nBuild... | You are an expert Python programmer. 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 sorted in non-decreasing order.
Build and return an integer array result with the s... | [
"assert candidate(nums=[1, 10, 100, 1000, 10000, 100000, 1000000]) == [1111104, 1111059, 1110789, 1109889, 1118889, 1388889, 5888889]",
"assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10]) == [135, 117, 101, 87, 75, 65, 57, 51, 47, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[1, 10, 100, 1000, 10000, 100000, 1000000]) == [1111104, 1111059, 1110789, 1109889, 1118889, 1388889, 5888889]",
"assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10]) == [135, 117, 101, 87, 75, 65, 57, 51, 47, 45, 45, 45, 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:\nAlice and Bob take turns playing a game, with Alice starting first.\nThere... | You are an expert Python programmer. 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.
There are n stones in a pile. On each player's turn... | [
"assert candidate(aliceValues=[1, 3, 5, 7, 9, 11, 13, 15, 17, 19], bobValues=[19, 17, 15, 13, 11, 9, 7, 5, 3, 1]) == 0",
"assert candidate(aliceValues=[1, 100, 1, 100, 1, 100, 1, 100, 1, 100], bobValues=[100, 1, 100, 1, 100, 1, 100, 1, 100, 1]) == 0",
"assert candidate(aliceValues=[90, 80, 70, 60, 50, 40, 30, 2... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(aliceValues=[1, 3, 5, 7, 9, 11, 13, 15, 17, 19], bobValues=[19, 17, 15, 13, 11, 9, 7, 5, 3, 1]) == 0",
"assert candidate(aliceValues=[1, 100, 1, 100, 1, 100, 1, 100, 1, 100], bobValues=[100, 1, 100, 1, 100, 1, 100, 1, 100, 1]) == 0",
"assert candidate(aliceValues=[90, ... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 the task of delivering some boxes from storage to their ports usi... | You are an expert Python programmer. 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 the task of delivering some boxes from storage to their ports using only one ship. However, this ship has a li... | [
"assert candidate(boxes=[[1, 10], [2, 10], [3, 10], [4, 10], [5, 10]], portsCount=5, maxBoxes=5, maxWeight=50) == 6",
"assert candidate(boxes=[[1, 3], [2, 2], [1, 4], [2, 2], [3, 1]], portsCount=3, maxBoxes=3, maxWeight=10) == 7",
"assert candidate(boxes=[[1, 100], [2, 100], [3, 100], [4, 100], [5, 100]], ports... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(boxes=[[1, 10], [2, 10], [3, 10], [4, 10], [5, 10]], portsCount=5, maxBoxes=5, maxWeight=50) == 6",
"assert candidate(boxes=[[1, 3], [2, 2], [1, 4], [2, 2], [3, 1]], portsCount=3, maxBoxes=3, maxWeight=10) == 7",
"assert candidate(boxes=[[1, 100], [2, 100], [3, 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 decimal number is called deci-binary if each of its digits is either 0 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:
A decimal number is called deci-binary if each of its digits is either 0 or 1 without any leading zeros. For example, 1... | [
"assert candidate(n='191919191919191919191919191919191919191919191919191') == 9",
"assert candidate(n='10101010101010101010') == 1",
"assert candidate(n='87654321098765432109') == 9",
"assert candidate(n='111999888777666555444333222111') == 9",
"assert candidate(n='918273645432187654321') == 9",
"assert c... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(n='191919191919191919191919191919191919191919191919191') == 9",
"assert candidate(n='10101010101010101010') == 1",
"assert candidate(n='87654321098765432109') == 9",
"assert candidate(n='111999888777666555444333222111') == 9",
"assert candidate(n='9182736454321... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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.\nThere... | You are an expert Python programmer. 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.
There are n stones arranged in a row. On each playe... | [
"assert candidate(stones=[1, 10, 100, 1000, 10, 100, 1000, 10, 100, 1000, 10, 100, 1000, 10, 100]) == 2230",
"assert candidate(stones=[1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288]) == 699050",
"assert candidate(stones=[999, 1, 998, 2, 997, 3, 996, 4... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(stones=[1, 10, 100, 1000, 10, 100, 1000, 10, 100, 1000, 10, 100, 1000, 10, 100]) == 2230",
"assert candidate(stones=[1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288]) == 699050",
"assert candidate(stones=[999, ... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven n cuboids where the dimensions of the ith cuboid is cuboids[i] = [wi... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
Given n cuboids where the dimensions of the ith cuboid is cuboids[i] = [widthi, lengthi, heighti] (0-indexed). Choose a... | [
"assert candidate(cuboids=[[3, 4, 5], [3, 3, 3], [3, 5, 5], [2, 3, 4], [2, 2, 2], [1, 1, 1], [1, 2, 3]]) == 18",
"assert candidate(cuboids=[[20, 20, 20], [20, 20, 15], [20, 15, 10], [15, 10, 5]]) == 75",
"assert candidate(cuboids=[[20, 20, 20], [19, 19, 19], [18, 18, 18], [17, 17, 17], [16, 16, 16], [15, 15, 15... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(cuboids=[[3, 4, 5], [3, 3, 3], [3, 5, 5], [2, 3, 4], [2, 2, 2], [1, 1, 1], [1, 2, 3]]) == 18",
"assert candidate(cuboids=[[20, 20, 20], [20, 20, 15], [20, 15, 10], [15, 10, 5]]) == 75",
"assert candidate(cuboids=[[20, 20, 20], [19, 19, 19], [18, 18, 18], [17, 17, 17], ... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 positive integers nums and want to erase a subar... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given an array of positive integers nums and want to erase a subarray containing unique elements. The score you... | [
"assert candidate(nums=[10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 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]) == 55",
"assert candidate(nums=[1, 2, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 1, 1, 1, 1]) == 55",
"assert candidate(nums=[10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 10, 9, 8, 7, 6, 5,... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 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]) == 55",
"assert candidate(nums=[1, 2, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 1, 1, 1, 1]) == 55",
"assert candidate(nums=[10, 9, 8, 7, 6, 5, 4, 3,... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed integer array nums and an integer k.\nYou are in... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given a 0-indexed integer array nums and an integer k.
You are initially standing at index 0. In one move, you ... | [
"assert candidate(nums=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1], k=1) == 10",
"assert candidate(nums=[100, -100, 100, -100, 100, -100, 100], k=2) == 400",
"assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], k=1) == 55",
"assert candidate(nums=[10, 9, 8, 7, 6, 5, 4, 3, 2, 1], k=5) == 55",
"assert candidate(nums=[1... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1], k=1) == 10",
"assert candidate(nums=[100, -100, 100, -100, 100, -100, 100], k=2) == 400",
"assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], k=1) == 55",
"assert candidate(nums=[10, 9, 8, 7, 6, 5, 4, 3, 2, 1], k=5) == 55",
... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nAn undirected graph of n nodes is defined by edgeList, where edgeList[i] =... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
An undirected graph of n nodes is defined by edgeList, where edgeList[i] = [ui, vi, disi] denotes an edge between nodes... | [
"assert candidate(n=8, edgeList=[[0, 1, 1], [0, 2, 2], [0, 3, 3], [1, 4, 4], [1, 5, 5], [2, 6, 6], [2, 7, 7], [3, 4, 8], [3, 5, 9], [4, 6, 10], [5, 7, 11]], queries=[[0, 7, 12], [1, 6, 10], [2, 5, 9], [3, 4, 8], [0, 4, 7]]) == [True, True, True, True, True]",
"assert candidate(n=5, edgeList=[[0, 1, 10], [1, 2, 5]... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(n=8, edgeList=[[0, 1, 1], [0, 2, 2], [0, 3, 3], [1, 4, 4], [1, 5, 5], [2, 6, 6], [2, 7, 7], [3, 4, 8], [3, 5, 9], [4, 6, 10], [5, 7, 11]], queries=[[0, 7, 12], [1, 6, 10], [2, 5, 9], [3, 4, 8], [0, 4, 7]]) == [True, True, True, True, True]",
"assert candidate(n=5, edgeList... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 restaurant with a single chef. You are given an array customers... | You are an expert Python programmer. 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 restaurant with a single chef. You are given an array customers, where customers[i] = [arrivali, timei]:
ar... | [
"assert candidate(customers=[[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]]) == 1.0",
"assert candidate(customers=[[1, 10000], [1, 10000], [1, 10000], [1, 10000], [1, 10000], [1, 10000], [1, 10000], [1, 10000], [1, 10000], [1, 10000]])... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(customers=[[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]]) == 1.0",
"assert candidate(customers=[[1, 10000], [1, 10000], [1, 10000], [1, 10000], [1, 10000], [1, 10000], [1, 10000], [1, 10000], [... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 consisting of only 0's or 1's. You ca... | You are an expert Python programmer. 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 consisting of only 0's or 1's. You can apply each of the following operations any ... | [
"assert candidate(binary='000110') == '111011'",
"assert candidate(binary='000111000') == '111110111'",
"assert candidate(binary='01010101010101010101') == '11111111101111111111'",
"assert candidate(binary='0000000000000000000000000000000000000000000000000000000000000000000000000000') == '11111111111111111111... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(binary='000110') == '111011'",
"assert candidate(binary='000111000') == '111110111'",
"assert candidate(binary='01010101010101010101') == '11111111101111111111'",
"assert candidate(binary='0000000000000000000000000000000000000000000000000000000000000000000000000000... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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. nums comprises of ... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given an integer array, nums, and an integer k. nums comprises of only 0's and 1's. In one move, you can choose... | [
"assert candidate(nums=[0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0], k=5) == 5",
"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, 0, 1, 0, 1, 0, 1], k=10) == 25",
"assert candidate(nums=[0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1], k=6)... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0], k=5) == 5",
"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, 0, 1, 0, 1, 0, 1], k=10) == 25",
"assert candidate(nums=[0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 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:\nThere is a special kind of apple tree that grows apples every day for n da... | You are an expert Python programmer. 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 special kind of apple tree that grows apples every day for n days. On the ith day, the tree grows apples[i] ... | [
"assert candidate(apples=[3, 2, 1, 0, 4, 3, 2, 1, 0, 5, 4, 3, 2, 1, 0], days=[5, 4, 3, 0, 4, 3, 2, 1, 0, 4, 3, 2, 1, 0, 5]) == 12",
"assert candidate(apples=[3, 2, 1, 0, 0, 4, 2, 1, 0, 1], days=[2, 2, 2, 0, 0, 3, 2, 2, 0, 1]) == 9",
"assert candidate(apples=[5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(apples=[3, 2, 1, 0, 4, 3, 2, 1, 0, 5, 4, 3, 2, 1, 0], days=[5, 4, 3, 0, 4, 3, 2, 1, 0, 4, 3, 2, 1, 0, 5]) == 12",
"assert candidate(apples=[3, 2, 1, 0, 0, 4, 2, 1, 0, 1], days=[2, 2, 2, 0, 0, 3, 2, 2, 0, 1]) == 9",
"assert candidate(apples=[5, 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 have a 2-D grid of size m x n representing a box, and you have n balls... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You have a 2-D grid of size m x n representing a box, and you have n balls. The box is open on the top and bottom sides... | [
"assert candidate(grid=[[1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1], [1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1], [1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1], [1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1]]) == [4, 5, -1, -1, -1, -1, -1, -1, -1, -1, 6]",
"assert candidate(grid=[[1, 1, -1, -1, 1, 1, -1, -1, 1, 1], [1, -1, -1, 1, 1, -1, ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(grid=[[1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1], [1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1], [1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1], [1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1]]) == [4, 5, -1, -1, -1, -1, -1, -1, -1, -1, 6]",
"assert candidate(grid=[[1, 1, -1, -1, 1, 1, -1, -1, 1, 1],... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an array nums consisting of non-negative integers. You are a... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given an array nums consisting of non-negative integers. You are also given a queries array, where queries[i] =... | [
"assert candidate(nums=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100], queries=[[10, 10], [20, 20], [30, 30], [40, 40], [50, 50], [60, 60], [70, 70], [80, 80], [90, 90], [100, 100], [5, 100], [105, 100]]) == [0, 30, 20, 60, 56, 54, 122, 120, 114, 122, 97, 125]",
"assert candidate(nums=[1024, 2048, 4096, 8192, 16384], ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100], queries=[[10, 10], [20, 20], [30, 30], [40, 40], [50, 50], [60, 60], [70, 70], [80, 80], [90, 90], [100, 100], [5, 100], [105, 100]]) == [0, 30, 20, 60, 56, 54, 122, 120, 114, 122, 97, 125]",
"assert candidate(nums=[1024, 204... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 good meal is a meal that contains exactly two different food items with ... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
A good meal is a meal that contains exactly two different food items with a sum of deliciousness equal to a power of tw... | [
"assert candidate(deliciousness=[1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072]) == 0",
"assert candidate(deliciousness=[1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10]) == 28",
"assert candidate(deliciousness=[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23,... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(deliciousness=[1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072]) == 0",
"assert candidate(deliciousness=[1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10]) == 28",
"assert candidate(deliciousness=[1, 3, 5, 7, 9, 11... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.