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 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:\nYou are given an array of n positive integers. Fi...
[ { "content": "You are an expert Python 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 ma...
[ { "content": "You are an expert Python 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:\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 a tree with n nodes (numbered 1 to n), each...
[ { "content": "You are an expert Python 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, each node has an integ...
[ { "content": "You are an expert Python 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. Yo...
[ { "content": "You are an expert Python 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, count 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:\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 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 an array of integers nums of size n, find 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 a string s and an integer k, find the lengt...
[ { "content": "You are an expert Python 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 in...
[ { "content": "You are an expert Python 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 2D grid of size n x m, consisting...
[ { "content": "You are an expert Python 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:\nGiven a list of integers, find the maximum sum 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 integer n. Find the smallest int...
[ { "content": "You are an expert Python 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 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:\nGiven an array of n integers, determine the lengt...
[ { "content": "You are an expert Python 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 mi...
[ { "content": "You are an expert Python 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 n, print all prime numbers less ...
[ { "content": "You are an expert Python 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 and an 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:\nGiven an array A of length N, 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 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:\nYou are given an array of n positive integers. Fi...
[ { "content": "You are an expert Python 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 connected by m bidirection...
[ { "content": "You are an expert Python 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 rooted at node 1, where...
[ { "content": "You are an expert Python 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:\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 two positive integers n and k, find the min...
[ { "content": "You are an expert Python 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 string s, determine if it is possible 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:\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 a list of n integers, find the maximum sum ...
[ { "content": "You are an expert Python 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:\nYou are given n points with integer coordinates 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 nums of length n, find the smalles...
[ { "content": "You are an expert Python 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...
[ { "content": "You are an expert Python 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 grid of size n x m filled with lo...
[ { "content": "You are an expert Python 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 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:\nYou are given an array of n positive integers. Fi...
[ { "content": "You are an expert Python 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 distinct integers, find the l...
[ { "content": "You are an expert Python 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 a string s of length n, 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 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 of length n. Your task 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 an array of n integers where each integer 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 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:\nYou are given an 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, count 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:\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 grid of size n x m consisting 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 a string s containing only lowercase Englis...
[ { "content": "You are an expert Python 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 the number ...
[ { "content": "You are an expert Python 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:\nGiven a list of N integers, print the sum of all ...
[ { "content": "You are an expert Python 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, find the maximum sum ...
[ { "content": "You are an expert Python 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), wher...
[ { "content": "You are an expert Python 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 N, print all even numbers 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 an array of integers of length n. F...
[ { "content": "You are an expert Python 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 binary tree, return the sum of all nodes ...
[ { "content": "You are an expert Python 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 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:\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:\nYou are given an array of N positive integers. Fi...
[ { "content": "You are an expert Python 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 n points on a 2D plane, 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:\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, determine if it is po...
[ { "content": "You are an expert Python 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 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:\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 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:\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 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 1 through 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 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:\nYou are given an array of N integers. For each el...
[ { "content": "You are an expert Python 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 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:\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:\nYou are given an array of n positive integers. Fi...
[ { "content": "You are an expert Python 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 (an undirected, connected, 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 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:\nYou are given a grid of size N x M consisting 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 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, 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:\nGiven a string s consisting of lowercase English ...