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 integer n (1 ≤ n ≤ 10^9). 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:\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 positive integer n, print all the integer...
[ { "content": "You are an expert Python 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. 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:\nYou are given a tree with n nodes (numbered from ...
[ { "content": "You are an expert Python 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 A and B of equal length n, cons...
[ { "content": "You are an expert Python 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 n x m grid consisting of '.' (em...
[ { "content": "You are an expert Python 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 of length n, 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:\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, determine if it 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 an array of integers, count the number of p...
[ { "content": "You are an expert Python 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:\nGiven two integers A and B, determine whether it'...
[ { "content": "You are an expert Python 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:\nGiven an array of integers nums of length n, your...
[ { "content": "You are an expert Python 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 consisting 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:\nYou are given an array of n integers. 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 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 integers, determine whether it ...
[ { "content": "You are an expert Python 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, you are allowed 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 an array of n positive integers, determine ...
[ { "content": "You are an expert Python 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, determine the number of disti...
[ { "content": "You are an expert Python 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, find the length of 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 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:\nYou are given a string consisting of only '(' 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 two integers A and B. Find the smal...
[ { "content": "You are an expert Python 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 characters...
[ { "content": "You are an expert Python 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 a positive integer n, 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:\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 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 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:\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 an array of N integers. Determine 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:\nYou are given two positive integers A and B. 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 two arrays A and B of length n, determine 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 list of n cities and a list of m direct r...
[ { "content": "You are an expert Python 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 m intervals [l_i, r_i] on 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:\nGiven an array of integers nums of length n, 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 an array of integers nums of length n and 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:\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:\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:\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:\nYou are given two integers, a and b. Find the sma...
[ { "content": "You are an expert Python 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:\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 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 two strings, S and T. Determine whe...
[ { "content": "You are an expert Python 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, find the 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 undirected connected graph with N 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:\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 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 positive integer n, 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:\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 n 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:\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, determine whether 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 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 n x m grid of digits, find the largest 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 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 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 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 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 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 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, 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 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 a grid of size n x 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:\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:\nGiven an integer n, find the smallest 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:\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:\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. 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 two arrays of integers A and B, each of len...
[ { "content": "You are an expert Python 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 pair of 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 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 strings S and T, determine if S is a 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 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, print the sum of al...
[ { "content": "You are an expert Python 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 lowercase English let...
[ { "content": "You are an expert Python 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, find the number of pairs of p...
[ { "content": "You are an expert Python 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, count the number of p...
[ { "content": "You are an expert Python 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], your task...
[ { "content": "You are an expert Python 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 integer N and a list of N distin...
[ { "content": "You are an expert Python 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 arrays A and B 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:\nYou are given an array of n integers. Determine 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 string S of length N consisting only of 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 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 integers nums of length n, 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 an array of integers nums, find the length ...
[ { "content": "You are an expert Python 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 integers a_1, a_2, ..., a_n. 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 list of n positive integers, determine wh...
[ { "content": "You are an expert Python 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 whether i...