messages
listlengths
3
3
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nYou are given n cities and m bidirectional roads....
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nYou are given a string s consisting of lowercase ...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nYou are given a tree with n nodes rooted at node ...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nYou are given a string s consisting of lowercase ...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven an array of integers, return the maximum su...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven a list of n integers, determine whether you...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven an array of integers nums, return the maxim...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nYou are given an array of n integers. Find the le...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven a grid of size N x M filled with integers. ...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven a list of n intervals [l_i, r_i], find the ...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nYou are given two arrays of integers, A and B, ea...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven an array of n integers, find the minimum nu...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven an array of N integers, find the number of ...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven an integer array nums of length n, return t...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven an array of integers nums, return the index...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven an array of n integers, find the length of ...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nYou are given a list of n integers. For each inte...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nYou are given a string S consisting of lowercase ...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven a positive integer n, find the number of di...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven an array of n integers, determine the minim...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nYou are given a string s consisting of only lower...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nYou are given an array of n integers. Find the le...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven a string s, determine the minimum number of...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven an array of integers nums and an integer ta...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven an array of integers nums and an integer ta...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven an undirected graph with n nodes and m edge...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven an array of n positive integers, select exa...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven an array of integers nums, return the sum o...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven a list of n positive integers, determine if...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nYou are given a string s consisting of lowercase ...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nYou are given an integer array a of length n. Fin...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nYou are given a string S consisting of lowercase ...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven an array of n integers, find the length of ...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven two integers n and k, where n represents th...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven a list of integers, determine if there exis...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nYou are given an array of n positive integers and...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nYou are given an integer n (1 ≀ n ≀ 10^5) and an ...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven an array of integers nums, return the sum o...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven a list of integers nums, find the maximum s...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven an array of integers nums and an integer ta...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven an array of integers nums, return the sum o...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven a tree with n nodes numbered from 1 to n, w...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven an array of n integers, find the minimum nu...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven an array of n integers, find the length of ...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nYou are given an array of n integers. Find the nu...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven a string s consisting of lowercase English ...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven an array of n integers, your task is to det...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven a tree with N nodes (numbered 1 to N) and N...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven a grid of size n x m consisting of only 0s ...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nYou are given a string s consisting of lowercase ...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven an array of integers nums of length n, retu...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven a string s consisting of only lowercase Eng...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nYou are given a list of n positive integers. Find...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven a string s consisting of only lowercase Eng...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nYou are given a string s consisting only of '(' a...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven an array of integers nums, return the sum o...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven an array of integers nums and an integer k,...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven a string s of length n, find the minimum nu...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven two strings s and t of equal length n, dete...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nYou are given a string s consisting only of lower...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nYou are given a string s consisting of lowercase ...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nYou are given a string s consisting of lowercase ...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nYou are given a string s consisting of lowercase ...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nYou are given a sequence of n integers. Find the ...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven an array of integers nums, return the sum o...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven an array of integers nums of length n, retu...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven a 2D grid of size n Γ— m consisting of only ...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nYou are given a string s consisting of lowercase ...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nYou are given an array a of n positive integers. ...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nYou are given an array of n integers a_1, a_2, .....
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nYou are given a string s containing only lowercas...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nYou are given a tree with n nodes numbered from 1...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nYou are given a tree with n nodes rooted at node ...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven a tree (an undirected, connected, acyclic g...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nYou are given a string S consisting of lowercase ...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven an array of integers nums and an integer ta...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven an array of integers nums, return the sum o...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven a positive integer n, find the number of di...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven an undirected graph with n nodes and m edge...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nYou are given a connected undirected graph with n...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven two integers a and b, compute the greatest ...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven a tree with n nodes (numbered from 1 to n) ...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nYou are given an array of n positive integers. Co...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nYou are given an array of n integers. Determine w...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven an array of n integers, find two distinct i...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven a grid of size n x m consisting of only 0s ...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven an array of integers nums, return the sum o...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven an array of integers nums, return the numbe...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nYou are given a tree with n nodes (numbered 1 to ...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nYou are given a string s. Determine whether s is ...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven a string s, return the length of the longes...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nYou are given a string s consisting of lowercase ...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven a string s, determine whether it can be rea...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nYou are given a string s consisting of lowercase ...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven an array of n positive integers, count the ...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven a list of n positive integers, partition th...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven an array of integers nums, return the sum o...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nGiven an array of n integers, find the maximum su...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nYou are given a string s consisting of lowercase ...
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.", "role": "system" }, { "content": "### Question:\nYou are given an array of n integers. For each el...