prompt listlengths 1 1 | query stringlengths 578 3.33k | constraints listlengths 10 10 | data_source stringclasses 1
value | extra_info dict |
|---|---|---|---|---|
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nA split of an integer array is good if:\n\nThe array is split into three n... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
A split of an integer array is good if:
The array is split into three non-empty contiguous subarrays - named left, mid... | [
"assert candidate(nums=[1, 3, 2, 2, 1, 1]) == 1",
"assert candidate(nums=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) == 385",
"assert candidate(nums=[... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[1, 3, 2, 2, 1, 1]) == 1",
"assert candidate(nums=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) == 385",
... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an array target that consists of distinct integers and anoth... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given an array target that consists of distinct integers and another integer array arr that can have duplicates... | [
"assert candidate(target=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], arr=[2, 4, 6, 8, 10, 1, 3, 5, 7, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == 0",
"assert candidate(target=[5, 7, 9, 11, 13, 15, 17, 19, 21, 23], arr=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23]) == 0",
"assert candidate(t... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(target=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], arr=[2, 4, 6, 8, 10, 1, 3, 5, 7, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == 0",
"assert candidate(target=[5, 7, 9, 11, 13, 15, 17, 19, 21, 23], arr=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23]) == 0"... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed integer array nums consisting of n non-negative ... | You are an expert Python programmer. 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 consisting of n non-negative integers.
You are also given an array queries... | [
"assert candidate(nums=[9, 8, 7, 6, 5, 4, 3, 2, 1, 0], queries=[[0, 1], [2, 3], [4, 5], [6, 7], [8, 9]]) == [45, 12, 5, 3, 1]",
"assert candidate(nums=[9, 8, 7, 6, 5, 4, 3, 2, 1], queries=[[0, 1], [1, 1], [2, 1], [3, 1], [4, 1], [5, 1], [6, 1], [7, 1], [8, 1]]) == [45, 36, 28, 21, 15, 10, 6, 3, 1]",
"assert can... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[9, 8, 7, 6, 5, 4, 3, 2, 1, 0], queries=[[0, 1], [2, 3], [4, 5], [6, 7], [8, 9]]) == [45, 12, 5, 3, 1]",
"assert candidate(nums=[9, 8, 7, 6, 5, 4, 3, 2, 1], queries=[[0, 1], [1, 1], [2, 1], [3, 1], [4, 1], [5, 1], [6, 1], [7, 1], [8, 1]]) == [45, 36, 28, 21, 15, 10, 6... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a string s and two integers x and y. You can perform two typ... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given a string s and two integers x and y. You can perform two types of operations any number of times.
Remove... | [
"assert candidate(s='zababxyzab', x=4, y=5) == 13",
"assert candidate(s='ababababababababababababababababababababababababababababa', x=2, y=3) == 84",
"assert candidate(s='ababababababababab', x=100, y=1) == 900",
"assert candidate(s='ababbaabababababab', x=6, y=7) == 62",
"assert candidate(s='bbabababababa... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(s='zababxyzab', x=4, y=5) == 13",
"assert candidate(s='ababababababababababababababababababababababababababababa', x=2, y=3) == 84",
"assert candidate(s='ababababababababab', x=100, y=1) == 900",
"assert candidate(s='ababbaabababababab', x=6, y=7) == 62",
"asse... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven an integer n, find a sequence with elements in the range [1, n] that... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
Given an integer n, find a sequence with elements in the range [1, n] that satisfies all of the following:
The integer... | [
"assert candidate(n=16) == [16, 14, 15, 11, 9, 13, 6, 4, 12, 10, 1, 4, 6, 9, 11, 14, 16, 15, 13, 10, 12, 8, 5, 7, 2, 3, 2, 5, 3, 8, 7]",
"assert candidate(n=2) == [2, 1, 2]",
"assert candidate(n=10) == [10, 8, 6, 9, 3, 1, 7, 3, 6, 8, 10, 5, 9, 7, 4, 2, 5, 2, 4]",
"assert candidate(n=20) == [20, 18, 19, 15, 13... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(n=16) == [16, 14, 15, 11, 9, 13, 6, 4, 12, 10, 1, 4, 6, 9, 11, 14, 16, 15, 13, 10, 12, 8, 5, 7, 2, 3, 2, 5, 3, 8, 7]",
"assert candidate(n=2) == [2, 1, 2]",
"assert candidate(n=10) == [10, 8, 6, 9, 3, 1, 7, 3, 6, 8, 10, 5, 9, 7, 4, 2, 5, 2, 4]",
"assert candidate(n... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an array pairs, where pairs[i] = [xi, yi], and:\n\nThere are... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given an array pairs, where pairs[i] = [xi, yi], and:
There are no duplicates.
xi < yi
Let ways be the number... | [
"assert candidate(pairs=[[1, 15], [1, 14], [1, 13], [1, 12], [1, 11], [1, 10], [1, 9], [1, 8], [1, 7], [1, 6], [1, 5], [1, 4], [1, 3], [1, 2]]) == 1",
"assert candidate(pairs=[[1, 2], [1, 3], [2, 4], [2, 5], [3, 6], [3, 7], [4, 8], [4, 9], [5, 10], [6, 11], [7, 12], [8, 13], [9, 14], [10, 15], [11, 16]]) == 0",
... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(pairs=[[1, 15], [1, 14], [1, 13], [1, 12], [1, 11], [1, 10], [1, 9], [1, 8], [1, 7], [1, 6], [1, 5], [1, 4], [1, 3], [1, 2]]) == 1",
"assert candidate(pairs=[[1, 2], [1, 3], [2, 4], [2, 5], [3, 6], [3, 7], [4, 8], [4, 9], [5, 10], [6, 11], [7, 12], [8, 13], [9, 14], [10, 1... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given two integer arrays, source and target, both of length n. You... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given two integer arrays, source and target, both of length n. You are also given an array allowedSwaps where e... | [
"assert candidate(source=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], target=[2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], allowedSwaps=[[0, 19], [1, 18], [2, 17], [3, 16], [4, 15], [5, 14], [6, 13], [7, 12], [8, 11], [9, 10]]) == 20",
"assert candidate(source=[1, 2, 3, 4, 5, 6, 7... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(source=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], target=[2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], allowedSwaps=[[0, 19], [1, 18], [2, 17], [3, 16], [4, 15], [5, 14], [6, 13], [7, 12], [8, 11], [9, 10]]) == 20",
"assert candidate(sour... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 jobs, where jobs[i] is the amount of time 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 jobs, where jobs[i] is the amount of time it takes to complete the ith job.
There are k ... | [
"assert candidate(jobs=[2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], k=8) == 4",
"assert candidate(jobs=[20, 10, 30, 25, 15, 5, 40, 35, 50, 100, 200, 50], k=3) == 200",
"assert candidate(jobs=[3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3], k=2) == 18",
"assert candidate(jobs=[5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60], k=6... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(jobs=[2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], k=8) == 4",
"assert candidate(jobs=[20, 10, 30, 25, 15, 5, 40, 35, 50, 100, 200, 50], k=3) == 200",
"assert candidate(jobs=[3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3], k=2) == 18",
"assert candidate(jobs=[5, 10, 15, 20, 25, 30, 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 binary matrix matrix of size m x n, and you are allowed to... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given a binary matrix matrix of size m x n, and you are allowed to rearrange the columns of the matrix in any o... | [
"assert candidate(matrix=[[1, 0, 1, 0, 1, 0, 1, 0, 1, 0], [0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0], [0, 1, 0, 1, 0, 1, 0, 1, 0, 1]]) == 5",
"assert candidate(matrix=[[1, 1, 1, 1, 0], [1, 0, 1, 1, 1], [1, 1, 0, 1, 1], [1, 1, 1, 1, 1]]) == 9",
"assert candidate(matrix=[[1, 1, 1], [1, 0, 1], ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(matrix=[[1, 0, 1, 0, 1, 0, 1, 0, 1, 0], [0, 1, 0, 1, 0, 1, 0, 1, 0, 1], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0], [0, 1, 0, 1, 0, 1, 0, 1, 0, 1]]) == 5",
"assert candidate(matrix=[[1, 1, 1, 1, 0], [1, 0, 1, 1, 1], [1, 1, 0, 1, 1], [1, 1, 1, 1, 1]]) == 9",
"assert candidate(matri... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nA game is played by a cat and a mouse named Cat and Mouse.\nThe environmen... | You are an expert Python programmer. 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 game is played by a cat and a mouse named Cat and Mouse.
The environment is represented by a grid of size rows x cols... | [
"assert candidate(grid=['M....', '.....', '#....', '..C..', '...F.'], catJump=3, mouseJump=1) == False",
"assert candidate(grid=['M......', '#F.C.#.'], catJump=2, mouseJump=3) == False",
"assert candidate(grid=['M......', '.......', '.......', '....C..', '.......', '.......', '......F'], catJump=2, mouseJump=3)... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(grid=['M....', '.....', '#....', '..C..', '...F.'], catJump=3, mouseJump=1) == False",
"assert candidate(grid=['M......', '#F.C.#.'], catJump=2, mouseJump=3) == False",
"assert candidate(grid=['M......', '.......', '.......', '....C..', '.......', '.......', '......F']... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nOn a social network consisting of m users and some friendships between use... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
On a social network consisting of m users and some friendships between users, two users can communicate with each other... | [
"assert candidate(n=9, languages=[[1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 1]], friendships=[[1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 1], [1, 3], [2, 4], [3, 5], [4, 6], [5, 7], [6, 8], [7, 9], [8, 1], [9, 2]]) == 7",
"assert candidate(n=3, languages=[[1, 2, 3... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(n=9, languages=[[1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 1]], friendships=[[1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 1], [1, 3], [2, 4], [3, 5], [4, 6], [5, 7], [6, 8], [7, 9], [8, 1], [9, 2]]) == 7",
"assert candidate(n... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given two strings a and b that consist of lowercase letters. In on... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given two strings a and b that consist of lowercase letters. In one operation, you can change any character in ... | [
"assert candidate(a='mnopqrstuvwxy', b='abcdefghijklmnopqrstuvwxyz') == 14",
"assert candidate(a='xyz', b='xyz') == 3",
"assert candidate(a='zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz', b='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') == 0",
"asse... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(a='mnopqrstuvwxy', b='abcdefghijklmnopqrstuvwxyz') == 14",
"assert candidate(a='xyz', b='xyz') == 3",
"assert candidate(a='zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz', b='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 cubic storeroom where the width, length, and height of the room... | You are an expert Python programmer. 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 cubic storeroom where the width, length, and height of the room are all equal to n units. You are asked to p... | [
"assert candidate(n=500000) == 10365",
"assert candidate(n=314) == 73",
"assert candidate(n=987654321) == 1636751",
"assert candidate(n=334) == 76",
"assert candidate(n=319) == 74",
"assert candidate(n=318) == 74",
"assert candidate(n=3375) == 365",
"assert candidate(n=50) == 20",
"assert candidate(... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(n=500000) == 10365",
"assert candidate(n=314) == 73",
"assert candidate(n=987654321) == 1636751",
"assert candidate(n=334) == 76",
"assert candidate(n=319) == 74",
"assert candidate(n=318) == 74",
"assert candidate(n=3375) == 365",
"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 the root of a binary tree and two integers p and q, return the dista... | You are an expert Python programmer. 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 two integers p and q, return the distance between the nodes of value p and value q ... | [
"assert candidate(root=tree_node([4, 2, 7, 1, 3, 6, 9]), p=2, q=6) == 3",
"assert candidate(root=tree_node([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]), p=8, q=15) == 6",
"assert candidate(root=tree_node([2, 1]), p=1, q=2) == 1",
"assert candidate(root=tree_node([1, 2, 3, 4, 5, 6, 7, 8, 9]), p=8, q=9)... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(root=tree_node([4, 2, 7, 1, 3, 6, 9]), p=2, q=6) == 3",
"assert candidate(root=tree_node([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]), p=8, q=15) == 6",
"assert candidate(root=tree_node([2, 1]), p=1, q=2) == 1",
"assert candidate(root=tree_node([1, 2, 3, 4,... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nThere is an integer array nums that consists of n unique elements, but 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:
There is an integer array nums that consists of n unique elements, but you have forgotten it. However, you do remember ... | [
"assert candidate(adjacentPairs=[[1, 3], [3, 5], [5, 7], [7, 9], [9, 11], [11, 13], [13, 15], [15, 17], [17, 19], [19, 21], [21, 23], [23, 25], [25, 27], [27, 29], [29, 31], [31, 33], [33, 35], [35, 37], [37, 39]]) == [1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39]",
"assert candidate(... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(adjacentPairs=[[1, 3], [3, 5], [5, 7], [7, 9], [9, 11], [11, 13], [13, 15], [15, 17], [17, 19], [19, 21], [21, 23], [23, 25], [25, 27], [27, 29], [29, 31], [31, 33], [33, 35], [35, 37], [37, 39]]) == [1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39]",... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a (0-indexed) array of positive integers candiesCount where ... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given a (0-indexed) array of positive integers candiesCount where candiesCount[i] represents the number of cand... | [
"assert candidate(candiesCount=[1000000000, 1000000000, 1000000000], queries=[[0, 500000000, 500000000], [1, 1500000000, 500000000], [2, 2500000000, 500000000]]) == [True, True, True]",
"assert candidate(candiesCount=[1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 10000], queries=[[0, 1000, 500], [1, 3000,... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(candiesCount=[1000000000, 1000000000, 1000000000], queries=[[0, 500000000, 500000000], [1, 1500000000, 500000000], [2, 2500000000, 500000000]]) == [True, True, True]",
"assert candidate(candiesCount=[1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 10000], queries=[[0... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an integer array nums. You must perform exactly one operatio... | You are an expert Python programmer. 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 must perform exactly one operation where you can replace one element nums[i] w... | [
"assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]) == 590",
"assert candidate(nums=[0, -2, 3, 5, -1, 2]) == 29",
"assert candidate(nums=[-5000, 5000, -5000, 5000, -5000, 5000, -5000, 5000, -5000]) == 25010000",
"assert candidate(nums=[-1, 1, -1, 1, -1, 1, -1, 1, -1... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]) == 590",
"assert candidate(nums=[0, -2, 3, 5, -1, 2]) == 29",
"assert candidate(nums=[-5000, 5000, -5000, 5000, -5000, 5000, -5000, 5000, -5000]) == 25010000",
"assert candidate(nums=[-1,... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an integer array nums. The absolute sum of a subarray [numsl... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given an integer array nums. The absolute sum of a subarray [numsl, numsl+1, ..., numsr-1, numsr] is abs(numsl ... | [
"assert candidate(nums=[1, 2, 3, 4, 5, -5, -4, -3, -2, -1, 1, 2, 3, 4, 5, -5, -4, -3, -2, -1]) == 15",
"assert candidate(nums=[-10000, -10000, 20000, -10000, -10000, 20000, -10000, -10000, 20000, -10000, -10000, 20000]) == 20000",
"assert candidate(nums=[10, -10, 20, -20, 30, -30, 40, -40, 50, -50]) == 50",
"... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[1, 2, 3, 4, 5, -5, -4, -3, -2, -1, 1, 2, 3, 4, 5, -5, -4, -3, -2, -1]) == 15",
"assert candidate(nums=[-10000, -10000, 20000, -10000, -10000, 20000, -10000, -10000, 20000, -10000, -10000, 20000]) == 20000",
"assert candidate(nums=[10, -10, 20, -20, 30, -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:\nGiven a string s consisting only of characters 'a', 'b', and 'c'. You are ... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
Given a string s consisting only of characters 'a', 'b', and 'c'. You are asked to apply the following algorithm on the... | [
"assert candidate(s='cbbccbbcc') == 0",
"assert candidate(s='aaaaaaaaaaaaaaaaaaaaaaaaaaa') == 0",
"assert candidate(s='abccbaabcba') == 0",
"assert candidate(s='abacabadabacaba') == 1",
"assert candidate(s='aaabaaaabbaaaabaa') == 0",
"assert candidate(s='aaabbbcccbaabbbcccbaaabbb') == 25",
"assert candi... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(s='cbbccbbcc') == 0",
"assert candidate(s='aaaaaaaaaaaaaaaaaaaaaaaaaaa') == 0",
"assert candidate(s='abccbaabcba') == 0",
"assert candidate(s='abacabadabacaba') == 1",
"assert candidate(s='aaabaaaabbaaaabaa') == 0",
"assert candidate(s='aaabbbcccbaabbbcccba... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an array of events where events[i] = [startDayi, endDayi, va... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given an array of events where events[i] = [startDayi, endDayi, valuei]. The ith event starts at startDayi and ... | [
"assert candidate(events=[[1, 2, 10], [2, 3, 20], [3, 4, 30], [4, 5, 40], [5, 6, 50], [6, 7, 60], [7, 8, 70], [8, 9, 80], [9, 10, 90], [10, 11, 100], [11, 12, 110], [12, 13, 120]], k=6) == 420",
"assert candidate(events=[[1, 1, 1], [2, 2, 2], [3, 3, 3], [4, 4, 4], [5, 5, 5], [6, 6, 6], [7, 7, 7], [8, 8, 8], [9, 9... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(events=[[1, 2, 10], [2, 3, 20], [3, 4, 30], [4, 5, 40], [5, 6, 50], [6, 7, 60], [7, 8, 70], [8, 9, 80], [9, 10, 90], [10, 11, 100], [11, 12, 110], [12, 13, 120]], k=6) == 420",
"assert candidate(events=[[1, 1, 1], [2, 2, 2], [3, 3, 3], [4, 4, 4], [5, 5, 5], [6, 6, 6], [7, ... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given two strings word1 and word2. You want to construct a string ... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given two strings word1 and word2. You want to construct a string merge in the following way: while either word... | [
"assert candidate(word1='lexicographic', word2='merge') == 'mlexiergecographic'",
"assert candidate(word1='pqrstuvwxyz', word2='nopqrstuvwxyz') == 'pqrstuvwxyznopqrstuvwxyz'",
"assert candidate(word1='leetcode', word2='challenge') == 'leetcodechallenge'",
"assert candidate(word1='abcdxyz', word2='zyxcba') == ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(word1='lexicographic', word2='merge') == 'mlexiergecographic'",
"assert candidate(word1='pqrstuvwxyz', word2='nopqrstuvwxyz') == 'pqrstuvwxyznopqrstuvwxyz'",
"assert candidate(word1='leetcode', word2='challenge') == 'leetcodechallenge'",
"assert candidate(word1='ab... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 goal.\nYou want to choo... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given an integer array nums and an integer goal.
You want to choose a subsequence of nums such that the sum of ... | [
"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], goal=-1) == 0",
"assert candidate(nums=[10000000, -10000000, 5000000, -5000000, 2500000, -2500000,... | 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], goal=-1) == 0",
"assert candidate(nums=[10000000, -10000000, 5000000, -5000... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven a string s, return the number of homogenous substrings of s. Since t... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
Given a string s, return the number of homogenous substrings of s. Since the answer may be too large, return it modulo ... | [
"assert candidate(s='ababababab') == 10",
"assert candidate(s='mmmmmlllllkkkkkkjjjjjjjjiiiiiiiiiiiihhhhhhhhhhhh') == 243",
"assert candidate(s='qqqqqwwweeeerrrrtttttyyyyyuuuuuiooooo') == 102",
"assert candidate(s='aabbccddeeefffggghhhhiiiiijjjjjkkkkklllllmmmmmnnnnnooooo') == 145",
"assert candidate(s='mmmmm... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(s='ababababab') == 10",
"assert candidate(s='mmmmmlllllkkkkkkjjjjjjjjiiiiiiiiiiiihhhhhhhhhhhh') == 243",
"assert candidate(s='qqqqqwwweeeerrrrtttttyyyyyuuuuuiooooo') == 102",
"assert candidate(s='aabbccddeeefffggghhhhiiiiijjjjjkkkkklllllmmmmmnnnnnooooo') == 145",
... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 where the ith bag contains nums[i] bal... | You are an expert Python programmer. 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 where the ith bag contains nums[i] balls. You are also given an integer maxOperatio... | [
"assert candidate(nums=[500000000, 500000000, 500000000, 500000000, 500000000], maxOperations=10) == 166666667",
"assert candidate(nums=[10, 20, 30, 40, 50], maxOperations=10) == 10",
"assert candidate(nums=[1000000000, 500000000, 250000000, 125000000], maxOperations=10) == 142857143",
"assert candidate(nums=... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[500000000, 500000000, 500000000, 500000000, 500000000], maxOperations=10) == 166666667",
"assert candidate(nums=[10, 20, 30, 40, 50], maxOperations=10) == 10",
"assert candidate(nums=[1000000000, 500000000, 250000000, 125000000], maxOperations=10) == 142857143",
... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 graph. You are given an integer n which is 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 undirected graph. You are given an integer n which is the number of nodes in the graph and an array ed... | [
"assert candidate(n=4, edges=[[1, 2], [1, 3], [2, 3]]) == 0",
"assert candidate(n=12, edges=[[1, 2], [1, 3], [2, 3], [2, 4], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10], [10, 11], [11, 12], [12, 1], [2, 5], [3, 5], [4, 7], [5, 7], [6, 9], [7, 9], [8, 11], [9, 11]]) == 5",
"assert candidate(n=20, edg... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(n=4, edges=[[1, 2], [1, 3], [2, 3]]) == 0",
"assert candidate(n=12, edges=[[1, 2], [1, 3], [2, 3], [2, 4], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10], [10, 11], [11, 12], [12, 1], [2, 5], [3, 5], [4, 7], [5, 7], [6, 9], [7, 9], [8, 11], [9, 11]]) == 5",
"a... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 2D integer array groups of length n. You are also given 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:
You are given a 2D integer array groups of length n. You are also given an integer array nums.
You are asked if you can... | [
"assert candidate(groups=[[1, 2], [3, 4]], nums=[1, 2, 3, 4]) == True",
"assert candidate(groups=[[1, 1, 1], [1, 1, 1]], nums=[1, 1, 1, 1, 1, 1, 1, 1]) == True",
"assert candidate(groups=[[100, 200], [200, 300], [300, 400]], nums=[100, 200, 200, 300, 300, 400]) == True",
"assert candidate(groups=[[1, 2, 3], [... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(groups=[[1, 2], [3, 4]], nums=[1, 2, 3, 4]) == True",
"assert candidate(groups=[[1, 1, 1], [1, 1, 1]], nums=[1, 1, 1, 1, 1, 1, 1, 1]) == True",
"assert candidate(groups=[[100, 200], [200, 300], [300, 400]], nums=[100, 200, 200, 300, 300, 400]) == True",
"assert can... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an integer matrix isWater of size m x n that represents a ma... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given an integer matrix isWater of size m x n that represents a map of land and water cells.
If isWater[i][j] ... | [
"assert candidate(isWater=[[0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]]) == [[4, 3, 2, 3, 4, 5], [3, 2, 1, 2, 3, 4], [2, 1, 0, 1, 2, 3], [3, 2, 1, 2, 3, 4], [4, 3, 2, 3, 4, 5]]",
"assert candidate(isWater=[[1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(isWater=[[0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]]) == [[4, 3, 2, 3, 4, 5], [3, 2, 1, 2, 3, 4], [2, 1, 0, 1, 2, 3], [3, 2, 1, 2, 3, 4], [4, 3, 2, 3, 4, 5]]",
"assert candidate(isWater=[[1, 0, 0, 0, 0, 0], [0, 0, 0, ... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nThere is a tree (i.e., a connected, undirected graph that has no cycles) 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:
There is a tree (i.e., a connected, undirected graph that has no cycles) consisting of n nodes numbered from 0 to n - 1... | [
"assert candidate(nums=[7, 5, 6, 3, 5, 3, 7, 11, 13, 17], edges=[[0, 1], [0, 2], [1, 3], [1, 4], [2, 5], [2, 6], [3, 7], [5, 8], [6, 9]]) == [-1, 0, 0, 1, 0, 0, 2, 3, 5, 6]",
"assert candidate(nums=[30, 45, 60, 75, 90, 105, 120, 135, 150, 165, 180, 195, 210], edges=[[0, 1], [0, 2], [1, 3], [1, 4], [2, 5], [2, 6],... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[7, 5, 6, 3, 5, 3, 7, 11, 13, 17], edges=[[0, 1], [0, 2], [1, 3], [1, 4], [2, 5], [2, 6], [3, 7], [5, 8], [6, 9]]) == [-1, 0, 0, 1, 0, 0, 2, 3, 5, 6]",
"assert candidate(nums=[30, 45, 60, 75, 90, 105, 120, 135, 150, 165, 180, 195, 210], edges=[[0, 1], [0, 2], [1, 3], ... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given two 0-indexed integer arrays nums and multipliers of size n ... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given two 0-indexed integer arrays nums and multipliers of size n and m respectively, where n >= m.
You begin w... | [
"assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], multipliers=[10, 9, 8, 7, 6]) == 330",
"assert candidate(nums=[100, -200, 300, -400, 500, -600, 700, -800, 900, -1000], multipliers=[1, -1, 1, -1, 1, -1]) == 4100",
"assert candidate(nums=[-5, 3, -1, 2, -4, 6, -7, 8, -9, 10], multipliers=[1, -1, 1, -1, 1, ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], multipliers=[10, 9, 8, 7, 6]) == 330",
"assert candidate(nums=[100, -200, 300, -400, 500, -600, 700, -800, 900, -1000], multipliers=[1, -1, 1, -1, 1, -1]) == 4100",
"assert candidate(nums=[-5, 3, -1, 2, -4, 6, -7, 8, -9, 10], multi... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given two strings, word1 and word2. You want to construct a string... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given two strings, word1 and word2. You want to construct a string in the following manner:
Choose some non-em... | [
"assert candidate(word1='abacabadabacaba', word2='abacabadabacaba') == 30",
"assert candidate(word1='abcabcabcabcabc', word2='cbacbacbacbacba') == 30",
"assert candidate(word1='abcdefghij', word2='jihgfedcbajihgfedcba') == 21",
"assert candidate(word1='noonnoon', word2='noonnoon') == 16",
"assert candidate(... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(word1='abacabadabacaba', word2='abacabadabacaba') == 30",
"assert candidate(word1='abcabcabcabcabc', word2='cbacbacbacbacba') == 30",
"assert candidate(word1='abcdefghij', word2='jihgfedcbajihgfedcba') == 21",
"assert candidate(word1='noonnoon', word2='noonnoon') =... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 array features where features[i] is a single word t... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given a string array features where features[i] is a single word that represents the name of a feature of the l... | [
"assert candidate(features=['featureA', 'featureB', 'featureC', 'featureD', 'featureE'], responses=['featureA featureB featureC featureD featureE', 'featureA featureB featureC featureD featureE', 'featureA featureB featureC featureD featureE', 'featureA featureB featureC featureD featureE', 'featureA featureB featu... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(features=['featureA', 'featureB', 'featureC', 'featureD', 'featureE'], responses=['featureA featureB featureC featureD featureE', 'featureA featureB featureC featureD featureE', 'featureA featureB featureC featureD featureE', 'featureA featureB featureC featureD featureE', 'fe... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 would like to make dessert and are preparing to buy the ingredients. 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 would like to make dessert and are preparing to buy the ingredients. You have n ice cream base flavors and m types ... | [
"assert candidate(baseCosts=[10000], toppingCosts=[10000, 10000, 10000, 10000, 10000], target=50000) == 50000",
"assert candidate(baseCosts=[2, 3], toppingCosts=[4, 5, 100], target=18) == 17",
"assert candidate(baseCosts=[500, 1000, 1500], toppingCosts=[5, 10, 15, 20, 25, 30, 35, 40], target=2000) == 1860",
"... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(baseCosts=[10000], toppingCosts=[10000, 10000, 10000, 10000, 10000], target=50000) == 50000",
"assert candidate(baseCosts=[2, 3], toppingCosts=[4, 5, 100], target=18) == 17",
"assert candidate(baseCosts=[500, 1000, 1500], toppingCosts=[5, 10, 15, 20, 25, 30, 35, 40], t... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given two arrays of integers nums1 and nums2, possibly of differen... | You are an expert Python programmer. 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 integers nums1 and nums2, possibly of different lengths. The values in the arrays are betwe... | [
"assert candidate(nums1=[4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4], nums2=[2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]) == 11",
"assert candidate(nums1=[1, 1], nums2=[6, 6, 6]) == 4",
"assert candidat... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums1=[4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4], nums2=[2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]) == 11",
"assert candidate(nums1=[1, 1], nums2=[6, 6, 6]) ==... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nThere are n cars traveling at different speeds in the same direction along... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
There are n cars traveling at different speeds in the same direction along a one-lane road. You are given an array cars... | [
"assert candidate(cars=[[1, 15], [4, 12], [7, 9], [10, 6], [13, 3], [16, 2], [19, 1]]) == [1.0, 1.0, 1.0, 1.0, 3.0, 3.0, -1]",
"assert candidate(cars=[[1, 2], [3, 5], [5, 10], [7, 3], [9, 8], [11, 6], [13, 7], [15, 4]]) == [-1, 2.0, 0.2857142857142857, -1, 1.0, 2.0, 0.6666666666666666, -1]",
"assert candidate(c... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(cars=[[1, 15], [4, 12], [7, 9], [10, 6], [13, 3], [16, 2], [19, 1]]) == [1.0, 1.0, 1.0, 1.0, 3.0, 3.0, -1]",
"assert candidate(cars=[[1, 2], [3, 5], [5, 10], [7, 3], [9, 8], [11, 6], [13, 7], [15, 4]]) == [-1, 2.0, 0.2857142857142857, -1, 1.0, 2.0, 0.6666666666666666, -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 n, return true if it is possible to represent n as the su... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
Given an integer n, return true if it is possible to represent n as the sum of distinct powers of three. Otherwise, ret... | [
"assert candidate(n=88573) == True",
"assert candidate(n=69192) == False",
"assert candidate(n=98411) == False",
"assert candidate(n=9841) == True",
"assert candidate(n=98409) == False",
"assert candidate(n=177147) == True",
"assert candidate(n=4782969) == True",
"assert candidate(n=32805) == False",
... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(n=88573) == True",
"assert candidate(n=69192) == False",
"assert candidate(n=98411) == False",
"assert candidate(n=9841) == True",
"assert candidate(n=98409) == False",
"assert candidate(n=177147) == True",
"assert candidate(n=4782969) == True",
"as... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an undirected graph defined by an integer n, the number of n... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given an undirected graph defined by an integer n, the number of nodes, and a 2D integer array edges, the edges... | [
"assert candidate(n=30, edges=[[1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10], [10, 11], [11, 12], [12, 13], [13, 14], [14, 15], [15, 16], [16, 17], [17, 18], [18, 19], [19, 20], [20, 21], [21, 22], [22, 23], [23, 24], [24, 25], [25, 26], [26, 27], [27, 28], [28, 29], [29, 30], [30, 1], [1,... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(n=30, edges=[[1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10], [10, 11], [11, 12], [12, 13], [13, 14], [14, 15], [15, 16], [16, 17], [17, 18], [18, 19], [19, 20], [20, 21], [21, 22], [22, 23], [23, 24], [24, 25], [25, 26], [26, 27], [27, 28], [28, 29], [... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an integer array nums and two integers limit and goal. The a... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given an integer array nums and two integers limit and goal. The array nums has an interesting property that ab... | [
"assert candidate(nums=[-100000, 100000, -100000, 100000, -100000], limit=100000, goal=50000) == 2",
"assert candidate(nums=[-1, 1, -2, 2, -3, 3, -4, 4, -5, 5], limit=5, goal=-10) == 2",
"assert candidate(nums=[1000, -1000, 1000, -1000], limit=1000, goal=1000) == 1",
"assert candidate(nums=[-1, -1, -1, -1, -1... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[-100000, 100000, -100000, 100000, -100000], limit=100000, goal=50000) == 2",
"assert candidate(nums=[-1, 1, -2, 2, -3, 3, -4, 4, -5, 5], limit=5, goal=-10) == 2",
"assert candidate(nums=[1000, -1000, 1000, -1000], limit=1000, goal=1000) == 1",
"assert candida... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nThere is an undirected weighted connected graph. You are given a positive ... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
There is an undirected weighted connected graph. You are given a positive integer n which denotes that the graph has n ... | [
"assert candidate(n=15, edges=[[1, 2, 2], [1, 3, 3], [2, 4, 5], [3, 5, 4], [4, 6, 1], [5, 7, 2], [6, 8, 3], [7, 9, 4], [8, 10, 5], [9, 11, 1], [10, 12, 2], [11, 13, 3], [12, 14, 4], [13, 15, 5], [4, 7, 2], [5, 8, 1], [6, 9, 4], [7, 10, 3], [8, 11, 2], [9, 12, 1], [10, 13, 4], [11, 14, 5], [12, 15, 1]]) == 7",
"as... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(n=15, edges=[[1, 2, 2], [1, 3, 3], [2, 4, 5], [3, 5, 4], [4, 6, 1], [5, 7, 2], [6, 8, 3], [7, 9, 4], [8, 10, 5], [9, 11, 1], [10, 12, 2], [11, 13, 3], [12, 14, 4], [13, 15, 5], [4, 7, 2], [5, 8, 1], [6, 9, 4], [7, 10, 3], [8, 11, 2], [9, 12, 1], [10, 13, 4], [11, 14, 5], [12, ... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an array nums and an integer k. The XOR of a segment... | You are an expert Python programmer. 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 and an integer k. The XOR of a segment [left, right] where left <= right is the XOR... | [
"assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], k=5) == 15",
"assert candidate(nums=[1, 2, 4, 1, 2, 5, 1, 2, 6], k=3) == 3",
"assert candidate(nums=[1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0], k=5) == 10",
"assert candidate(nums=[1, 2, 3, 4, 5, ... | 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], k=5) == 15",
"assert candidate(nums=[1, 2, 4, 1, 2, 5, 1, 2, 6], k=3) == 3",
"assert candidate(nums=[1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0], k=5) == 10",
"assert cand... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nThere is a school that has classes of students and each class will be havi... | You are an expert Python programmer. 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 school that has classes of students and each class will be having a final exam. You are given a 2D integer a... | [
"assert candidate(classes=[[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]], extraStudents=5) == 0.7966666666666666",
"assert candidate(classes=[[50, 100], [150, 300], [250, 500], [350, 700]], extraStudents=150) == 0.5803610885401075",
"assert candidate(classes=[[1, 2], [3, 6], [5, 10], [7, 14], [9, 18]], extraStudents=... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(classes=[[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]], extraStudents=5) == 0.7966666666666666",
"assert candidate(classes=[[50, 100], [150, 300], [250, 500], [350, 700]], extraStudents=150) == 0.5803610885401075",
"assert candidate(classes=[[1, 2], [3, 6], [5, 10], [7, 14],... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an array of integers nums (0-indexed) and an integer k.\nThe... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given an array of integers nums (0-indexed) and an integer k.
The score of a subarray (i, j) is defined as min(... | [
"assert candidate(nums=[1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2], k=15) == 30",
"assert candidate(nums=[1, 4, 3, 7, 4, 5], k=3) == 15",
"assert candidate(nums=[1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5], k=7) == 15",
"assert candidate(nums=[5, 6, 7, 8, 9, 10,... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2], k=15) == 30",
"assert candidate(nums=[1, 4, 3, 7, 4, 5], k=3) == 15",
"assert candidate(nums=[1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5], k=7) == 15",
"assert candida... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an integer array coins of length n which represents the n co... | You are an expert Python programmer. 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 coins of length n which represents the n coins that you own. The value of the ith coin i... | [
"assert candidate(coins=[1, 2, 3, 6, 11, 20, 37, 68, 129, 254]) == 532",
"assert candidate(coins=[1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8]) == 73",
"assert candidate(coins=[2, 2, 2, 2]) == 1",
"assert candidate(coins=[1, 5, 10, 25, 50, 100, 200, 500, 1000]) == 2",
"assert candidate(coins=[1, 2, 3, 4,... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(coins=[1, 2, 3, 6, 11, 20, 37, 68, 129, 254]) == 532",
"assert candidate(coins=[1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8]) == 73",
"assert candidate(coins=[2, 2, 2, 2]) == 1",
"assert candidate(coins=[1, 5, 10, 25, 50, 100, 200, 500, 1000]) == 2",
"assert... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 2D integer array orders, where each orders[i] = [pricei, a... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given a 2D integer array orders, where each orders[i] = [pricei, amounti, orderTypei] denotes that amounti orde... | [
"assert candidate(orders=[[100, 10, 0], [90, 10, 0], [80, 10, 0], [70, 10, 0], [60, 10, 0], [50, 10, 1], [40, 10, 1], [30, 10, 1], [20, 10, 1], [10, 10, 1]]) == 0",
"assert candidate(orders=[[100, 1, 0], [100, 1, 0], [100, 1, 0], [100, 1, 1], [100, 1, 1], [100, 1, 1], [100, 1, 0], [100, 1, 0], [100, 1, 0], [100, ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(orders=[[100, 10, 0], [90, 10, 0], [80, 10, 0], [70, 10, 0], [60, 10, 0], [50, 10, 1], [40, 10, 1], [30, 10, 1], [20, 10, 1], [10, 10, 1]]) == 0",
"assert candidate(orders=[[100, 1, 0], [100, 1, 0], [100, 1, 0], [100, 1, 1], [100, 1, 1], [100, 1, 1], [100, 1, 0], [100, 1, ... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given three positive integers: n, index, and maxSum. You want to c... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given three positive integers: n, index, and maxSum. You want to construct an array nums (0-indexed) that satis... | [
"assert candidate(n=25, index=12, maxSum=1500) == 66",
"assert candidate(n=15, index=7, maxSum=100) == 10",
"assert candidate(n=500, index=250, maxSum=150000) == 425",
"assert candidate(n=999999999, index=499999999, maxSum=999999999) == 1",
"assert candidate(n=100000, index=50000, maxSum=5000000) == 2214",
... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(n=25, index=12, maxSum=1500) == 66",
"assert candidate(n=15, index=7, maxSum=100) == 10",
"assert candidate(n=500, index=250, maxSum=150000) == 425",
"assert candidate(n=999999999, index=499999999, maxSum=999999999) == 1",
"assert candidate(n=100000, index=5000... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an even integer n. You initially have a permutation pe... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given an even integer n. You initially have a permutation perm of size n where perm[i] == i (0-indexed... | [
"assert candidate(n=256) == 8",
"assert candidate(n=100) == 30",
"assert candidate(n=750) == 318",
"assert candidate(n=32) == 5",
"assert candidate(n=6) == 4",
"assert candidate(n=14) == 12",
"assert candidate(n=48) == 23",
"assert candidate(n=46) == 12",
"assert candidate(n=4) == 2",
"assert cand... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(n=256) == 8",
"assert candidate(n=100) == 30",
"assert candidate(n=750) == 318",
"assert candidate(n=32) == 5",
"assert candidate(n=6) == 4",
"assert candidate(n=14) == 12",
"assert candidate(n=48) == 23",
"assert candidate(n=46) == 12",
"assert... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given two strings sentence1 and sentence2, each representing a sen... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given two strings sentence1 and sentence2, each representing a sentence composed of words. A sentence is a list... | [
"assert candidate(sentence1='Hello from the other side', sentence2='Hello') == True",
"assert candidate(sentence1='This is a test', sentence2='This is only a test') == True",
"assert candidate(sentence1='Hello World', sentence2='World') == True",
"assert candidate(sentence1='Similar sentences', sentence2='Sim... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(sentence1='Hello from the other side', sentence2='Hello') == True",
"assert candidate(sentence1='This is a test', sentence2='This is only a test') == True",
"assert candidate(sentence1='Hello World', sentence2='World') == True",
"assert candidate(sentence1='Similar... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 logs for users' actions on LeetCode, and an integer k. T... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given the logs for users' actions on LeetCode, and an integer k. The logs are represented by a 2D integer array... | [
"assert candidate(logs=[[1, 1], [2, 2], [2, 3]], k=4) == [1, 1, 0, 0]",
"assert candidate(logs=[[0, 1], [0, 1], [1, 1], [1, 1], [2, 1], [2, 1], [3, 1], [3, 1], [4, 1], [4, 1]], k=1) == [5]",
"assert candidate(logs=[[10, 10], [20, 10], [30, 10], [40, 10], [50, 10], [60, 10], [70, 10], [80, 10], [90, 10], [100, 1... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(logs=[[1, 1], [2, 2], [2, 3]], k=4) == [1, 1, 0, 0]",
"assert candidate(logs=[[0, 1], [0, 1], [1, 1], [1, 1], [2, 1], [2, 1], [3, 1], [3, 1], [4, 1], [4, 1]], k=1) == [5]",
"assert candidate(logs=[[10, 10], [20, 10], [30, 10], [40, 10], [50, 10], [60, 10], [70, 10], [8... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given two positive integer arrays nums1 and nums2, both of length ... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given two positive integer arrays nums1 and nums2, both of length n.
The absolute sum difference of arrays nums... | [
"assert candidate(nums1=[1, 3, 5, 7, 9], nums2=[2, 4, 6, 8, 10]) == 5",
"assert candidate(nums1=[5, 4, 3, 2, 1], nums2=[1, 2, 3, 4, 5]) == 8",
"assert candidate(nums1=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], nums2=[20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums1=[1, 3, 5, 7, 9], nums2=[2, 4, 6, 8, 10]) == 5",
"assert candidate(nums1=[5, 4, 3, 2, 1], nums2=[1, 2, 3, 4, 5]) == 8",
"assert candidate(nums1=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], nums2=[20, 19, 18, 17, 16, 15, 14, 13, 12, 11, ... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an array nums that consists of positive integers.\nThe GCD 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 array nums that consists of positive integers.
The GCD of a sequence of numbers is defined as the grea... | [
"assert candidate(nums=[2, 3, 5, 7, 11, 13, 17, 19, 23, 29]) == 11",
"assert candidate(nums=[3, 6, 9, 12, 15, 18, 21, 24, 27, 30]) == 10",
"assert candidate(nums=[60, 120, 180, 240, 300, 360, 420, 480, 540, 600]) == 10",
"assert candidate(nums=[5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[2, 3, 5, 7, 11, 13, 17, 19, 23, 29]) == 11",
"assert candidate(nums=[3, 6, 9, 12, 15, 18, 21, 24, 27, 30]) == 10",
"assert candidate(nums=[60, 120, 180, 240, 300, 360, 420, 480, 540, 600]) == 10",
"assert candidate(nums=[5, 10, 15, 20, 25, 30, 35, 40, 45, 50,... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nThere are m boys and n girls in a class attending an upcoming party.\nYou ... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
There are m boys and n girls in a class attending an upcoming party.
You are given an m x n integer matrix grid, where ... | [
"assert candidate(grid=[[0, 1, 1, 1, 1], [1, 0, 1, 1, 1], [1, 1, 0, 1, 1], [1, 1, 1, 0, 1], [1, 1, 1, 1, 0]]) == 5",
"assert candidate(grid=[[1, 0, 1, 0, 0, 0, 0], [0, 1, 0, 1, 0, 0, 0], [0, 0, 1, 0, 1, 0, 0], [0, 0, 0, 1, 0, 1, 0], [0, 0, 0, 0, 1, 0, 1], [1, 0, 0, 0, 0, 1, 0], [0, 1, 0, 0, 0, 0, 1]]) == 7",
"a... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(grid=[[0, 1, 1, 1, 1], [1, 0, 1, 1, 1], [1, 1, 0, 1, 1], [1, 1, 1, 0, 1], [1, 1, 1, 1, 0]]) == 5",
"assert candidate(grid=[[1, 0, 1, 0, 0, 0, 0], [0, 1, 0, 1, 0, 0, 0], [0, 0, 1, 0, 1, 0, 0], [0, 0, 0, 1, 0, 1, 0], [0, 0, 0, 0, 1, 0, 1], [1, 0, 0, 0, 0, 1, 0], [0, 1, 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 3 lane road of length n that consists of n + 1 points labeled 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:
There is a 3 lane road of length n that consists of n + 1 points labeled from 0 to n. A frog starts at point 0 in the s... | [
"assert candidate(obstacles=[0, 1, 2, 3, 0, 2, 1, 3, 0, 1, 2, 3, 0]) == 6",
"assert candidate(obstacles=[0, 1, 0, 2, 0, 3, 0, 1, 0, 2, 0, 3, 0, 1, 0, 2, 0, 3, 0, 1, 0, 2, 0, 3, 0, 1, 0, 2, 0, 3, 0]) == 7",
"assert candidate(obstacles=[0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0]) == 0",
"assert candi... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(obstacles=[0, 1, 2, 3, 0, 2, 1, 3, 0, 1, 2, 3, 0]) == 6",
"assert candidate(obstacles=[0, 1, 0, 2, 0, 3, 0, 1, 0, 2, 0, 3, 0, 1, 0, 2, 0, 3, 0, 1, 0, 2, 0, 3, 0, 1, 0, 2, 0, 3, 0]) == 7",
"assert candidate(obstacles=[0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a sorted array nums of n non-negative integers and an intege... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given a sorted array nums of n non-negative integers and an integer maximumBit. You want to perform the followi... | [
"assert candidate(nums=[1, 2, 4, 8, 16], maximumBit=5) == [0, 16, 24, 28, 30]",
"assert candidate(nums=[31, 62, 93, 124, 155, 186, 217, 248, 279, 310], maximumBit=10) == [990, 744, 1023, 775, 990, 868, 1023, 899, 990, 992]",
"assert candidate(nums=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], ma... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[1, 2, 4, 8, 16], maximumBit=5) == [0, 16, 24, 28, 30]",
"assert candidate(nums=[31, 62, 93, 124, 155, 186, 217, 248, 279, 310], maximumBit=10) == [990, 744, 1023, 775, 990, 868, 1023, 899, 990, 992]",
"assert candidate(nums=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nIt is a sweltering summer day, and a boy wants to buy some ice cream bars.... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
It is a sweltering summer day, and a boy wants to buy some ice cream bars.
At the store, there are n ice cream bars. Yo... | [
"assert candidate(costs=[1, 1000000, 2, 999999, 3, 999998, 4, 999997, 5, 999996], coins=1000000) == 5",
"assert candidate(costs=[100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500], coins=8000) == 12",
"assert candidate(costs=[100000, 50000, 25000, 12500, 6250, 3125, 1562, 781, 390,... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(costs=[1, 1000000, 2, 999999, 3, 999998, 4, 999997, 5, 999996], coins=1000000) == 5",
"assert candidate(costs=[100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500], coins=8000) == 12",
"assert candidate(costs=[100000, 50000, 25000, 12500, 62... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given n tasks labeled from 0 to n - 1 represented by a 2D 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 n tasks labeled from 0 to n - 1 represented by a 2D integer array tasks, where tasks[i] = [enqueueT... | [
"assert candidate(tasks=[[1, 1], [2, 1], [3, 1], [4, 1], [5, 1], [6, 1], [7, 1], [8, 1], [9, 1], [10, 1], [1, 2], [2, 2], [3, 2], [4, 2], [5, 2], [6, 2], [7, 2], [8, 2], [9, 2], [10, 2]]) == [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]",
"assert candidate(tasks=[[1, 2], [2, 1], [3, 2], [... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(tasks=[[1, 1], [2, 1], [3, 1], [4, 1], [5, 1], [6, 1], [7, 1], [8, 1], [9, 1], [10, 1], [1, 2], [2, 2], [3, 2], [4, 2], [5, 2], [6, 2], [7, 2], [8, 2], [9, 2], [10, 2]]) == [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]",
"assert candidate(tasks=[[1... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven the head of a linked list, find all the values that appear more than... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
Given the head of a linked list, find all the values that appear more than once in the list and delete the nodes that h... | [
"assert candidate(head=list_node([10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100])) == None",
"assert is_same_list(candidate(head=list_node([1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10])), list_node([10]))",
"assert is_same_list(candidate(head=list_node([1, 2, 3, 4... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(head=list_node([10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100])) == None",
"assert is_same_list(candidate(head=list_node([1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10])), list_node([10]))",
"assert is_same_list(candidate(h... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nThe frequency of an element is the number of times it occurs in an array.\... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
The frequency of an element is the number of times it occurs in an array.
You are given an integer array nums and an in... | [
"assert candidate(nums=[10, 15, 20, 25, 30, 35, 40, 45, 50], k=100) == 6",
"assert candidate(nums=[1, 3, 6, 10, 15], k=25) == 4",
"assert candidate(nums=[5, 5, 5, 5, 5, 5, 5, 5, 5, 5], k=0) == 10",
"assert candidate(nums=[100000, 100000, 100000], k=300000) == 3",
"assert candidate(nums=[100000, 100000, 1000... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[10, 15, 20, 25, 30, 35, 40, 45, 50], k=100) == 6",
"assert candidate(nums=[1, 3, 6, 10, 15], k=25) == 4",
"assert candidate(nums=[5, 5, 5, 5, 5, 5, 5, 5, 5, 5], k=0) == 10",
"assert candidate(nums=[100000, 100000, 100000], k=300000) == 3",
"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:\nA string is considered beautiful if it satisfies the following conditions:... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
A string is considered beautiful if it satisfies the following conditions:
Each of the 5 English vowels ('a', 'e', 'i'... | [
"assert candidate(word='aeiaaioaaaaeiiooouuuooauuaeiu') == 13",
"assert candidate(word='uuuuuuuuuuuuuuuuuuuu') == 0",
"assert candidate(word='aeiaaioaaaaeiioooaeiouuuaeiouuuaeiouuu') == 7",
"assert candidate(word='aeiaaioaaaaeiiiiouuuuuaaaaaaaaaeeeeiiiioooouuuuuu') == 27",
"assert candidate(word='aeiaaioaaa... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(word='aeiaaioaaaaeiiooouuuooauuaeiu') == 13",
"assert candidate(word='uuuuuuuuuuuuuuuuuuuu') == 0",
"assert candidate(word='aeiaaioaaaaeiioooaeiouuuaeiouuuaeiouuu') == 7",
"assert candidate(word='aeiaaioaaaaeiiiiouuuuuaaaaaaaaaeeeeiiiioooouuuuuu') == 27",
"asse... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a numeric string num, representing a very large palindrome.\... | You are an expert Python programmer. 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 numeric string num, representing a very large palindrome.
Return the smallest palindrome larger than nu... | [
"assert candidate(num='122222221') == '212222212'",
"assert candidate(num='9999999999888888888777777777666666665555555544444444333333332222222211111111') == ''",
"assert candidate(num='65432112345654321123456') == '65432112354645321123456'",
"assert candidate(num='223322') == '232232'",
"assert candidate(nu... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(num='122222221') == '212222212'",
"assert candidate(num='9999999999888888888777777777666666665555555544444444333333332222222211111111') == ''",
"assert candidate(num='65432112345654321123456') == '65432112354645321123456'",
"assert candidate(num='223322') == '23223... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 arr. Perform some operations (... | You are an expert Python programmer. 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 arr. Perform some operations (possibly none) on arr so that it satisfies th... | [
"assert candidate(arr=[9, 7, 5, 3, 1]) == 5",
"assert candidate(arr=[100, 1, 1000]) == 3",
"assert candidate(arr=[1, 3, 5, 7, 9, 11, 13, 15, 17, 19]) == 10",
"assert candidate(arr=[5, 4, 3, 2, 1, 1, 1, 1, 1, 1]) == 5",
"assert candidate(arr=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(arr=[9, 7, 5, 3, 1]) == 5",
"assert candidate(arr=[100, 1, 1000]) == 3",
"assert candidate(arr=[1, 3, 5, 7, 9, 11, 13, 15, 17, 19]) == 10",
"assert candidate(arr=[5, 4, 3, 2, 1, 1, 1, 1, 1, 1]) == 5",
"assert candidate(arr=[10, 20, 30, 40, 50, 60, 70, 80, 90, 1... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nThere is a hotel with n rooms. The rooms are represented by a 2D integer a... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
There is a hotel with n rooms. The rooms are represented by a 2D integer array rooms where rooms[i] = [roomIdi, sizei] ... | [
"assert candidate(rooms=[[10000000, 10000000]], queries=[[10000000, 10000000]]) == [10000000]",
"assert candidate(rooms=[[100, 100], [200, 200], [300, 300], [400, 400]], queries=[[150, 100], [250, 200], [350, 300], [450, 400]]) == [100, 200, 300, 400]",
"assert candidate(rooms=[[1, 1], [2, 2], [3, 3], [4, 4], [... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(rooms=[[10000000, 10000000]], queries=[[10000000, 10000000]]) == [10000000]",
"assert candidate(rooms=[[100, 100], [200, 200], [300, 300], [400, 400]], queries=[[150, 100], [250, 200], [350, 300], [450, 400]]) == [100, 200, 300, 400]",
"assert candidate(rooms=[[1, 1], ... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a string num, representing a large integer, and an integer k... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given a string num, representing a large integer, and an integer k.
We call some integer wonderful if it is a p... | [
"assert candidate(num='3333333333', k=1) == 0",
"assert candidate(num='12345678909876543210', k=5) == 43",
"assert candidate(num='9999999999999999999999999999999999999999999999999999', k=5) == 0",
"assert candidate(num='01234567890123456789', k=500) == 8",
"assert candidate(num='102030405060708090', k=50) =... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(num='3333333333', k=1) == 0",
"assert candidate(num='12345678909876543210', k=5) == 43",
"assert candidate(num='9999999999999999999999999999999999999999999999999999', k=5) == 0",
"assert candidate(num='01234567890123456789', k=500) == 8",
"assert candidate(num=... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 2D integer array intervals, where intervals[i] = [lefti, r... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given a 2D integer array intervals, where intervals[i] = [lefti, righti] describes the ith interval starting at... | [
"assert candidate(intervals=[[1, 5], [1, 5], [1, 5], [1, 5], [1, 5], [1, 5], [1, 5], [1, 5], [1, 5], [1, 5]], queries=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == [5, 5, 5, 5, 5, -1, -1, -1, -1, -1]",
"assert candidate(intervals=[[1, 10000000]], queries=[1, 5000000, 10000000]) == [10000000, 10000000, 10000000]",
"assert... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(intervals=[[1, 5], [1, 5], [1, 5], [1, 5], [1, 5], [1, 5], [1, 5], [1, 5], [1, 5], [1, 5]], queries=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == [5, 5, 5, 5, 5, -1, -1, -1, -1, -1]",
"assert candidate(intervals=[[1, 10000000]], queries=[1, 5000000, 10000000]) == [10000000, 10000000... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an integer array nums of length n and an integer k. Your tas... | You are an expert Python programmer. 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 length n and an integer k. Your task is to find the number of distinct elements ... | [
"assert candidate(nums=[1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5], k=20) == [5]",
"assert candidate(nums=[1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 1], k=5) == [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3]",
"assert candidate(nums=[5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 5, 4, 3, 2, ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5], k=20) == [5]",
"assert candidate(nums=[1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 1], k=5) == [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3]",
"assert candidate(nums=[5, 4, 3, 2, 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 two non-increasing 0-indexed integer arrays nums1 and ... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given two non-increasing 0-indexed integer arrays nums1 and nums2.
A pair of indices (i, j), where ... | [
"assert candidate(nums1=[100], nums2=[100, 100, 100, 100, 100, 100, 100, 100, 100, 100]) == 9",
"assert candidate(nums1=[1, 1, 1, 1], nums2=[1, 1, 1, 1]) == 3",
"assert candidate(nums1=[99999, 99998, 99997], nums2=[100000, 99999, 99998]) == 1",
"assert candidate(nums1=[5, 4, 3, 2, 1], nums2=[5, 4, 3, 2, 1]) =... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums1=[100], nums2=[100, 100, 100, 100, 100, 100, 100, 100, 100, 100]) == 9",
"assert candidate(nums1=[1, 1, 1, 1], nums2=[1, 1, 1, 1]) == 3",
"assert candidate(nums1=[99999, 99998, 99997], nums2=[100000, 99999, 99998]) == 1",
"assert candidate(nums1=[5, 4, 3, 2, 1... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nThe min-product of an array is equal to the minimum value in the array mul... | You are an expert Python programmer. 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 min-product of an array is equal to the minimum value in the array multiplied by the array's sum.
For example, the... | [
"assert candidate(nums=[1, 2, 3, 2, 1, 2, 3, 2, 1, 2, 3, 2, 1, 2, 3, 2, 1]) == 33",
"assert candidate(nums=[3, 2, 5, 4, 7, 6, 8, 9, 1, 10, 2, 3, 4, 5, 6, 7, 8, 9, 1, 10, 2, 3, 4, 5, 6, 7, 8, 9, 1, 10, 2, 3, 4, 5, 6, 7, 8, 9, 1]) == 210",
"assert candidate(nums=[1, 2, 3, 2]) == 14",
"assert candidate(nums=[1, ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[1, 2, 3, 2, 1, 2, 3, 2, 1, 2, 3, 2, 1, 2, 3, 2, 1]) == 33",
"assert candidate(nums=[3, 2, 5, 4, 7, 6, 8, 9, 1, 10, 2, 3, 4, 5, 6, 7, 8, 9, 1, 10, 2, 3, 4, 5, 6, 7, 8, 9, 1, 10, 2, 3, 4, 5, 6, 7, 8, 9, 1]) == 210",
"assert candidate(nums=[1, 2, 3, 2]) == 14",
... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nThere is a directed graph of n colored nodes and m edges. The nodes are nu... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
There is a directed graph of n colored nodes and m edges. The nodes are numbered from 0 to n - 1.\r
\r
You are given a ... | [
"assert candidate(colors='abcdef', edges=[[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 0]]) == -1",
"assert candidate(colors='abcdefghij', edges=[[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [0, 2], [1, 3], [2, 4], [3, 5], [4, 6], [5, 7], [6, 8], [7, 9], [8, 0], [9, 1]]) == -1",
"asser... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(colors='abcdef', edges=[[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 0]]) == -1",
"assert candidate(colors='abcdefghij', edges=[[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [0, 2], [1, 3], [2, 4], [3, 5], [4, 6], [5, 7], [6, 8], [7, 9], [8, 0], [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:\nGiven an array of strings words, find the longest string in words such tha... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
Given an array of strings words, find the longest string in words such that every prefix of it is also in words.
For e... | [
"assert candidate(words=['p', 'pu', 'pur', 'pure', 'purel', 'purely']) == 'purely'",
"assert candidate(words=['zebra', 'zeb', 'ze', 'z', 'zebras', 'zebrass', 'zebrasst', 'zebrassta', 'zebrasstak', 'zebrasstake', 'zebrasstaken', 'zebrasstakeno', 'zebrasstakenon', 'zebrasstakenone']) == 'zeb'",
"assert candidate(... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(words=['p', 'pu', 'pur', 'pure', 'purel', 'purely']) == 'purely'",
"assert candidate(words=['zebra', 'zeb', 'ze', 'z', 'zebras', 'zebrass', 'zebrasst', 'zebrassta', 'zebrasstak', 'zebrasstake', 'zebrasstaken', 'zebrasstakeno', 'zebrasstakenon', 'zebrasstakenone']) == 'zeb'... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given two integers memory1 and memory2 representing the available ... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given two integers memory1 and memory2 representing the available memory in bits on two memory sticks. There is... | [
"assert candidate(memory1=10, memory2=1) == [5, 0, 1]",
"assert candidate(memory1=0, memory2=2147483647) == [65536, 0, 32767]",
"assert candidate(memory1=15, memory2=15) == [7, 6, 3]",
"assert candidate(memory1=4000000000, memory2=3000000000) == [118321, 102440, 27200]",
"assert candidate(memory1=1073741824... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(memory1=10, memory2=1) == [5, 0, 1]",
"assert candidate(memory1=0, memory2=2147483647) == [65536, 0, 32767]",
"assert candidate(memory1=15, memory2=15) == [7, 6, 3]",
"assert candidate(memory1=4000000000, memory2=3000000000) == [118321, 102440, 27200]",
"assert... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an m x n matrix of characters boxGrid representing a side-vi... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given an m x n matrix of characters boxGrid representing a side-view of a box. Each cell of the box is one of t... | [
"assert candidate(boxGrid=[['.', '.', '.', '.'], ['.', '.', '.', '.'], ['#', '#', '*', '.'], ['#', '#', '#', '*']]) == [['#', '#', '.', '.'], ['#', '#', '.', '.'], ['#', '*', '.', '.'], ['*', '.', '.', '.']]",
"assert candidate(boxGrid=[['*', '*', '*', '*']]) == [['*'], ['*'], ['*'], ['*']]",
"assert candidate(... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(boxGrid=[['.', '.', '.', '.'], ['.', '.', '.', '.'], ['#', '#', '*', '.'], ['#', '#', '#', '*']]) == [['#', '#', '.', '.'], ['#', '#', '.', '.'], ['#', '*', '.', '.'], ['*', '.', '.', '.']]",
"assert candidate(boxGrid=[['*', '*', '*', '*']]) == [['*'], ['*'], ['*'], ['*']]... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven an integer array nums, return the sum of floor(nums[i] / nums[j]) fo... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
Given an integer array nums, return the sum of floor(nums[i] / nums[j]) for all pairs of indices 0 <= i, j < nums.lengt... | [
"assert candidate(nums=[123, 456, 789, 101112, 131415, 161718, 192021, 222324, 252627, 282930]) == 15615",
"assert candidate(nums=[5, 5, 10, 10, 15, 15, 20, 20, 25, 25, 30, 30, 35, 35, 40, 40, 45, 45, 50, 50]) == 508",
"assert candidate(nums=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[123, 456, 789, 101112, 131415, 161718, 192021, 222324, 252627, 282930]) == 15615",
"assert candidate(nums=[5, 5, 10, 10, 15, 15, 20, 20, 25, 25, 30, 30, 35, 35, 40, 40, 45, 45, 50, 50]) == 508",
"assert candidate(nums=[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 a binary string s, return the minimum number of character swaps to m... | You are an expert Python programmer. 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 minimum number of character swaps to make it alternating, or -1 if it is impossible... | [
"assert candidate(s='111100001111000011') == -1",
"assert candidate(s='1010101010101010101010101010101010101010101010101010') == 0",
"assert candidate(s='11001100110011') == -1",
"assert candidate(s='000011111111') == -1",
"assert candidate(s='10101010101010101010101010') == 0",
"assert candidate(s='10011... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(s='111100001111000011') == -1",
"assert candidate(s='1010101010101010101010101010101010101010101010101010') == 0",
"assert candidate(s='11001100110011') == -1",
"assert candidate(s='000011111111') == -1",
"assert candidate(s='10101010101010101010101010') == 0",... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nThere are n uniquely-sized sticks whose lengths are 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:
There are n uniquely-sized sticks whose lengths are integers from 1 to n. You want to arrange the sticks such that exac... | [
"assert candidate(n=750, k=100) == 677105109",
"assert candidate(n=1000, k=999) == 499500",
"assert candidate(n=10, k=3) == 1172700",
"assert candidate(n=500, k=2) == 540925953",
"assert candidate(n=4, k=3) == 6",
"assert candidate(n=999, k=499) == 23728871",
"assert candidate(n=300, k=150) == 266738846... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(n=750, k=100) == 677105109",
"assert candidate(n=1000, k=999) == 499500",
"assert candidate(n=10, k=3) == 1172700",
"assert candidate(n=500, k=2) == 540925953",
"assert candidate(n=4, k=3) == 6",
"assert candidate(n=999, k=499) == 23728871",
"assert can... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nRun-length encoding is a compression algorithm that allows for 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:
Run-length encoding is a compression algorithm that allows for an integer array nums with many segments of consecutive ... | [
"assert candidate(encoded1=[[7, 5], [8, 3], [9, 2]], encoded2=[[1, 5], [2, 2], [3, 3]]) == [[7, 5], [16, 2], [24, 1], [27, 2]]",
"assert candidate(encoded1=[[1, 10], [2, 20], [3, 30]], encoded2=[[4, 10], [3, 20], [2, 30]]) == [[4, 10], [6, 50]]",
"assert candidate(encoded1=[[1, 20], [2, 20], [3, 20]], encoded2=... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(encoded1=[[7, 5], [8, 3], [9, 2]], encoded2=[[1, 5], [2, 2], [3, 3]]) == [[7, 5], [16, 2], [24, 1], [27, 2]]",
"assert candidate(encoded1=[[1, 10], [2, 20], [3, 30]], encoded2=[[4, 10], [3, 20], [2, 30]]) == [[4, 10], [6, 50]]",
"assert candidate(encoded1=[[1, 20], [2,... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a floating-point number hour, representing the amount of tim... | You are an expert Python programmer. 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 floating-point number hour, representing the amount of time you have to reach the office. To commute to... | [
"assert candidate(dist=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], hour=15.0) == 5",
"assert candidate(dist=[1000, 2000, 3000], hour=7.0) == 1000",
"assert candidate(dist=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150], hour=25.0) == 70",
"assert candidate(dist=[100000, 200000, 300000, 400000], hour=2... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(dist=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], hour=15.0) == 5",
"assert candidate(dist=[1000, 2000, 3000], hour=7.0) == 1000",
"assert candidate(dist=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150], hour=25.0) == 70",
"assert candidate(dist=[100000, 2000... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 binary string s and two integers minJump and max... | You are an expert Python programmer. 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 binary string s and two integers minJump and maxJump. In the beginning, you are standing at i... | [
"assert candidate(s='000001000001000001000001000001000001000001000001', minJump=6, maxJump=12) == False",
"assert candidate(s='0010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101', minJump=3, maxJump=7) == False",
"assert candidate(s='0000000000000000000000000001', minJum... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(s='000001000001000001000001000001000001000001000001', minJump=6, maxJump=12) == False",
"assert candidate(s='0010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101', minJump=3, maxJump=7) == False",
"assert candidate(s='000000000000... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 product sum of two equal-length arrays a and b is equal to the sum 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:
The product sum of two equal-length arrays a and b is equal to the sum of a[i] * b[i] for all 0 <= i < a.length (0-inde... | [
"assert candidate(nums1=[50, 20, 80, 40, 60], nums2=[5, 10, 3, 9, 7]) == 1450",
"assert candidate(nums1=[3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5], nums2=[9, 7, 9, 3, 7, 9, 3, 2, 3, 8, 4]) == 195",
"assert candidate(nums1=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], nums2=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == 220",
"assert candidat... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums1=[50, 20, 80, 40, 60], nums2=[5, 10, 3, 9, 7]) == 1450",
"assert candidate(nums1=[3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5], nums2=[9, 7, 9, 3, 7, 9, 3, 2, 3, 8, 4]) == 195",
"assert candidate(nums1=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], nums2=[1, 2, 3, 4, 5, 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 are given two integer arrays nums1 and nums2 of length n.\nThe XOR sum... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given two integer arrays nums1 and nums2 of length n.
The XOR sum of the two integer arrays is (nums1[0] XOR nu... | [
"assert candidate(nums1=[13, 17, 19, 23, 29, 31], nums2=[31, 29, 23, 19, 17, 13]) == 0",
"assert candidate(nums1=[8, 16, 24, 32, 40, 48, 56, 64], nums2=[64, 56, 48, 40, 32, 24, 16, 8]) == 0",
"assert candidate(nums1=[2, 3, 4, 5], nums2=[5, 4, 3, 2]) == 0",
"assert candidate(nums1=[1, 2, 3, 4, 5], nums2=[5, 4,... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums1=[13, 17, 19, 23, 29, 31], nums2=[31, 29, 23, 19, 17, 13]) == 0",
"assert candidate(nums1=[8, 16, 24, 32, 40, 48, 56, 64], nums2=[64, 56, 48, 40, 32, 24, 16, 8]) == 0",
"assert candidate(nums1=[2, 3, 4, 5], nums2=[5, 4, 3, 2]) == 0",
"assert candidate(nums1=[1... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given two 0-indexed integer arrays servers and tasks of lengths n... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given two 0-indexed integer arrays servers and tasks of lengths n and m respectively. servers[i] is... | [
"assert candidate(servers=[2, 1, 2, 1, 2, 1, 2, 1, 2, 1], tasks=[5, 4, 3, 2, 1, 5, 4, 3, 2, 1]) == [1, 3, 5, 7, 9, 1, 3, 5, 7, 9]",
"assert candidate(servers=[3, 2, 1, 4, 5], tasks=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150]) == [2, 1, 0, 3, 4, 2, 1, 0, 3, 4, 2, 1, 0, 3, 4]",
"assert cand... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(servers=[2, 1, 2, 1, 2, 1, 2, 1, 2, 1], tasks=[5, 4, 3, 2, 1, 5, 4, 3, 2, 1]) == [1, 3, 5, 7, 9, 1, 3, 5, 7, 9]",
"assert candidate(servers=[3, 2, 1, 4, 5], tasks=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150]) == [2, 1, 0, 3, 4, 2, 1, 0, 3, 4, 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 given an integer hoursBefore, the number of hours you have to trav... | You are an expert Python programmer. 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 hoursBefore, the number of hours you have to travel to your meeting. To arrive at your meeting... | [
"assert candidate(dist=[5, 5, 5, 5, 5], speed=10, hoursBefore=3) == 2",
"assert candidate(dist=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], speed=1, hoursBefore=15) == -1",
"assert candidate(dist=[100000, 100000, 100000], speed=100000, hoursBefore=2) == -1",
"ass... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(dist=[5, 5, 5, 5, 5], speed=10, hoursBefore=3) == 2",
"assert candidate(dist=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], speed=1, hoursBefore=15) == -1",
"assert candidate(dist=[100000, 100000, 100000], speed=100000, hour... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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, your goal is to make all elements in nums equ... | You are an expert Python programmer. 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, your goal is to make all elements in nums equal. To complete one operation, follow these s... | [
"assert candidate(nums=[5, 4, 3, 2, 1, 5, 4, 3, 2, 1]) == 20",
"assert candidate(nums=[10, 10, 9, 9, 8, 8, 7, 7, 6, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1]) == 90",
"assert candidate(nums=[1, 2, 2, 3, 3, 3, 4, 4, 4, 4]) == 20",
"assert candidate(nums=[2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5]) == 32",
... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[5, 4, 3, 2, 1, 5, 4, 3, 2, 1]) == 20",
"assert candidate(nums=[10, 10, 9, 9, 8, 8, 7, 7, 6, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1]) == 90",
"assert candidate(nums=[1, 2, 2, 3, 3, 3, 4, 4, 4, 4]) == 20",
"assert candidate(nums=[2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 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 a binary string s. You are allowed to perform two types of o... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given a binary string s. You are allowed to perform two types of operations on the string in any sequence:
Typ... | [
"assert candidate(s='0001') == 1",
"assert candidate(s='11100011100011100011') == 7",
"assert candidate(s='1111') == 2",
"assert candidate(s='000111100011110001111') == 9",
"assert candidate(s='11111111111111111111111111111111111111111111111111') == 25",
"assert candidate(s='00000000001111111111') == 10",... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(s='0001') == 1",
"assert candidate(s='11100011100011100011') == 7",
"assert candidate(s='1111') == 2",
"assert candidate(s='000111100011110001111') == 9",
"assert candidate(s='11111111111111111111111111111111111111111111111111') == 25",
"assert candidate(s=... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou have n packages that you are trying to place in boxes, one package 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 have n packages that you are trying to place in boxes, one package in each box. There are m suppliers that each pro... | [
"assert candidate(packages=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], boxes=[[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [10, 9, 8, 7, 6, 5, 4, 3, 2, 1], [5, 15, 25, 35, 45]]) == 0",
"assert candidate(packages=[2, 4, 6, 8, 10, 12, 14, 16, 18, 20], boxes=[[1, 3, 5, 7, 9, 11, 13, 15, 17, 19], [2, 4, 6, 8, 10, 12, 14, 16, 18, 20], [3, 6... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(packages=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], boxes=[[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [10, 9, 8, 7, 6, 5, 4, 3, 2, 1], [5, 15, 25, 35, 45]]) == 0",
"assert candidate(packages=[2, 4, 6, 8, 10, 12, 14, 16, 18, 20], boxes=[[1, 3, 5, 7, 9, 11, 13, 15, 17, 19], [2, 4, 6, 8, 10, 12,... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an integer array ribbons, where ribbons[i] represents the le... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given an integer array ribbons, where ribbons[i] represents the length of the ith ribbon, and an integer k. You... | [
"assert candidate(ribbons=[10, 10, 10, 10, 10, 10, 10, 10, 10, 10], k=5) == 10",
"assert candidate(ribbons=[9, 7, 5], k=3) == 5",
"assert candidate(ribbons=[1, 1, 1, 1], k=1) == 1",
"assert candidate(ribbons=[100, 100, 100, 100, 100, 100, 100, 100, 100, 100], k=100) == 10",
"assert candidate(ribbons=[100000... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(ribbons=[10, 10, 10, 10, 10, 10, 10, 10, 10, 10], k=5) == 10",
"assert candidate(ribbons=[9, 7, 5], k=3) == 5",
"assert candidate(ribbons=[1, 1, 1, 1], k=1) == 1",
"assert candidate(ribbons=[100, 100, 100, 100, 100, 100, 100, 100, 100, 100], k=100) == 10",
"ass... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nThere are n students in a class numbered from 0 to n - 1. The teacher will... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
There are n students in a class numbered from 0 to n - 1. The teacher will give each student a problem starting with th... | [
"assert candidate(chalk=[5, 1, 5, 2, 6], k=1000000000) == 4",
"assert candidate(chalk=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], k=1000000000) == 8",
"assert candidate(chalk=[5, 8, 12, 3, 6], k=1000000000) == 2",
"assert candidate(chalk=[1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024], k=1073741823) ==... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(chalk=[5, 1, 5, 2, 6], k=1000000000) == 4",
"assert candidate(chalk=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], k=1000000000) == 8",
"assert candidate(chalk=[5, 8, 12, 3, 6], k=1000000000) == 2",
"assert candidate(chalk=[1, 2, 4, 8, 16, 32, 64, 128, 256, 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:\nA k x k magic square is a k x k grid filled with integers such that every ... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
A k x k magic square is a k x k grid filled with integers such that every row sum, every column sum, and both diagonal ... | [
"assert candidate(grid=[[1, 2, 3, 4, 5, 6], [7, 8, 9, 10, 11, 12], [13, 14, 15, 16, 17, 18], [19, 20, 21, 22, 23, 24], [25, 26, 27, 28, 29, 30], [31, 32, 33, 34, 35, 36]]) == 1",
"assert candidate(grid=[[37, 21, 15, 13, 31], [21, 37, 31, 15, 13], [15, 21, 37, 13, 31], [31, 13, 21, 37, 15], [13, 31, 15, 21, 37]]) ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(grid=[[1, 2, 3, 4, 5, 6], [7, 8, 9, 10, 11, 12], [13, 14, 15, 16, 17, 18], [19, 20, 21, 22, 23, 24], [25, 26, 27, 28, 29, 30], [31, 32, 33, 34, 35, 36]]) == 1",
"assert candidate(grid=[[37, 21, 15, 13, 31], [21, 37, 31, 15, 13], [15, 21, 37, 13, 31], [31, 13, 21, 37, 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 valid boolean expression as a string expression consisting... | You are an expert Python programmer. 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 valid boolean expression as a string expression consisting of the characters '1','0','&' (bitwise AND o... | [
"assert candidate(expression='((1|(0&(1&0)))&(0|(1|0)))') == 1",
"assert candidate(expression='(1|((0&0)|(1&0))&(0&(1|0))&(0|1)&((1|0)|(0|1)))') == 1",
"assert candidate(expression='((1&(0|1))|(0&(0|1)&(0|1)))') == 1",
"assert candidate(expression='(((1|1)|(0&0))&((1&1)|(0|0))|(1|0))') == 2",
"assert candid... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(expression='((1|(0&(1&0)))&(0|(1|0)))') == 1",
"assert candidate(expression='(1|((0&0)|(1&0))&(0&(1|0))&(0|1)&((1|0)|(0|1)))') == 1",
"assert candidate(expression='((1&(0|1))|(0&(0|1)&(0|1)))') == 1",
"assert candidate(expression='(((1|1)|(0&0))&((1&1)|(0|0))|(1|0)... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nThere is a tournament where n players are participating. The players are s... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
There is a tournament where n players are participating. The players are standing in a single row and are numbered from... | [
"assert candidate(n=20, firstPlayer=5, secondPlayer=16) == [1, 1]",
"assert candidate(n=18, firstPlayer=4, secondPlayer=15) == [1, 1]",
"assert candidate(n=25, firstPlayer=8, secondPlayer=20) == [2, 5]",
"assert candidate(n=19, firstPlayer=3, secondPlayer=17) == [1, 1]",
"assert candidate(n=16, firstPlayer=... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(n=20, firstPlayer=5, secondPlayer=16) == [1, 1]",
"assert candidate(n=18, firstPlayer=4, secondPlayer=15) == [1, 1]",
"assert candidate(n=25, firstPlayer=8, secondPlayer=20) == [2, 5]",
"assert candidate(n=19, firstPlayer=3, secondPlayer=17) == [1, 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:\nA peak element in a 2D grid is an element that is strictly greater than al... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
A peak element in a 2D grid is an element that is strictly greater than all of its adjacent neighbors to the left, righ... | [
"assert candidate(mat=[[100, 200, 300, 400], [400, 300, 200, 100], [100, 200, 300, 400], [400, 300, 200, 100]]) == [0, 3]",
"assert candidate(mat=[[30, 28, 19, 27, 22], [25, 31, 26, 23, 21], [24, 29, 32, 20, 18], [17, 22, 21, 16, 15], [13, 14, 12, 11, 10]]) == [0, 0]",
"assert candidate(mat=[[1, 2, 3, 4, 5, 6, ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(mat=[[100, 200, 300, 400], [400, 300, 200, 100], [100, 200, 300, 400], [400, 300, 200, 100]]) == [0, 3]",
"assert candidate(mat=[[30, 28, 19, 27, 22], [25, 31, 26, 23, 21], [24, 29, 32, 20, 18], [17, 22, 21, 16, 15], [13, 14, 12, 11, 10]]) == [0, 0]",
"assert candidate... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 0-indexed integer array order of length n, a permutation o... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given a 0-indexed integer array order of length n, a permutation of integers from 1 to n representing the order... | [
"assert candidate(order=[1, 3, 2, 6, 5, 7, 8, 4]) == 5",
"assert candidate(order=[3, 4, 1, 2]) == 3",
"assert candidate(order=[7, 3, 15, 2, 9, 11, 18, 1, 5, 12, 17, 19, 8, 13, 14]) == 7",
"assert candidate(order=[3, 4, 2, 1]) == 3",
"assert candidate(order=[1, 2, 3, 4]) == 4",
"assert candidate(order=[2, ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(order=[1, 3, 2, 6, 5, 7, 8, 4]) == 5",
"assert candidate(order=[3, 4, 1, 2]) == 3",
"assert candidate(order=[7, 3, 15, 2, 9, 11, 18, 1, 5, 12, 17, 19, 8, 13, 14]) == 7",
"assert candidate(order=[3, 4, 2, 1]) == 3",
"assert candidate(order=[1, 2, 3, 4]) == 4",
... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are participating in an online chess tournament. There is a chess roun... | You are an expert Python programmer. 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 participating in an online chess tournament. There is a chess round that starts every 15 minutes. The first rou... | [
"assert candidate(loginTime='13:15', logoutTime='13:30') == 1",
"assert candidate(loginTime='13:30', logoutTime='14:00') == 2",
"assert candidate(loginTime='20:00', logoutTime='21:00') == 4",
"assert candidate(loginTime='13:15', logoutTime='14:15') == 4",
"assert candidate(loginTime='08:20', logoutTime='09:... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(loginTime='13:15', logoutTime='13:30') == 1",
"assert candidate(loginTime='13:30', logoutTime='14:00') == 2",
"assert candidate(loginTime='20:00', logoutTime='21:00') == 4",
"assert candidate(loginTime='13:15', logoutTime='14:15') == 4",
"assert candidate(login... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 m x n binary matrices grid1 and grid2 containing only 0'... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given two m x n binary matrices grid1 and grid2 containing only 0's (representing water) and 1's (representing ... | [
"assert candidate(grid1=[[1, 0, 1, 0, 1, 1, 0], [1, 1, 1, 0, 0, 1, 0], [0, 0, 1, 1, 1, 1, 1], [0, 0, 1, 1, 1, 0, 0], [1, 0, 1, 0, 1, 0, 1]], grid2=[[1, 0, 1, 0, 1, 1, 0], [1, 1, 0, 0, 0, 1, 0], [0, 0, 1, 1, 1, 1, 1], [0, 0, 1, 1, 0, 0, 0], [1, 0, 1, 0, 1, 0, 1]]) == 6",
"assert candidate(grid1=[[1, 0, 1, 0, 1, 0]... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(grid1=[[1, 0, 1, 0, 1, 1, 0], [1, 1, 1, 0, 0, 1, 0], [0, 0, 1, 1, 1, 1, 1], [0, 0, 1, 1, 1, 0, 0], [1, 0, 1, 0, 1, 0, 1]], grid2=[[1, 0, 1, 0, 1, 1, 0], [1, 1, 0, 0, 0, 1, 0], [0, 0, 1, 1, 1, 1, 1], [0, 0, 1, 1, 0, 0, 0], [1, 0, 1, 0, 1, 0, 1]]) == 6",
"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:\nThe minimum absolute difference of an array a is defined as the minimum va... | You are an expert Python programmer. 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 minimum absolute difference of an array a is defined as the minimum value of |a[i] - a[j]|, where 0 <= i < j < a.le... | [
"assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], queries=[[0, 9], [10, 19], [0, 19], [5, 14], [1, 18]]) == [1, 1, 1, 1, 1]",
"assert candidate(nums=[5, 1, 9, 3, 7, 2, 8, 4, 6, 10], queries=[[0, 9], [1, 8], [2, 7], [3, 6], [4, 5]]) == [1, 1, 1, 1, 5]",
"assert candidate(nums... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], queries=[[0, 9], [10, 19], [0, 19], [5, 14], [1, 18]]) == [1, 1, 1, 1, 1]",
"assert candidate(nums=[5, 1, 9, 3, 7, 2, 8, 4, 6, 10], queries=[[0, 9], [1, 8], [2, 7], [3, 6], [4, 5]]) == [1, 1, 1, 1, 5]",
... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nGiven two strings s and part, perform the following operation on s until 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 two strings s and part, perform the following operation on s until all occurrences of the substring part are remo... | [
"assert candidate(s='mnopqrsmnopqrsmnopqrs', part='mnopqrs') == ''",
"assert candidate(s='xylophoneisfunxylophoneisfunxylophoneisfun', part='xylophoneis') == 'funfunfun'",
"assert candidate(s='aaabaaaabaaa', part='aab') == 'aaaaaa'",
"assert candidate(s='abcabcabcabcabcabc', part='ab') == 'cccccc'",
"assert... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(s='mnopqrsmnopqrsmnopqrs', part='mnopqrs') == ''",
"assert candidate(s='xylophoneisfunxylophoneisfunxylophoneisfun', part='xylophoneis') == 'funfunfun'",
"assert candidate(s='aaabaaaabaaa', part='aab') == 'aaaaaa'",
"assert candidate(s='abcabcabcabcabcabc', part='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:\nThe alternating sum of a 0-indexed array is defined as the sum of the 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:
The alternating sum of a 0-indexed array is defined as the sum of the elements at even indices minus the sum of the ele... | [
"assert candidate(nums=[1, 100000, 1, 100000, 1]) == 199999",
"assert candidate(nums=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) == 1",
"assert candidate(nums=[1, 3, 2, 5, 4, 7, 6, 9, 8, 10]) == 14",
"assert candidate(nums=[5, 1, 4, 2, 3]) == 9",
"assert candidate(nums=[1, 3, 5, 7, 9, 11, 13, 15, 17, 19,... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(nums=[1, 100000, 1, 100000, 1]) == 199999",
"assert candidate(nums=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) == 1",
"assert candidate(nums=[1, 3, 2, 5, 4, 7, 6, 9, 8, 10]) == 14",
"assert candidate(nums=[5, 1, 4, 2, 3]) == 9",
"assert candidate(nums=[1, 3,... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given an m x n integer matrix grid, where m and n are both 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 an m x n integer matrix grid, where m and n are both even integers, and an integer k.\r
\r
The matrix ... | [
"assert candidate(grid=[[2, 3, 4, 5, 6, 7, 8], [1, 14, 13, 12, 11, 10, 9], [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]], k=25) == [[3, 4, 5, 6, 7, 8, 9], [2, 40, 39, 38, 37, 30, 21], [1, 41, 18, 19, 26, 23, 28],... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(grid=[[2, 3, 4, 5, 6, 7, 8], [1, 14, 13, 12, 11, 10, 9], [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]], k=25) == [[3, 4, 5, 6, 7, 8, 9], [2, 40, 39, 38, 37, 30, 21], [1, 41,... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will 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 wonderful string is a string where at most one letter appears an odd num... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
A wonderful string is a string where at most one letter appears an odd number of times.\r
\r
\r
For example, "ccjjc" a... | [
"assert candidate(word='jjjjj') == 15",
"assert candidate(word='acacacacacacacacacac') == 155",
"assert candidate(word='abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij') == 452",
"assert candidate(word='aabbccddeeffgghhiijj') == 165",
"assert candidate(word='abababababababab... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(word='jjjjj') == 15",
"assert candidate(word='acacacacacacacacacac') == 155",
"assert candidate(word='abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij') == 452",
"assert candidate(word='aabbccddeeffgghhiijj') == 165",
"assert can... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are an ant tasked with adding n new rooms numbered 0 to n-1 to your co... | You are an expert Python programmer. 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 an ant tasked with adding n new rooms numbered 0 to n-1 to your colony. You are given the expansion plan as a 0... | [
"assert candidate(prevRoom=[-1, 0, 0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17]) == 977718734",
"assert candidate(prevRoom=[-1, 0, 1, 2, 1, 4, 2, 6, 5, 7, 5, 9, 8, 10, 9, 11, 12, 13, 14, 10]) == 245044800",
"assert candidate(prevRoom=[-1, ... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(prevRoom=[-1, 0, 0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17]) == 977718734",
"assert candidate(prevRoom=[-1, 0, 1, 2, 1, 4, 2, 6, 5, 7, 5, 9, 8, 10, 9, 11, 12, 13, 14, 10]) == 245044800",
"assert... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are playing a video game where you are defending your city from a grou... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are playing a video game where you are defending your city from a group of n monsters. You are given a 0-indexed in... | [
"assert candidate(dist=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100], speed=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) == 10",
"assert candidate(dist=[2, 4, 6, 8, 10, 12, 14, 16, 18, 20], speed=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) == 10",
"assert candidate(dist=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], speed=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1])... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(dist=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100], speed=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) == 10",
"assert candidate(dist=[2, 4, 6, 8, 10, 12, 14, 16, 18, 20], speed=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) == 10",
"assert candidate(dist=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], speed=[1, 1,... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nThere is a country of n cities numbered from 0 to n - 1. In this country, ... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
There is a country of n cities numbered from 0 to n - 1. In this country, there is a road connecting every pair of citi... | [
"assert candidate(n=25, paths=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24], [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]) == 10",
... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(n=25, paths=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24], [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 0, 1, 2, 3, 4, 5, 6... |
[
{
"role": "user",
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Question:\nYou are given a 2D integer array trees where trees[i] = [xi, yi] represent... | You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
### Question:
You are given a 2D integer array trees where trees[i] = [xi, yi] represents the location of the ith tree in the garden.... | [
"assert candidate(trees=[[0, 0], [0, 3000], [3000, 0], [3000, 3000], [1500, 1500], [750, 750], [2250, 2250]]) == [1500.0, 1500.0, 2121.3203435596424]",
"assert candidate(trees=[[1, 1], [1, 3], [3, 1], [3, 3], [2, 2], [2, 0], [0, 2], [2, 4], [4, 2], [5, 5]]) == [2.875, 2.875, 3.005203820042827]",
"assert candida... | newfacade/LeetCodeDataset | {
"constraints": [
"assert candidate(trees=[[0, 0], [0, 3000], [3000, 0], [3000, 3000], [1500, 1500], [750, 750], [2250, 2250]]) == [1500.0, 1500.0, 2121.3203435596424]",
"assert candidate(trees=[[1, 1], [1, 3], [3, 1], [3, 3], [2, 2], [2, 0], [0, 2], [2, 4], [4, 2], [5, 5]]) == [2.875, 2.875, 3.0052038200428... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.