messages
listlengths
1
1
ground_truth
stringlengths
82
619k
dataset
stringclasses
2 values
[ { "content": "You are an expert Python 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\nYou are given a 1-indexed array nums of n integers.\nA set of numbers is complete if the product of every pai...
[{"input": "[78, 26, 8, 81, 73, 18, 65, 35, 22, 79]", "output": "181", "testtype": "functional", "fn_name": "maximumSum"}, {"input": "[55, 80, 44, 24, 8, 65, 78, 43, 74]", "output": "153", "testtype": "functional", "fn_name": "maximumSum"}, {"input": "[100, 3, 89, 6, 16, 47, 79, 29]", "output": "106", "testtype": "func...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a binary string s that contains at least one '1'.\nYou have to rearrange the bits in such a way...
[{"input": "\"0110011100101100011110011111101011000010001001001111101110011110011110011111011000001000010111001110\"", "output": "\"1111111111111111111111111111111111111111111111111111110000000000000000000000000000000000000000000001\"", "testtype": "functional", "fn_name": "maximumOddBinaryNumber"}, {"input": "\"000011...
code_functional
[ { "content": "You are an expert Python 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\nYou are given an array nums consisting of non-negative integers.\nWe define the score of subarray nums[l..r] ...
[{"input": "[6830, 5258, 3259, 9319, 5547, 7138, 7629, 6308, 9559]", "output": "1", "testtype": "functional", "fn_name": "maxSubarrays"}, {"input": "[1, 0, 2, 0, 1, 2]", "output": "3", "testtype": "functional", "fn_name": "maxSubarrays"}, {"input": "[5, 7, 1, 3]", "output": "1", "testtype": "functional", "fn_name": "ma...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed sorted array of integers nums.\nYou can perform the following operation any number ...
[{"input": "[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 1...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed array nums of non-negative integers, and two integers l and r.\nReturn the count of...
[{"input": "[8, 0, 7, 10, 4, 10, 4, 9, 7, 5]\n2\n3", "output": "0", "testtype": "functional", "fn_name": "countSubMultisets"}, {"input": "[2, 0, 4, 2, 1, 4, 10, 1]\n19\n19", "output": "4", "testtype": "functional", "fn_name": "countSubMultisets"}, {"input": "[0, 0, 3, 0, 0, 7, 7, 7]\n18\n19", "output": "0", "testtype":...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed integer array nums and an integer k.\nReturn an integer that denotes the sum of ele...
[{"input": "[34751, 10046, 8147, 11989, 62003, 99909, 39831, 65475, 66364, 24757, 39601, 27236, 99571, 31908, 65875, 56875, 98377, 7167, 28022, 61335, 39972, 89459, 18673, 978, 41260, 47366, 72021, 80041, 37671, 87439, 55276, 77639, 86370, 92897, 31964, 47084, 72002, 25741, 27669, 81200, 94913, 47289, 45695, 94914, 511...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed array nums consisting of positive integers.\nThere are two types of operations that...
[{"input": "[4, 6, 8, 1, 9, 4, 3, 3, 3, 9, 10, 10, 8, 6, 5, 10, 4, 3, 1, 7, 6, 6, 10, 1, 2, 2, 2, 7, 10, 4, 1, 8, 7, 3, 10, 10, 1, 3, 8, 6, 7, 6, 2, 1, 1, 5, 6, 10, 4, 8, 5, 5, 4, 8, 7, 10, 6, 10, 7, 8, 4, 7, 1, 10, 3, 5, 8, 1, 5, 9, 5, 9, 3, 5, 3, 8, 8, 7, 4, 5, 5, 3, 9, 5, 4, 6, 5, 4, 3, 7, 5, 8, 5, 10, 8]", "output"...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed integer array nums of length n where n is the total number of students in the class...
[{"input": "[55, 31, 88, 21, 38, 33, 69, 80, 81, 14, 19, 63, 80, 87, 51, 49, 86, 62, 19, 74, 61, 46, 17, 23, 87, 0, 24, 0, 47, 99, 65, 95, 8, 60, 11, 74, 89, 98, 33, 11, 67, 27, 3, 89, 56, 42, 47, 59, 43, 99, 30, 52, 95, 63, 54, 20, 50, 54, 55, 44, 0, 87, 70, 99, 38, 53, 85, 70, 84, 51, 32, 67, 2, 64, 30, 11, 6, 26, 54...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed array of integers nums, and an integer target.\nReturn the length of the longest su...
[{"input": "[1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed array maxHeights of n integers.\nYou are tasked with building n towers in the coord...
[{"input": "[123075808, 409279119, 11046870, 72960740, 119364084, 126488319, 55615072, 434122921, 41977525, 983114054, 504787137, 949513535, 402609822, 688488478, 787289877, 438855160, 975971046, 499918605, 387430707, 811129458, 337157869, 64942751, 337667043, 146394079, 273574356, 649974631, 364125986, 735933345, 5350...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed array nums and an integer target.\nA 0-indexed array infinite_nums is generated by ...
[{"input": "[80, 891, 338, 194, 297, 855, 406, 420, 127, 267, 870]\n4179", "output": "-1", "testtype": "functional", "fn_name": "minSizeSubarray"}, {"input": "[7, 4, 10, 10, 3, 7, 10, 5, 3, 7]\n10", "output": "1", "testtype": "functional", "fn_name": "minSizeSubarray"}, {"input": "[75, 79, 43, 28]\n483", "output": "-1"...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a binary string s and a positive integer k.\nA substring of s is beautiful if the number of 1's...
[{"input": "\"0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101\"\n50", "output": "\"101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101\"", "testtype": "functional", "fn_name": "shortestBeautifulSubstring"}, {"input": "\...
code_functional
[ { "content": "You are an expert Python 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\nYou have n processors each having 4 cores and n * 4 tasks that need to be executed such that each core should...
[{"input": "[10, 20]\n[2, 3, 1, 2, 5, 8, 4, 3]", "output": "23", "testtype": "functional", "fn_name": "minProcessingTime"}, {"input": "[8, 10]\n[2, 2, 3, 1, 8, 7, 4, 5]", "output": "16", "testtype": "functional", "fn_name": "minProcessingTime"}, {"input": "[9]\n[3, 3, 10, 7]", "output": "19", "testtype": "functional", ...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed integer array nums and a positive integer k.\nYou can do the following operation on...
[{"input": "[78029, 29071, 43907, 72660, 19825, 30037, 81795, 75150, 98095, 82269]\n10", "output": "900017517", "testtype": "functional", "fn_name": "maxSum"}, {"input": "[7237, 6994, 3465, 2168, 3526, 5331, 4278, 425, 4025, 1891]\n5", "output": "272935109", "testtype": "functional", "fn_name": "maxSum"}, {"input": "[9...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed integer array nums.\nReturn the maximum value over all triplets of indices (i, j, k...
[{"input": "[999962, 987666, 973224, 972950, 967397, 948473, 942828, 942001, 927474, 897399, 893284, 891196, 891106, 889270, 881705, 878582, 877560, 868542, 842378, 839544, 819495, 809452, 802022, 800090, 796289, 786965, 781426, 776497, 758453, 756783, 744558, 737541, 735068, 731584, 688026, 672961, 672836, 667180, 664...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed integer array nums.\nThe distinct count of a subarray of nums is defined as:\n\nLet...
[{"input": "[11, 36, 81, 58, 17, 41, 39, 24, 70, 34, 58, 25, 76, 44, 66, 60, 78, 80, 72, 93, 75, 70, 70, 62, 38, 70, 25, 74, 18, 96, 53, 41, 41, 27, 32, 23, 98, 57, 50, 59, 64, 47, 15, 64, 96, 34, 82, 2, 10, 19, 36, 16, 86, 61, 34, 87, 48, 80, 81, 40, 3, 81, 70, 36, 10, 78, 89, 70, 84, 54, 97, 47, 84, 79, 100, 98, 70, ...
code_functional
[ { "content": "You are an expert Python 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\nGiven a 0-indexed array of strings words where words[i] is either a positive integer represented as a string ...
[{"input": "[\"prev\", \"prev\", \"prev\", \"prev\", \"prev\", \"prev\", \"prev\", \"prev\", \"prev\", \"prev\", \"prev\", \"prev\", \"prev\", \"prev\", \"prev\", \"prev\", \"prev\", \"prev\", \"prev\", \"prev\", \"prev\", \"prev\", \"prev\", \"prev\", \"prev\", \"prev\", \"prev\", \"prev\", \"prev\", \"prev\", \"prev\...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed integer array nums of length n.\nWe want to group the indices so for each index i i...
[{"input": "[10, 10, 10, 3, 1, 1]", "output": "4", "testtype": "functional", "fn_name": "minGroupsForValidAssignment"}, {"input": "[3, 2, 3, 2, 3]", "output": "2", "testtype": "functional", "fn_name": "minGroupsForValidAssignment"}, {"input": "[2, 4, 4, 4, 2]", "output": "2", "testtype": "functional", "fn_name": "minGr...
code_functional
[ { "content": "You are an expert Python 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\nYou are given two arrays nums1 and nums2 consisting of positive integers.\nYou have to replace all the 0's in...
[{"input": "[4, 0, 1, 9]\n[9, 9, 10, 1, 0, 8, 9]", "output": "47", "testtype": "functional", "fn_name": "minSum"}, {"input": "[10, 0, 7, 8, 9]\n[8, 2, 7, 5, 4]", "output": "-1", "testtype": "functional", "fn_name": "minSum"}, {"input": "[6, 0, 4, 1, 3]\n[2, 3, 0, 0, 0]", "output": "15", "testtype": "functional", "fn_na...
code_functional
[ { "content": "You are an expert Python 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\nYou are given positive integers n and m.\nDefine two integers, num1 and num2, as follows:\n\nnum1: The sum of...
[{"input": "1000\n1000", "output": "498500", "testtype": "functional", "fn_name": "differenceOfSums"}, {"input": "921\n387", "output": "422259", "testtype": "functional", "fn_name": "differenceOfSums"}, {"input": "55\n6", "output": "1000", "testtype": "functional", "fn_name": "differenceOfSums"}, {"input": "10\n1", "ou...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed binary string s having an even length.\nA string is beautiful if it's possible to p...
[{"input": "\"0010000100101011\"", "output": "4", "testtype": "functional", "fn_name": "minChanges"}, {"input": "\"10001101\"", "output": "2", "testtype": "functional", "fn_name": "minChanges"}, {"input": "\"00111000\"", "output": "1", "testtype": "functional", "fn_name": "minChanges"}, {"input": "\"00100111\"", "outpu...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed array nums of integers.\nA triplet of indices (i, j, k) is a mountain if:\n\ni < j ...
[{"input": "[25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25]", "output": "-1", "testtype": "functional", "fn_name": "minimumSum"}, {"input": "[11, 37, 44, 48, 12, 25, 8...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed integer array nums, and an integer k.\nThe K-or of nums is a non-negative integer t...
[{"input": "[2112189006, 1392290501, 1649455936, 1921526753, 1616015630, 1092583089, 2109365983, 981548730, 1182574498, 1480112794, 2051562238, 1809260843, 387080090, 433263764, 890111569, 643015827, 1195343128, 1985386221, 791265535, 204633022, 1544626067, 730553096, 2094831342, 724155541, 937730533, 164225653, 104796...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed integer array nums.\nA subsequence of nums having length k and consisting of indice...
[{"input": "[274, 849, 0, 476, -936, 459, 129, 174, -89, -820, -263, -545, 612, 400, 356, 481, -687, -713, -345, -545, 796, -960, 802, 678, 550, -481, 778, -416, 22, 70, -221, -153, -736, 556, -635, 28, 877, -475, -29, -195, -256, 331, 362, -122, 503, -539, -80, -289, 940, 685, 643, -7, 120, -396, 491, 354, 216, -5, -9...
code_functional
[ { "content": "You are an expert Python 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\nThere are n teams numbered from 0 to n - 1 in a tournament.\nGiven a 0-indexed 2D boolean matrix grid of size...
[{"input": "[[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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], [0, 0...
code_functional
[ { "content": "You are an expert Python 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\nYou are given two 0-indexed integer arrays, nums1 and nums2, both having length n.\nYou are allowed to perfor...
[{"input": "[1137282, 1717149, 2795801, 4227105, 5791973, 6736295, 9233519, 10474314, 10680356, 11110138, 11279831, 11371829, 12418334, 12737053, 13077991, 13128009, 13366502, 13735476, 14930534, 15375116, 17894141, 19492487, 20962903, 21424384, 22660677, 24226053, 24620122, 26865346, 28002869, 28872376, 30753029, 3089...
code_functional
[ { "content": "You are an expert Python 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\nGiven three integers a, b, and n, return the maximum value of (a XOR x) * (b XOR x) where 0 <= x < 2^n.\nSinc...
[{"input": "1076947632412956\n557750079552976\n44", "output": "839814025", "testtype": "functional", "fn_name": "maximumXorProduct"}, {"input": "667782224007708\n667174951778250\n15", "output": "964901489", "testtype": "functional", "fn_name": "maximumXorProduct"}, {"input": "439818823154292\n777719436265486\n19", "out...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed integer array nums. A pair of integers x and y is called a strong pair if it satisf...
[{"input": "[100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100]", "output": "0", "testtype": "functional", "fn_name": "ma...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed array of strings words and a character x.\nReturn an array of indices representing ...
[{"input": "[\"aipqlhhujbqocvnotkfvl\", \"ibjsurngatzqdzbmvgpdxkdjzeqkofqrhernemcxinjx\", \"nyqdwxpwlkansjqyymynldyrzttfbxonszkzb\", \"gfxlunvsqjethlkhudthqlojiev\", \"vwgjuvxicykmbdoebhigfaldjaxpwwlystdtfpodnnefmdvh\", \"kgyiktmppanabtjftmrnqnb\", \"sizhtphcshhvnuujzjtsoqfejxur\", \"tfigysajeftgxleadayhvjjcpzzhtylgwn\...
code_functional
[ { "content": "You are an expert Python 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\nThere are n balls on a table, each ball has a color black or white.\nYou are given a 0-indexed binary string ...
[{"input": "\"01010\"", "output": "3", "testtype": "functional", "fn_name": "minimumSteps"}, {"input": "\"10100\"", "output": "5", "testtype": "functional", "fn_name": "minimumSteps"}, {"input": "\"01000\"", "output": "3", "testtype": "functional", "fn_name": "minimumSteps"}, {"input": "\"0111\"", "output": "0", "testt...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed integer array nums and an integer k.\nYou can perform the following operation on th...
[{"input": "[5, 2, 2, 4, 3, 1, 2, 4, 5, 4]\n27", "output": "10", "testtype": "functional", "fn_name": "maxFrequencyScore"}, {"input": "[6, 4, 10, 3, 7, 5, 3, 9, 7, 1]\n12", "output": "7", "testtype": "functional", "fn_name": "maxFrequencyScore"}, {"input": "[3, 6, 6, 9, 4, 2, 3, 10, 5, 6]\n0", "output": "3", "testtype"...
code_functional
[ { "content": "You are an expert Python 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\nYou are given two positive integers n and limit.\nReturn the total number of ways to distribute n candies amo...
[{"input": "48\n42", "output": "1162", "testtype": "functional", "fn_name": "distributeCandies"}, {"input": "49\n41", "output": "1167", "testtype": "functional", "fn_name": "distributeCandies"}, {"input": "50\n49", "output": "1323", "testtype": "functional", "fn_name": "distributeCandies"}, {"input": "49\n48", "output"...
code_functional
[ { "content": "You are an expert Python 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\nYou are given an integer n.\nA string s is called good if it contains only lowercase English characters and i...
[{"input": "100000", "output": "778066325", "testtype": "functional", "fn_name": "stringCount"}, {"input": "76374", "output": "921556878", "testtype": "functional", "fn_name": "stringCount"}, {"input": "65981", "output": "570733396", "testtype": "functional", "fn_name": "stringCount"}, {"input": "51097", "output": "139...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed string s having an even length n.\nYou are also given a 0-indexed 2D integer array,...
[{"input": "\"tstklfxvhvlizq\"\n[[1, 4, 7, 8], [1, 4, 10, 12], [3, 3, 11, 11], [0, 4, 10, 10], [1, 2, 11, 11], [3, 5, 13, 13]]", "output": "[false, false, false, false, false, false]", "testtype": "functional", "fn_name": "canMakePalindromeQueries"}, {"input": "\"lvxdjdnghyyskemmlabrqxdqjhrs\"\n[[0, 13, 27, 27], [1, 1,...
code_functional
[ { "content": "You are an expert Python 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\nYou are given two 0-indexed integer arrays nums1 and nums2 of sizes n and m, respectively.\nConsider calculat...
[{"input": "[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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]\n[100, ...
code_functional
[ { "content": "You are an expert Python 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\nYou are given three strings s1, s2, and s3. You have to perform the following operation on these three string...
[{"input": "\"hbhniasidxgnygbbtteuchnyouhvvxlxtjmxxxyzjhndhiruqrsydwfbufcjutvpefojrjgrvssgpbvqcms\"\n\"oxgpexzxwekxravgfwucyvxkgblahrjgizqkmhlakzrjtutqjysweersgmseqwmhrkwziosdogvfbcuvtfmizvuhqhgpculcfw\"\n\"ybqmoxugdmqhjxpxhrpilwjabcqsrxuvtiawcbwgzemklaptfmvutklzfknzomuvnpazfhpgeiixqcudneyhfqcftjwhrufa\"", "output": "-...
code_functional
[ { "content": "You are an expert Python 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\nYou are at a fruit market with different types of exotic fruits on display.\nYou are given a 1-indexed array ...
[{"input": "[89128, 97391, 95726, 31722, 56250, 60423, 68897, 72573, 99868, 22837, 50165, 93301, 54091, 37467, 39020, 53679, 49288, 33119, 4909, 98043, 87589, 90641, 46750, 39638, 85427, 77886, 41098, 67658, 48922, 44076, 43895, 16442, 17485, 10553, 98855, 26428, 31527, 64066, 6581, 19800, 81796, 17501, 71453, 75023, 8...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a string s and a positive integer k.\nLet vowels and consonants be the number of vowels and con...
[{"input": "\"qtzqusuuiruvgqokwyobwhphdvicpeidqetuxpjhgqhfhxilrfpeszcxqyaivojhjgzdkcpqhzkslevmpssgkxdbtdrhooozcxaynojqzhoujmwafykycdnlkiwirnbgaoxoxnastboafeafgbfqlslmlozsfyvxvjdsdzphhsnwfdlkekyatxvvurtfmyjacjbgkqmokdjnlvgljuqttkrzrxxodcremwomfmhjyvxtijinkesqhgvporslowjnwbhubesfuubnurepgldbsxyfmcqfbkmuxzgbhwrjcresiohmmb...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed integer array nums.\nYou can perform any number of operations, where each operation...
[{"input": "[86, 29, 13, 80]", "output": "2", "testtype": "functional", "fn_name": "findMaximumLength"}, {"input": "[1, 2, 3, 4]", "output": "4", "testtype": "functional", "fn_name": "findMaximumLength"}, {"input": "[4, 3, 2, 6]", "output": "3", "testtype": "functional", "fn_name": "findMaximumLength"}, {"input": "[74,...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed array nums consisting of positive integers.\nA partition of an array into one or mo...
[{"input": "[13, 2, 35, 46, 26, 59, 83, 99, 75, 62, 14, 69, 85, 51, 24, 65, 51, 63, 75, 36, 39, 9, 99, 91, 57, 66, 17, 87, 21, 18, 77, 28, 43, 18, 64, 65, 54, 23, 70, 50, 22, 2, 94, 85, 24, 25, 99, 46, 20, 12, 83, 79, 44, 51, 38, 44, 66, 33, 61, 95, 69, 36, 16, 43, 18, 10, 41, 23, 35, 28, 74, 74, 19, 26, 67, 21, 98, 47...
code_functional
[ { "content": "You are an expert Python 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\nYou are given an integer array nums and a positive integer k.\nReturn the number of subarrays where the maxim...
[{"input": "[35, 72, 27, 23, 2, 30, 40, 25, 2, 44, 67, 63, 92, 90, 7, 81, 71, 46, 66, 74, 15, 65, 94, 5, 87, 9, 58, 2, 16, 27, 61, 51, 14, 58, 72, 75, 36, 78, 27, 84, 29, 31, 86, 71, 73, 59, 35, 62, 70, 42, 86, 27, 22, 64, 50, 23, 31, 58, 24, 74, 95, 5, 50, 37, 100, 56, 86, 70, 4, 54, 82, 9, 78, 10, 13, 35, 59, 24, 36,...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed array of positive integers nums and a positive integer limit.\nIn one operation, yo...
[{"input": "[20, 5, 3, 17, 8, 11, 13, 18, 20, 8]\n4", "output": "[3, 5, 8, 8, 11, 13, 17, 18, 20, 20]", "testtype": "functional", "fn_name": "lexicographicallySmallestArray"}, {"input": "[10, 9, 8, 7, 6, 5, 4, 3, 2, 1]\n5", "output": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]", "testtype": "functional", "fn_name": "lexicographic...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed integer array batteryPercentages having length n, denoting the battery percentages ...
[{"input": "[64, 79, 59, 61, 36, 9, 5, 68, 24, 91, 61, 98, 86, 69, 56, 34, 72, 13, 79, 67, 64, 45, 48, 57, 91, 96, 20, 64, 21, 96, 39, 19, 59, 28, 27, 1, 40, 63, 37, 52, 97, 23, 78, 89, 20, 70, 88, 5, 58, 48, 55, 27, 3, 81, 31, 3, 62, 80, 29, 14, 73, 73, 81, 43, 68, 81, 3, 95, 48, 44, 8, 50, 6, 64, 77, 46, 43, 25, 8, 9...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed array mountain. Your task is to find all the peaks in the mountain array.\nReturn a...
[{"input": "[1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, ...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a string word and an integer k.\nA substring s of word is complete if:\n\nEach character in s o...
[{"input": "\"xojlrpdjadowciblepmcladideeieyvasxlefmmgcqdeilsrxgscfxtobmiieqxogirbxalzfnzrliizunlbarjzactxcdrraefujsqmuaxyqzqoducalkykstnjupqkweoyyxmqxiatitziqaxkflblpbvrfwhabjkpyupdiumzteuijgedttebuosydmlrskdfyplkzyhlrclogkjoxbsadoadchyjqfylnlchogkqmvxfvvarrluylqdazdapntkciizwjuuwhqgrhuirziwvrqzvbwusugxpvikzqzuowyunhw...
code_functional
[ { "content": "You are an expert Python 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\nYou are given an integer n and a 0-indexed integer array sick which is sorted in increasing order.\nThere are...
[{"input": "75535\n[26, 147, 151, 205, 259, 382, 383, 522, 532, 645, 660, 713, 726, 787, 814, 828, 847, 871, 912, 933, 935, 945, 971, 975, 1018, 1051, 1067, 1104, 1118, 1140, 1169, 1218, 1245, 1298, 1311, 1339, 1443, 1494, 1518, 1604, 1613, 1666, 1669, 1702, 1752, 1772, 1830, 1906, 1908, 1996, 2000, 2039, 2040, 2044, 2...
code_functional
[ { "content": "You are an expert Python 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\nYou are given an integer array nums and an integer k.\nThe frequency of an element x is the number of times i...
[{"input": "[1, 5, 8, 8, 5, 7, 1, 6, 10, 7]\n1", "output": "6", "testtype": "functional", "fn_name": "maxSubarrayLength"}, {"input": "[6, 10, 1, 3, 9, 2, 5, 5]\n5", "output": "8", "testtype": "functional", "fn_name": "maxSubarrayLength"}, {"input": "[1, 2, 3, 1, 2, 3, 1, 2]\n2", "output": "6", "testtype": "functional",...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed integer array nums of even length and there is also an empty array arr. Alice and B...
[{"input": "[56, 24, 46, 99, 21, 43, 1, 20, 40, 35, 7, 74, 61, 33, 63, 58, 43, 42, 26, 98, 85, 6, 87, 3, 93, 90, 41, 55, 98, 34, 20, 100, 1, 59, 90, 88, 70, 66, 11, 21, 26, 65, 67, 99, 10, 100, 25, 78, 32, 53, 89, 67, 4, 12, 17, 9, 72, 40, 97, 16, 95, 76, 12, 55, 1, 12, 61, 40, 74, 80, 100, 27, 53, 33, 96, 33, 15, 43, ...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed 2D integer matrix grid of size n * n with values in the range [1, n^2]. Each intege...
[{"input": "[[924, 1011, 956, 1287, 148, 1974, 1884, 1431, 266, 1110, 679, 480, 134, 1492, 1386, 1524, 1282, 541, 2003, 1064, 1872, 1073, 1786, 323, 1260, 2060, 1014, 1221, 1668, 209, 1445, 668, 1177, 1589, 43, 2473, 1740, 1195, 1656, 2139, 2382, 1771, 640, 492, 950, 1997, 934, 2327, 753, 1576], [171, 1830, 2031, 2187,...
code_functional
[ { "content": "You are an expert Python 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\nYou are given two 0-indexed integer arrays nums1 and nums2 of even length n.\nYou must remove n / 2 elements ...
[{"input": "[6, 1, 1, 18, 1, 8, 2, 5]\n[13, 8, 6, 18, 7, 11, 7, 5]", "output": "8", "testtype": "functional", "fn_name": "maximumSetSize"}, {"input": "[1, 2, 3, 4, 5, 6]\n[2, 3, 2, 3, 2, 3]", "output": "5", "testtype": "functional", "fn_name": "maximumSetSize"}, {"input": "[1, 1, 2, 2, 3, 3]\n[4, 4, 5, 5, 6, 6]", "outp...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed integer array nums having length n.\nYou are allowed to perform a special move any ...
[{"input": "[29471663, 71689165, 41127046, 30210507, 95424035, 27506338, 58019206, 9953143, 4200518, 58987766]", "output": "223905049", "testtype": "functional", "fn_name": "minimumCost"}, {"input": "[43, 87, 73, 85, 12, 53, 25, 42, 62, 59]", "output": "191", "testtype": "functional", "fn_name": "minimumCost"}, {"input...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed string word.\nIn one operation, you can pick any index i of word and change word[i]...
[{"input": "\"tuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmno\"", "output": "49", "testtype": "functional", "fn_name": "removeAlmostEqualCharacters"}, {"input": "\"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\""...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed integer array coins, representing the values of the coins available, and an integer...
[{"input": "[1, 4, 10, 5, 7, 19]\n19", "output": "1", "testtype": "functional", "fn_name": "minimumAddedCoins"}, {"input": "[1, 4, 10]\n19", "output": "2", "testtype": "functional", "fn_name": "minimumAddedCoins"}, {"input": "[1, 1, 1]\n20", "output": "3", "testtype": "functional", "fn_name": "minimumAddedCoins"}, {"in...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed string s and an integer k.\nYou are to perform the following partitioning operation...
[{"input": "\"xpfcubkanivkyjzrknwyapagrimbfidmckcyeupxioksdbcmucufydzepdedezeygezuvfmzyiodsenwqdldxjmwsvomyztnqpyxcqbwxnzhbfbogvdcnqjwqwedxmjblupctwicfofzczzyebagxmowivzpwlbucpyyevzidluoyltxsmvbfdeyvbentyozwebujyxfvvdewmvuxsxdviymdpjvlepegctykwxxbnyzccaemyqmlvzeitmvfjjlzqluvazjdvnovddnbtykyjdoisjibvgbniuqdxmxuvdhyawjkw...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed 2D array variables where variables[i] = [a_i, b_i, c_i, m_i], and an integer target...
[{"input": "[[112, 859, 589, 203], [677, 525, 46, 676], [497, 98, 231, 611], [65, 338, 666, 795], [747, 291, 775, 228], [200, 230, 310, 686], [805, 609, 431, 851], [852, 775, 701, 605], [44, 620, 620, 773], [760, 592, 809, 173], [371, 857, 370, 145], [665, 46, 144, 542], [938, 22, 888, 824], [134, 635, 745, 450], [20, ...
code_functional
[ { "content": "You are an expert Python 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\nYou are given two 0-indexed strings source and target, both of length n and consisting of lowercase English l...
[{"input": "\"jgqfqdxvmqgvezvueuwsckhhyaoeztviyvevdzphurhezpjtszhphewljvmcpxggxqhemrtggpqenjasrgvydedooeeuaainmfqi\"\n\"izyjfohigvxqygdpzyvhyvzacgploycdqgvbwrrcurwereggcrdjxessizccvsezmxqhgiiekubhrawocsfocsnmxeiwfyfobonh\"\n[\"a\", \"m\", \"k\", \"u\", \"q\", \"j\", \"v\", \"p\", \"l\", \"o\", \"f\", \"x\", \"g\", \"e\...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed array of integers nums.\nA prefix nums[0..i] is sequential if, for all 1 <= j <= i,...
[{"input": "[50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50]", "output": "51", "testtype": "functional", "fn_name": "missingInteger"}, {"input": "[28, 28, 28, 28, 28, 2...
code_functional
[ { "content": "You are an expert Python 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\nYou are given two positive integers x and y.\nIn one operation, you can do one of the four following operatio...
[{"input": "4865\n8501", "output": "3636", "testtype": "functional", "fn_name": "minimumOperationsToMakeEqual"}, {"input": "2160\n4559", "output": "2399", "testtype": "functional", "fn_name": "minimumOperationsToMakeEqual"}, {"input": "1642\n5290", "output": "3648", "testtype": "functional", "fn_name": "minimumOperatio...
code_functional
[ { "content": "You are an expert Python 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\nYou are given an integer k and an integer x.\nConsider s is the 1-indexed binary representation of an integer...
[{"input": "1000000000000000\n8", "output": "343778878348159", "testtype": "functional", "fn_name": "findMaximumNumber"}, {"input": "903365861266131\n7", "output": "296431861352328", "testtype": "functional", "fn_name": "findMaximumNumber"}, {"input": "1000000000000000\n1", "output": "44470852534271", "testtype": "func...
code_functional
[ { "content": "You are an expert Python 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\nYou are given an array nums consisting of positive integers.\nReturn the total frequencies of elements in num...
[{"input": "[78, 70, 54, 69, 52, 79, 50, 53, 54, 71, 56, 50, 60, 64, 56, 57, 52, 87, 62, 85, 87, 79, 69, 100, 94, 75, 67, 91, 68, 58, 76, 96, 98, 97, 78, 100, 77, 61, 79, 54, 64, 82, 66, 94, 59, 78, 54, 86, 99, 67, 100, 75, 81, 89, 64, 89, 58, 95, 72, 92, 64, 97, 84, 91, 87, 64, 100, 53, 78, 89, 58, 65, 67, 65, 88, 95,...
code_functional
[ { "content": "You are an expert Python 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\nYou are given three integers start, finish, and limit. You are also given a 0-indexed string s representing a...
[{"input": "408142522598107\n532089352496953\n3\n\"121220233212332\"", "output": "0", "testtype": "functional", "fn_name": "numberOfPowerfulInt"}, {"input": "900407863935940\n961459078569857\n9\n\"581747672523731\"", "output": "0", "testtype": "functional", "fn_name": "numberOfPowerfulInt"}, {"input": "7244775770970\n5...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed integer array nums containing positive integers.\nYour task is to minimize the leng...
[{"input": "[214, 177, 629, 842, 929, 810, 532, 971, 995, 647, 343, 881, 40, 361, 782, 694, 596, 30, 256, 440, 288, 466, 221, 360, 64, 524, 821, 747, 834, 284, 166, 807, 654, 196, 280, 983, 54, 165, 124, 709, 445, 977, 774, 297, 862, 375, 684, 704, 445, 432, 993, 385, 436, 22, 177, 608, 344, 640, 522, 714, 870, 548, 52...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed string s, a string a, a string b, and an integer k.\nAn index i is beautiful if:\n\...
[{"input": "\"nfdzqkutfwrticvdrsitfahjfoczojbfaedoeusubdnkvutcooitauqponsmkynkidtehdruswjuglcglpdtwznwvahoarmqbhyfdobjimwoidifyzqveurvvjsfqlpytlppqmagmdwsyryoakvqrolrhyunqjvpzsqetbrfyovivrrbcnmyblrayvdcwghvheblzacqofekvrhlupvueytgadzpxvxvopzuuasffrmrbreoxkatzwovvzioslojskbcgbrfunibcczxmzwfhujjewlrydlvkxhdpafsucsnuujmde...
code_functional
[ { "content": "You are an expert Python 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\nYou are given an array of positive integers nums.\nYou have to check if it is possible to select two or more ...
[{"input": "[20, 80, 99, 1, 67, 41, 43, 94, 75, 52, 85, 14, 26, 23, 89, 39, 15, 22, 67, 25, 23, 12, 31, 21, 91, 54, 23, 11, 89, 43, 81, 39, 78, 30, 79, 36, 96, 81, 89, 54, 68, 45, 68, 96, 17, 79, 70, 44, 67, 58, 53, 20, 39, 28, 82, 17, 20, 91, 13, 76, 32, 53, 48, 95, 12, 80, 16, 100, 55, 81, 48, 83, 93, 66, 79, 28, 27,...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed integer array nums and a positive integer k.\nYou can apply the following operation...
[{"input": "[440, 138, 865, 171, 338, 499, 957, 649, 845, 274]\n114020", "output": "10", "testtype": "functional", "fn_name": "minOperations"}, {"input": "[66, 28, 45, 60, 24, 73, 65, 18, 96, 37]\n1", "output": "2", "testtype": "functional", "fn_name": "minOperations"}, {"input": "[31, 8, 85, 59, 57, 53, 24, 33, 76, 99...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 2D 0-indexed integer array dimensions.\nFor all indices i, 0 <= i < dimensions.length, dimens...
[{"input": "[[100, 100], [100, 100], [100, 100], [100, 100], [100, 100], [100, 100], [100, 100], [100, 100], [100, 100], [100, 100], [100, 100], [100, 100], [100, 100], [100, 100], [100, 100], [100, 100], [100, 100], [100, 100], [100, 100], [100, 100], [100, 100], [100, 100], [100, 100], [100, 100], [100, 100], [100, 1...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed array of positive integers nums.\nA subarray of nums is called incremovable if nums...
[{"input": "[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, 1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50]", "output": "677", "testtype": "functional", "fn_name": "incremovableSubarrayCount"}, {"input": "[32, 50, 24, 33,...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed integer array nums and an integer k.\nIn one operation, you can pick any index i of...
[{"input": "[1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1]\n49", "...
code_functional
[ { "content": "You are an expert Python 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\nYou are given an array of positive integers nums of length n.\nA polygon is a closed plane figure that has at...
[{"input": "[1, 12, 1, 2, 5, 50, 3]", "output": "12", "testtype": "functional", "fn_name": "largestPerimeter"}, {"input": "[174, 396, 563]", "output": "1133", "testtype": "functional", "fn_name": "largestPerimeter"}, {"input": "[95, 88, 51, 35]", "output": "269", "testtype": "functional", "fn_name": "largestPerimeter"}...
code_functional
[ { "content": "You are an expert Python 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\nYou are given an array of integers nums of length n.\nThe cost of an array is the value of its first element....
[{"input": "[50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50]", "output": "150", "testtype": "functional", "fn_name": "minimumCost"}, {"input": "[1, 4, 6, 7, 7, 8, 10, 1...
code_functional
[ { "content": "You are an expert Python 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\nYou are given an array nums of length n and a positive integer k.\nA subarray of nums is called good if the a...
[{"input": "[9, 7, -8, 6, 6, 1, 2, 6, -8]\n10", "output": "7", "testtype": "functional", "fn_name": "maximumSubarraySum"}, {"input": "[-96, -96, -9, 43, -85, -53]\n18", "output": "0", "testtype": "functional", "fn_name": "maximumSubarraySum"}, {"input": "[-104965022, 933472124]\n1000", "output": "0", "testtype": "funct...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a string s that consists of lowercase English letters.\nA string is called special if it is mad...
[{"input": "\"grnnnnnnnnnnnnnnnnnnndywsdesevvtmjhmrnnnnnnnnnnapz\"", "output": "17", "testtype": "functional", "fn_name": "maximumLength"}, {"input": "\"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeedxdyvleqlmialrknr\"", "output": "31", "testtype": "functional", "fn_name": "maximumLength"}, {"input": "\"dzllllllllllllllllllllqordkl...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed integer array nums of size n, and a 0-indexed integer array pattern of size m consi...
[{"input": "[131844005, 503539488, 895277194, 759135098, 222859496, 417206297, 93592988, 652746849, 668575746, 426968159, 90365765, 524804995, 424162038, 852071046, 595357210, 495180102, 671676834, 876299439, 994737405, 627163327, 244830313, 602073054, 300741633, 718338014, 289606104, 39647787, 321603458, 111918550, 60...
code_functional
[ { "content": "You are an expert Python 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\nAlice and Bob are playing a turn-based game on a circular field surrounded by flowers. The circle represents ...
[{"input": "100000\n100000", "output": "5000000000", "testtype": "functional", "fn_name": "flowerGame"}, {"input": "90301\n25601", "output": "1155897950", "testtype": "functional", "fn_name": "flowerGame"}, {"input": "61160\n9412", "output": "287818960", "testtype": "functional", "fn_name": "flowerGame"}, {"input": "57...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed array of positive integers nums.\nIn one operation, you can swap any two adjacent e...
[{"input": "[73786976294838206463, 4294967295, 1048575, 4194303, 281474976710655, 75557863725914323419135, 3, 36028797018963967, 1180591620717411303423, 17179869183, 140737488355327, 511, 604462909807314587353087, 34359738367, 137438953471, 39614081257132168796771975167, 134217727, 309485009821345068724781055, 56294995...
code_functional
[ { "content": "You are an expert Python 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\nYou are given two 1-indexed integer arrays, nums and, changeIndices, having lengths n and m, respectively.\nI...
[{"input": "[500000000, 500000000, 500000000, 500000000, 500000000, 500000000, 500000000, 500000000, 500000000, 500000000, 500000000, 500000000, 500000000, 500000000, 500000000, 500000000, 500000000, 500000000, 500000000, 500000000, 500000000, 500000000, 500000000, 500000000, 500000000, 500000000, 500000000, 500000000,...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed string word and an integer k.\nAt every second, you must perform the following oper...
[{"input": "\"vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\"\n15", "output": "1", "testtype": "functional", "fn_name": "minimumTimeToInitialState"}, {"input": "\"banmdhxjedvjflpvhnoqsmikwdllsnqskkgrjwwsjjxeglvhrq\"\n25", "output": "2", "testtype": "functional", "fn_name": "minimumTimeToInitialState"}, {"input": "...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed array nums consisting of positive integers.\nInitially, you can increase the value ...
[{"input": "[33, 99, 15, 16, 62, 21, 13, 77, 90, 53]", "output": "3", "testtype": "functional", "fn_name": "maxSelectedElements"}, {"input": "[95, 39, 80, 90, 55, 90, 83, 5, 20, 98]", "output": "2", "testtype": "functional", "fn_name": "maxSelectedElements"}, {"input": "[16, 14, 12, 11, 10, 8, 7, 4, 3, 1]", "output": "...
code_functional
[ { "content": "You are an expert Python 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\nYou are given an array of positive integers nums.\nYou need to select a subset of nums which satisfies the fo...
[{"input": "[5, 4, 1, 2, 2]", "output": "3", "testtype": "functional", "fn_name": "maximumLength"}, {"input": "[6, 5, 2, 6, 1]", "output": "1", "testtype": "functional", "fn_name": "maximumLength"}, {"input": "[6, 4, 10, 6]", "output": "1", "testtype": "functional", "fn_name": "maximumLength"}, {"input": "[1, 3, 2, 4]"...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a string s.\nConsider performing the following operation until s becomes empty:\n\nFor every al...
[{"input": "\"aabcbbca\"", "output": "\"ba\"", "testtype": "functional", "fn_name": "lastNonEmptyString"}, {"input": "\"abcd\"", "output": "\"abcd\"", "testtype": "functional", "fn_name": "lastNonEmptyString"}, {"input": "\"vct\"", "output": "\"vct\"", "testtype": "functional", "fn_name": "lastNonEmptyString"}, {"input...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed string array words.\nLet's define a boolean function isPrefixAndSuffix that takes t...
[{"input": "[\"svlgyoqkyw\", \"svlgyoqkyw\", \"svlgyoqkyw\", \"svlgyoqkyw\", \"svlgyoqkyw\", \"svlgyoqkyw\", \"svlgyoqkyw\", \"svlgyoqkyw\", \"svlgyoqkyw\", \"svlgyoqkyw\", \"svlgyoqkyw\", \"svlgyoqkyw\", \"svlgyoqkyw\", \"svlgyoqkyw\", \"svlgyoqkyw\", \"svlgyoqkyw\", \"svlgyoqkyw\", \"svlgyoqkyw\", \"svlgyoqkyw\", \"s...
code_functional
[ { "content": "You are an expert Python 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\nAn ant is on a boundary. It sometimes goes left and sometimes right.\nYou are given an array of non-zero inte...
[{"input": "[1, 7, 9, 1, 5, -9, -9, -7, 4, -2, -7, -2, 10, 3, -9, -7, 1, 7, 10, 3, -4, 3, -2, 9, -9, -1, -10, 8, 1, 2, 10, 6, -4, -6, -6, -7, 6, 4, -4, 5, -8, 0, -1, -9, -7, -4, 8, 7, 9, -2, 6, 9, -10, 8, 1, 1, 6, -2, 0, 6, -7, 10, -3, 9, -9, 10, -6, 1, 3, 8, -5, 2, -2, -6, 4, 6, -3, -8, 6, 9, 7, -10, 5, -9, -2, 10, 6,...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed string s typed by a user. Changing a key is defined as using a key different from t...
[{"input": "\"CRJEJYXHJAJUZQLSGDFCSMKSBAODDTATIFAOHBDSZIYUGVRBOEVCODFCLMUTTSBJZXAVBHIIPEIXYSXTXYNVCZZZOMSNHVHGZHKE\"", "output": "94", "testtype": "functional", "fn_name": "countKeyChanges"}, {"input": "\"RqZlRtJhLfPZXonaRNgfShpvIBrScljQGLtiySpeSwMQcQZPdxSgTBRiNWySVPweOAbrbRoywfWhcmrZgETIpDxmeXRMxQlznyxJ\"", "output": ...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed string array words having length n and containing 0-indexed strings.\nYou are allow...
[{"input": "[\"rcnw\", \"aimsjac\", \"r\", \"rcni\", \"scjyzidszs\", \"yki\"]", "output": "5", "testtype": "functional", "fn_name": "maxPalindromesAfterOperations"}, {"input": "[\"zo\", \"yrb\", \"tpey\", \"b\", \"zeafqjno\", \"bsdbwfqytu\"]", "output": "5", "testtype": "functional", "fn_name": "maxPalindromesAfterOper...
code_functional
[ { "content": "You are an expert Python 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\nGiven an array of integers called nums, you can perform the following operation while nums contains at least ...
[{"input": "[500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 50...
code_functional
[ { "content": "You are an expert Python 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\nYou are given an integer array nums of even length. You have to split the array into two parts nums1 and nums...
[{"input": "[5, 84, 22, 86, 87, 78, 53, 86, 49, 6, 31, 75, 96, 86, 37, 5, 84, 1, 96, 9, 17, 34, 7, 38, 32, 91, 60, 43, 34, 94, 51, 92, 41, 46, 87, 44, 39, 35, 10, 84, 55, 96, 32, 69, 3, 30, 51, 93, 27, 66, 11, 47, 75, 25, 26, 21, 92, 32, 76, 83, 5, 82, 28, 39, 27, 67, 13, 57, 74, 27, 49, 26, 70, 19, 52, 9, 95, 21, 63, ...
code_functional
[ { "content": "You are an expert Python 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\nYou are given two arrays with positive integers arr1 and arr2.\nA prefix of a positive integer is an integer ...
[{"input": "[83, 37, 14, 44, 51]\n[4, 95, 88, 31]", "output": "1", "testtype": "functional", "fn_name": "longestCommonPrefix"}, {"input": "[123456, 12345678]\n[123456]", "output": "6", "testtype": "functional", "fn_name": "longestCommonPrefix"}, {"input": "[67, 41, 18]\n[41, 10, 53]", "output": "2", "testtype": "functi...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 0-indexed integer array nums, and an integer k.\nIn one operation, you can remove one occurre...
[{"input": "[1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000, 1000000...
code_functional
[ { "content": "You are an expert Python 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\nYou are given a 1-indexed array of distinct integers nums of length n.\nYou need to distribute all the elemen...
[{"input": "[3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62...
code_functional
[ { "content": "You are an expert Python 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\nTakahashi and Aoki played N games.\r\nYou are given a string S of length N, representing the results of these...
[{"input": "100\nAAAAAAAAAAAAAAAAAAAAAAAATTTAAAAATATTATAAAATATAATAATTAAAAAAAAATATTTATTTATAAAATATAAAATAATTAAATATATAATA\n", "output": "A\n", "testtype": "stdin"}, {"input": "98\nTTAATATTATATAATTAAAATAATTTATATAAATTAATAATTATTTATAATATATAATAAATAATAATTTATAATAATTTTTATATTTATTATAATTA\n", "output": "T\n", "testtype": "stdin"}, {"...
code_stdio
[ { "content": "You are an expert Python 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\nWe have a sequence of length N consisting of positive integers: A=(A_1,\\ldots,A_N). Any two adjacent terms h...
[{"input": "100\n100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1\n",...
code_stdio
[ { "content": "You are an expert Python 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\nA single-player card game is popular in AtCoder Inc.\r\nEach card in the game has a lowercase English letter ...
[{"input": "oddopodcorbrearripvhdodheggnotodgagoocdvyvdocqrandesyoahrypyredyyaoiasaaecccaeoedogcicqlejndqsrbddetxcogrrrertyrosbkdavtftdkottarcrtttzqtsaxetleiajardksccrfawdqtdbctcrrlmtroawrrltvauauccvsdoteaaotsptcemobzretrjredtrdgaerzvarrvidcffevyjrettestrwgotjkezwdarckduetooogukcbcdannoareoodcadtadnerzyrzdttoecwdooaudj...
code_stdio
[ { "content": "You are an expert Python 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\nYou are given an integer N and a string S consisting of 0, 1, and ?.\nLet T be the set of values that can be ...
[{"input": "????????????????????????????????????????????????????????????\n1000000000000000000\n", "output": "1000000000000000000\n", "testtype": "stdin"}, {"input": "?????????????01???????????1??????1?0??????00????0??????1???\n452616349750709279\n", "output": "452576578170158079\n", "testtype": "stdin"}, {"input": "???...
code_stdio
[ { "content": "You are an expert Python 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\nWe have a grid with H rows and W columns.\r\nLet (i,j) denote the square at the i-th row from the top and j-t...
[{"input": "300 300 1734498\n######..###.##.#####.#####..##.###.#.#.#...############..#...###.####.##..###.#####.##.########.####.###.####..#..####...##########.########.#.###.##########..####.###..#######.###.#########.###..########.###.##.########.#####...##.###############.##.#####################..###.###.##.#####....
code_stdio
[ { "content": "You are an expert Python 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\nA DDoS-type string is a string of length 4 consisting of uppercase and lowercase English letters satisfying b...
[{"input": "????????????????????????????????????????\n", "output": "858572093\n", "testtype": "stdin"}, {"input": "?D??S\n", "output": "136604\n", "testtype": "stdin"}, {"input": "????\n", "output": "7294040\n", "testtype": "stdin"}, {"input": "DD??S\n", "output": "676\n", "testtype": "stdin"}]
code_stdio
[ { "content": "You are an expert Python 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\nThere is an enemy with stamina A. Every time you attack the enemy, its stamina reduces by B.\nAt least how m...
[{"input": "999999999999999998 2\n", "output": "499999999999999999\n", "testtype": "stdin"}, {"input": "406777939015149177 2\n", "output": "203388969507574589\n", "testtype": "stdin"}, {"input": "623064468778408115 5\n", "output": "124612893755681623\n", "testtype": "stdin"}, {"input": "802035354240686040 9257449580322...
code_stdio
[ { "content": "You are an expert Python 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\nThere is a grid with H horizontal rows and W vertical columns. Each cell has a lowercase English letter writ...
[{"input": "100 98\nsseeskneseusenkekneskkuenkkuunuuenesekekskunnukeuseeunsuseseeknunuksusnesenkskkneekskeukuknnnsnkue\nseskkeususensnnuesksnsssesssnneunuuneksunnnnunesnsskueusuukuesskksukkessneeeeuneenksenkeukunsskusu\nneuknsesusnsenknkusnneekksseeesnssueensueknusnskkknukkkssukseunkkeuukeeneeskkksnsunkkeesenskkkukuu\n...
code_stdio
[ { "content": "You are an expert Python 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\nYou are given N strings S_1,S_2,\\dots,S_N, each of length M, consisting of lowercase English letter. Here, ...
[{"input": "8 5\nlvntx\nlvytx\nlvynx\nmvfox\nmvyox\novfox\nlvnwx\nmvynx\n", "output": "Yes\n", "testtype": "stdin"}, {"input": "8 5\naoymb\nfoymb\npocmb\npvcdb\npicdb\npocdb\nfocmb\npicgb\n", "output": "Yes\n", "testtype": "stdin"}, {"input": "8 5\nbtacv\nbgacv\nbtlcv\nbwoyv\nbgucv\nbtoyv\nbguyv\nbwuyv\n", "output": "Y...
code_stdio
[ { "content": "You are an expert Python 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\nTakahashi has decided to give one gift to Aoki and one gift to Snuke.\r\nThere are N candidates of gifts for ...
[{"input": "1 1 1000000000000000000\n1000000000000000000\n1000000000000000000\n", "output": "2000000000000000000\n", "testtype": "stdin"}, {"input": "8 6 1\n2 5 6 5 2 1 7 9\n7 2 5 5 2 4\n", "output": "14\n", "testtype": "stdin"}, {"input": "3 3 0\n1 3 3\n6 2 7\n", "output": "-1\n", "testtype": "stdin"}, {"input": "2 3 ...
code_stdio
[ { "content": "You are an expert Python 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\nThere is an undirected graph with N vertices numbered 1 through N, and initially with 0 edges.\r\nGiven Q que...
[{"input": "3 7\n1 1 2\n1 1 3\n1 2 3\n2 1\n1 1 2\n2 2\n1 1 2\n", "output": "1\n0\n0\n1\n0\n3\n1\n", "testtype": "stdin"}, {"input": "2 1\n2 1\n", "output": "2\n", "testtype": "stdin"}]
code_stdio