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\nThere are three cards with letters $\\texttt{a}$, $\\texttt{b}$, $\\texttt{c}$ placed in a row in some order.... | [{"input": "6\nabc\nabc\nabc\nabc\nabc\nabc\n", "output": "YES\nYES\nYES\nYES\nYES\nYES\n", "testtype": "stdin"}, {"input": "6\nabc\nacb\nbac\nbca\ncab\ncba\n", "output": "YES\nYES\nYES\nNO\nNO\nYES\n", "testtype": "stdin"}, {"input": "5\ncab\nacb\ncba\nbac\nbca\n", "output": "NO\nYES\nYES\nYES\nNO\n", "testtype": "std... | 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\nSlavic is preparing a present for a friend's birthday. He has an array $a$ of $n$ digits and the present will... | [{"input": "9\n9\n1 3 1 2 3 6 5 9 4\n8\n4 9 0 5 5 0 6 6\n7\n9 0 6 3 2 5 0\n6\n6 0 1 3 1 6\n2\n8 2\n9\n5 8 5 9 7 8 9 8 5\n5\n8 0 1 2 3\n9\n0 0 2 2 5 8 2 8 7\n7\n9 8 1 6 5 2 5\n", "output": "38880\n0\n0\n108\n24\n43545600\n48\n0\n43200", "testtype": "stdin"}, {"input": "9\n6\n6 1 8 4 9 1\n4\n4 6 9 4\n1\n5\n2\n7 6\n6\n4 2... | 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 a strip of paper $s$ that is $n$ cells long. Each cell is either black or white. In an operatio... | [{"input": "8\n6 3\nWBWWWB\n7 3\nWWBWBWW\n5 4\nBWBWB\n5 5\nBBBBB\n8 2\nBWBWBBBB\n10 2\nWBBWBBWBBW\n4 1\nBBBB\n3 2\nWWW\n", "output": "2\n1\n2\n1\n4\n3\n4\n0\n", "testtype": "stdin"}, {"input": "9\n2 2\nBW\n4 3\nWBBB\n7 2\nWBBWWBB\n5 5\nBBWBW\n6 2\nBWWWBW\n2 1\nBB\n2 1\nBW\n8 2\nBBBWWWBB\n2 1\nWB\n", "output": "1\n1\n2\... | 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 array of integers $a_1, a_2, \\ldots, a_n$ and a number $k$ ($2 \\leq k \\leq 5$). In one op... | [{"input": "15\n2 5\n7 3\n3 3\n7 4 1\n5 2\n9 7 7 3 9\n5 5\n5 4 1 2 3\n7 4\n9 5 1 5 9 5 1\n3 4\n6 3 6\n3 4\n6 1 5\n3 4\n1 5 9\n4 4\n1 4 1 1\n3 4\n3 5 3\n4 5\n8 9 9 3\n2 5\n1 6\n2 5\n10 10\n4 5\n1 6 1 1\n2 5\n7 7\n", "output": "2\n2\n1\n0\n2\n0\n1\n2\n0\n1\n1\n4\n0\n4\n3\n", "testtype": "stdin"}, {"input": "4\n10 5\n7 2 ... | 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\nVanya and Vova are playing a game. Players are given an integer $n$. On their turn, the player can add $1$ to... | [{"input": "100\n201\n202\n203\n204\n205\n206\n207\n208\n209\n210\n211\n212\n213\n214\n215\n216\n217\n218\n219\n220\n221\n222\n223\n224\n225\n226\n227\n228\n229\n230\n231\n232\n233\n234\n235\n236\n237\n238\n239\n240\n241\n242\n243\n244\n245\n246\n247\n248\n249\n250\n251\n252\n253\n254\n255\n256\n257\n258\n259\n260\n261... | 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\nAlex is participating in the filming of another video of BrMeast, and BrMeast asked Alex to prepare 250 thous... | [{"input": "6\n6\n18671599 50973273 23725187 3824814 84745199 57521244\n4\n20571575 73545751 34416072 14351717\n6\n90850673 78650040 83258092 20508774 3086408 28307030\n6\n57339113 81072852 983952 94978897 27205027 20367934\n8\n91658582 42067089 85344456 18324259 27881026 89323807 16089314 35448469\n9\n84246488 6056139... | 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 subarray is a continuous part of array.\n\nYarik recently found an array $a$ of $n$ elements and became ver... | [{"input": "7\n5\n1 2 3 4 5\n4\n9 9 8 8\n6\n-1 4 -1 0 5 -4\n4\n-1 2 4 -3\n1\n-1000\n3\n101 -99 101\n20\n-10 5 -8 10 6 -10 7 9 -2 -6 7 2 -4 6 -1 7 -6 -7 4 1\n", "output": "15\n17\n8\n4\n-1000\n101\n10\n", "testtype": "stdin"}, {"input": "1\n1\n-737\n", "output": "-737", "testtype": "stdin"}, {"input": "1\n2\n-1 -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\nYarik is a big fan of many kinds of music. But Yarik loves not only listening to music but also writing it. H... | [{"input": "7\n74\n56845840 239859052 608123628 818147659 366869143 254413226 84194707 581092257 233243305 634857375 69134050 611489097 866450455 884740174 217455827 593699679 806299390 439574432 113071647 983870667 879599133 97043809 417543274 684931483 115428280 729099918 648157935 929806685 571779040 996008917 59265... | 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 a 0-indexed array of strings details. Each element of details provides information about a give... | [{"input": "[\"9675739045O7352\", \"0069321315F3934\", \"7675616641F8567\", \"1752234081O7913\", \"5381188774F8123\", \"5677958465M4051\", \"1503144167O5214\", \"4455687417M8204\", \"4575862561M2136\", \"3091744924F6282\", \"0165853975M8805\", \"6519153173F4583\", \"9928356944O3843\", \"5817381775F5256\", \"0720375692M... | 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 array nums. Initially, your score is 0. Perform the following operations... | [{"input": "[[677, 457, 892], [483, 110, 349], [283, 449, 683], [21, 888, 700], [478, 33, 211], [966, 236, 834]]", "output": "2257", "testtype": "functional", "fn_name": "matrixSum"}, {"input": "[[234, 492, 348, 635, 971, 194, 505], [889, 873, 244, 938, 737, 6, 488]]", "output": "4396", "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 a 0-indexed integer array nums of length n and an integer k. In an operation, you can choose an... | [{"input": "[3761]\n12", "output": "15405056", "testtype": "functional", "fn_name": "maximumOr"}, {"input": "[95041]\n6", "output": "6082624", "testtype": "functional", "fn_name": "maximumOr"}, {"input": "[8, 1, 2]\n2", "output": "35", "testtype": "functional", "fn_name": "maximumOr"}, {"input": "[1217]\n5", "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 representing the score of students in an exam. The teacher would... | [{"input": "[-9, -9, -6, -7, -3, -7, -6, -4, -1, -9, -2, -2, -3]", "output": "185177664", "testtype": "functional", "fn_name": "maxStrength"}, {"input": "[3, -1, -5, 2, 5, -9]", "output": "1350", "testtype": "functional", "fn_name": "maxStrength"}, {"input": "[-9, 1, 1, 0, -1, 9]", "output": "81", "testtype": "function... | 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 a dictionary of words dictionary. You have to break s into one or more... | [{"input": "\"frickzggjkpukhvnxcobqspnnaalkjvpnmrhmzikjupzldsxb\"\n[\"gupaoxiattxtctlpcbylcdxfhflzatdmhtcyqzlwop\", \"snuzxkpxvfixrcubmlnjpnhxdeaypnlldwhcynwojktkb\", \"ahugmldkaeqxzdwpblcnbxuxfzrockdqlkepmbivvpwzpsjgj\", \"ssudvtzsdlxgucfc\", \"zlropnfwuk\", \"smalwustqjpmqlrcebiywjybpxvrbbzppudyzsuxy\", \"xhzeprgszla... | 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 prices representing the prices of various chocolates in a store. You are also ... | [{"input": "[100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67, 66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51]\n100", "output": "100", "testtype": "functional", "fn_name": "buyChoco"}, {"input": "[45, 48, 16, 23, 42, ... | 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 numeric strings num1 and num2 and two integers max_sum and min_sum. We denote an integer x ... | [{"input": "\"3046150261507503990489\"\n\"7775829181095068737136\"\n127\n169", "output": "157138097", "testtype": "functional", "fn_name": "count"}, {"input": "\"738081037827515190649\"\n\"2197300974439040693603\"\n147\n196", "output": "258362773", "testtype": "functional", "fn_name": "count"}, {"input": "\"96748399701... | 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 length n.\nThe distinct difference array of nums is an array diff of ... | [{"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, 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": "[-48, -46, -44, -42, -40, -38, -36, -34, -32, -30, -28, -26, -24, -22, -20, -18, -16, -14, -12, -10, -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\nThere is a 0-indexed array nums of length n. Initially, all elements are uncolored (has a value of 0).\nYou a... | [{"input": "10000\n[[3955, 88699], [425, 41496], [5146, 66827], [768, 16401], [6832, 21568], [1164, 19519], [7325, 39099], [8396, 67868], [8443, 52996], [3696, 64920], [6818, 98709], [2107, 92863], [9727, 58141], [2454, 21739], [4149, 55484], [683, 3763], [900, 46124], [6302, 88794], [6884, 43443], [9207, 19490], [5419... | 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 representing the strength of some heroes. The power of a group o... | [{"input": "[10, 22, 39, 51]", "output": "592263", "testtype": "functional", "fn_name": "sumOfPower"}, {"input": "[565291574]", "output": "380741766", "testtype": "functional", "fn_name": "sumOfPower"}, {"input": "[1, 3, 9, 3, 6]", "output": "4114", "testtype": "functional", "fn_name": "sumOfPower"}, {"input": "[50, 7,... | 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 permutation of n integers nums.\nA permutation is called semi-ordered if the first ... | [{"input": "[1, 28, 39, 12, 14, 6, 15, 27, 17, 38, 45, 16, 25, 37, 26, 44, 46, 10, 33, 40, 35, 4, 32, 34, 11, 9, 21, 43, 41, 48, 22, 30, 42, 50, 8, 29, 23, 5, 49, 13, 7, 3, 24, 20, 2, 31, 19, 36, 18, 47]", "output": "16", "testtype": "functional", "fn_name": "semiOrderedPermutation"}, {"input": "[50, 49, 48, 47, 46, 45... | 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 that consists of digits from 0 to 9.\nA string t is called a semi-repetiti... | [{"input": "\"58957479549437162345618928832412218355982224525842\"", "output": "32", "testtype": "functional", "fn_name": "longestSemiRepetitiveSubstring"}, {"input": "\"19431832444439006895006189596466887181869887222990\"", "output": "16", "testtype": "functional", "fn_name": "longestSemiRepetitiveSubstring"}, {"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\nThere are n friends that are playing a game. The friends are sitting in a circle and are numbered from 1 to n... | [{"input": "50\n50", "output": "[2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50]", "testtype": "functional", "fn_name": "circularGameLosers"}, {"input": "50\n25", "output": "[2, 3,... | 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\nA 0-indexed array derived with length n is derived by computing the bitwise XOR (⊕) of adjacent values in a b... | [{"input": "[1, 0, 1, 1, 0]", "output": "false", "testtype": "functional", "fn_name": "doesValidArrayExist"}, {"input": "[1, 1, 0, 1]", "output": "false", "testtype": "functional", "fn_name": "doesValidArrayExist"}, {"input": "[0, 1, 1, 0]", "output": "true", "testtype": "functional", "fn_name": "doesValidArrayExist"},... | 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 consisting only of uppercase English letters.\nYou can apply some operations to this... | [{"input": "\"GKLUQTVRWNPSLJBXHNHKNWOGKIYQFUEAYGXWZURCTJLUVQJFIOLIYQVIIKKSTOKDQMIWQBUCEOCQYEGNIVRORJLZJUUUXTPVUUPG\"", "output": "100", "testtype": "functional", "fn_name": "minLength"}, {"input": "\"ABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCD\"", "output": "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\nGiven a positive integer n, return the punishment number of n.\nThe punishment number of n is defined as the ... | [{"input": "948", "output": "5915179", "testtype": "functional", "fn_name": "punishmentNumber"}, {"input": "879", "output": "3353149", "testtype": "functional", "fn_name": "punishmentNumber"}, {"input": "898", "output": "3353149", "testtype": "functional", "fn_name": "punishmentNumber"}, {"input": "661", "output": "120... | 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, cost and time, of size n representing the costs and the time take... | [{"input": "[527025, 765058, 423943, 625196, 905794, 791238, 33620, 548527, 52955, 609172, 441089, 623435, 629019, 257321, 113490, 551514, 788738, 978232, 816919, 882244, 524373, 202224, 779743, 627369, 756404, 838411, 255361, 187958, 875474, 370743, 403807, 767851, 478850, 414691, 258717, 940413, 214019, 439422, 73569... | 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 representing the cost of collecting different chocolat... | [{"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 two integers, n and k.\nAn array of distinct positive integers is called a k-avoiding array if ... | [{"input": "38\n49", "output": "1077", "testtype": "functional", "fn_name": "minimumSum"}, {"input": "40\n41", "output": "1220", "testtype": "functional", "fn_name": "minimumSum"}, {"input": "47\n28", "output": "1557", "testtype": "functional", "fn_name": "minimumSum"}, {"input": "45\n89", "output": "1079", "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 integers, num and t.\nAn integer x is called achievable if it can become equal to num after... | [{"input": "47\n40", "output": "127", "testtype": "functional", "fn_name": "theMaximumAchievableX"}, {"input": "30\n41", "output": "112", "testtype": "functional", "fn_name": "theMaximumAchievableX"}, {"input": "49\n38", "output": "125", "testtype": "functional", "fn_name": "theMaximumAchievableX"}, {"input": "30\n50",... | 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 consisting of lowercase English letters, and you are allowed to perform operations o... | [{"input": "\"bqnspwhewiwifxgbyxnhlmllhgyzpdtecnvehpbunjtaseqttpucddllomebtyldayriisqndconmejiparhibnyogzrrpxhuetvyehhxvhwabfsxluowmwzampkzsklxyjrazrrpnxmeuzbcgapgyszjoyczttvwiaskqtbfyzxuskblmchjztasduqwsbskqihuttordurfwqdwsytrncgallspxaxgnkyckynujujmftogtyixwamggubrcdtjhrwucypguzovcjytwxqoidbhrsaswkqtefzpzmmfwaxplaqla... | 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 of length n on which you can apply two types of operations:\n\nChoo... | [{"input": "\"010101\"", "output": "9", "testtype": "functional", "fn_name": "minimumCost"}, {"input": "\"0011\"", "output": "2", "testtype": "functional", "fn_name": "minimumCost"}, {"input": "\"1101\"", "output": "3", "testtype": "functional", "fn_name": "minimumCost"}, {"input": "\"111\"", "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\nGiven a positive integer num represented as a string, return the integer num without trailing zeros as a stri... | [{"input": "\"234724804482568319791595324275395413645846813553056959698256437680674423220958620944344590403232960487688474043357842233107828811591371805934292403978120483981765568409504595657184401796477564316716850950752949115162564754705979402619320920418777168552956184601194746694946915185587276413474044809208642146... | 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 that consists of exactly 3 digits.\nWe call the number n fascinating if, after the... | [{"input": "100", "output": "false", "testtype": "functional", "fn_name": "isFascinating"}, {"input": "772", "output": "false", "testtype": "functional", "fn_name": "isFascinating"}, {"input": "360", "output": "false", "testtype": "functional", "fn_name": "isFascinating"}, {"input": "303", "output": "false", "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\nGiven a 0-indexed string s, repeatedly perform the following operation any number of times:\n\nChoose an inde... | [{"input": "\"aaaabbbbccccddddeeeeffffgggghhhhiiiijjjjkkkkllllmmmmnnnnooooppppqqqqrrrrssssttttuuuuvvvvwwwwxxxxyyyyzzzz\"", "output": "26", "testtype": "functional", "fn_name": "minimizedStringLength"}, {"input": "\"kbsyhdkcbrqdxlliwapqvxinziqwgddllvzwzedlsjxqnomlbkimqsdupgehykjogbjzypcdthtghpoywxhchujfxvnynjnmaayj\"", ... | 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 you are allowed to traverse between its indices. You can tr... | [{"input": "[19829, 33690, 67229, 71660, 24380, 56444, 3930, 81595, 79149, 69063, 20075, 65405, 71423, 94698, 86026, 7578, 25442, 21779, 83183, 55750, 68587, 73705, 29586, 61087, 48378, 40786, 66687, 558, 89413, 95473, 4190, 30818, 40229, 59943, 66407, 31810, 90749, 50321, 6838, 64579, 44202, 43803, 34330, 22586, 75108... | 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 consisting of only lowercase English letters. In one operation, you can do the follo... | [{"input": "\"leetcode\"", "output": "\"kddsbncd\"", "testtype": "functional", "fn_name": "smallestString"}, {"input": "\"cbabc\"", "output": "\"baabc\"", "testtype": "functional", "fn_name": "smallestString"}, {"input": "\"acbbc\"", "output": "\"abaab\"", "testtype": "functional", "fn_name": "smallestString"}, {"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 integer array nums. A pair of indices i, j where 0 <= i < j < nums.length is called... | [{"input": "[2861, 1283, 3863, 1782, 2991, 1464, 1742, 8039, 5225, 3136, 1688, 8004, 6068, 6995, 7065, 2471, 9882, 4519, 4924, 9285, 1604, 3965, 3319, 5233, 5503, 872, 8066, 2629, 1792, 359, 4746, 2335, 3289, 3733, 5424, 2961, 9421, 1253, 3381, 2248, 8907, 1013, 5843, 3966, 6133, 9437, 1318, 4576, 2951, 5608, 4167, 550... | 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.\nA subarray is called equal if all of its elem... | [{"input": "[833, 904, 648, 656, 357, 98, 170, 419, 834, 357, 521, 102, 351, 614, 483, 567, 71, 332, 31, 177, 255, 139, 21, 641, 158, 466, 61, 341, 285, 506, 761, 251, 686, 877, 435, 623, 141, 568, 679, 484, 422, 700, 785, 436, 898, 640, 139, 617, 582, 254, 43, 634, 767, 122, 576, 727, 351, 615, 49, 97, 504, 640, 838, ... | 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 denoting the total number of servers and a 2D 0-indexed integer array logs, where ... | [{"input": "100\n[[28, 733493], [64, 667990], [28, 943293], [51, 661181], [72, 677871], [7, 974145], [22, 836570], [95, 975793], [45, 53605], [89, 70319]]\n56795\n[697577, 705845, 441502, 219912, 698752, 332340, 539534, 671451, 204742, 94217, 576919, 201117, 494691, 246144, 66812, 273893, 857362, 571055, 388285, 601051... | 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 representing the initial positions of some marbles. You are also... | [{"input": "[7, 3, 1, 10, 7]\n[3, 8, 3, 4, 7, 6, 2, 10, 3, 1, 4, 7, 1, 3, 10, 8, 4, 4, 9, 2, 5, 1, 9, 8, 6, 4, 5, 5, 4, 8, 2, 8, 5, 8, 9, 3, 8, 6, 3, 3, 6, 3, 9, 2, 3, 4, 3, 1, 8, 2, 6, 9, 1, 3, 9, 7, 8, 2, 4, 9, 5, 3, 6, 6, 7, 2, 8, 1, 10, 8, 8, 8, 4, 1, 1, 8, 4, 9, 3, 10, 5, 5, 3, 3, 5, 4, 10, 10, 9, 10]\n[8, 3, 4, 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 two integers num1 and num2.\nIn one operation, you can choose integer i in the range [0, 60] an... | [{"input": "1152921504606846976\n-1000000000", "output": "13", "testtype": "functional", "fn_name": "makeTheIntegerZero"}, {"input": "144115188075855872\n-764496824", "output": "13", "testtype": "functional", "fn_name": "makeTheIntegerZero"}, {"input": "72057594037927936\n861305832", "output": "32", "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 two 0-indexed integer arrays nums1 and nums2, each of length n, and a 1-indexed 2D array querie... | [{"input": "[2, 10, 2, 7, 9]\n[2, 3, 2, 2, 1]\n[[5, 4], [4, 4], [5, 2]]", "output": "[-1, -1, 13]", "testtype": "functional", "fn_name": "maximumSumQueries"}, {"input": "[5]\n[5]\n[[4, 1], [3, 1], [2, 9], [6, 1], [6, 6]]", "output": "[10, 10, -1, -1, -1]", "testtype": "functional", "fn_name": "maximumSumQueries"}, {"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 1-indexed integer array nums of length n.\nAn element nums[i] of nums is called special if 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": "15000", "testtype": "functional", "fn_name": "sumOfSquares"}, {"input": "[36, 13, 50, 15, 34, ... | 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 positive integer array nums.\nPartition nums into two arrays, nums1 and nums2, such that:\n\n... | [{"input": "[99437, 73721, 53697, 11237, 70441, 75079, 84082, 1581, 87401, 89099, 10277, 1969, 64515, 71527, 45437, 27058, 17697, 96902, 62636, 20809, 66870, 42468, 10973, 53505, 72935, 20168, 7499, 86956, 94938, 68682, 4407, 63498, 55511, 96506, 21613, 16006, 56888, 23133, 68566, 88123, 73602, 39557, 6002, 26836, 9165... | 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 words consisting of distinct strings.\nThe string words[i] can be paired with... | [{"input": "[\"vz\", \"zv\", \"fn\", \"nf\", \"ic\", \"ci\", \"tb\", \"bt\", \"mx\", \"xm\", \"uk\", \"ku\", \"gt\", \"tg\", \"mq\", \"qm\", \"iv\", \"vi\", \"gi\", \"ig\", \"lp\", \"pl\", \"sy\", \"ys\", \"hn\", \"nh\", \"vf\", \"fv\", \"vj\", \"jv\", \"xd\", \"dx\", \"hf\", \"fh\", \"tk\", \"kt\", \"qe\", \"eq\", \"f... | 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 n distinct positive integers. A permutation of nums i... | [{"input": "[100000007, 200000014, 300000021, 400000028, 500000035, 600000042, 700000049, 800000056, 900000063, 1000000070, 1100000077, 1200000084, 1300000091, 1400000098]", "output": "0", "testtype": "functional", "fn_name": "specialPerm"}, {"input": "[296573006, 843224034, 611728152, 710630427, 167640710, 512370634, ... | 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\nThe imbalance number of a 0-indexed integer array arr of length n is defined as the number of indices in sarr... | [{"input": "[575, 133, 801, 468, 597, 189, 893, 650, 556, 584, 179, 524, 752, 229, 716, 579, 980, 827, 341, 370, 979, 257, 148, 346, 127, 51, 112, 40, 275, 104, 440, 790, 274, 264, 218, 362, 544, 579, 171, 387, 163, 1000, 993, 730, 446, 583, 760, 607, 817, 997, 445, 284, 625, 748, 349, 349, 275, 11, 85, 359, 333, 142, ... | 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 x, y, and z.\nYou have x strings equal to \"AA\", y strings equal to \"BB\", and... | [{"input": "28\n13\n29", "output": "112", "testtype": "functional", "fn_name": "longestString"}, {"input": "44\n27\n37", "output": "184", "testtype": "functional", "fn_name": "longestString"}, {"input": "42\n28\n50", "output": "214", "testtype": "functional", "fn_name": "longestString"}, {"input": "28\n18\n23", "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 array words containing n strings.\nLet's define a join operation join(x, y) between... | [{"input": "[\"yyznglvzzyhbehqpytffojbbarvxtvjuygvfwehmi\", \"jqrdwnzgtvggomfvsigrgunavsngfpwjsevtqse\", \"otjjyeextfllessdrawkkyllfgmvdnmkqocykdaauyj\", \"rzijufjzhgatrijprgfdxvnu\", \"lmpkneovejvzxnzignbrhotwtufiwyzvuhcipxvkyboscicqqu\", \"ppeefddwcsowhdeqcstz\", \"ypwrlkcjifldeegmczpulszdyjyjtdiupaucxb\", \"lbeviaed... | 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 n integers and an integer target.\nYou are initially positioned at in... | [{"input": "[793330182, 53994484, -589086686, 49900102, -622211916, -848373077, 206180191, -763964111, 742168284, 138744790, 654162207, 775982955, -756759069, 283053043, 52161863, -205739485, -957722229, 977337154, 453797626, -152364987, 19117313, 429756928, 664163222, -690359961, -652886830, 294693704, -837185781, 571... | 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.\nWe call a subarray of an array complete if the ... | [{"input": "[2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 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\nA truck has two fuel tanks. You are given two integers, mainTank representing the fuel present in the main ta... | [{"input": "100\n100", "output": "1240", "testtype": "functional", "fn_name": "distanceTraveled"}, {"input": "100\n55", "output": "1240", "testtype": "functional", "fn_name": "distanceTraveled"}, {"input": "100\n60", "output": "1240", "testtype": "functional", "fn_name": "distanceTraveled"}, {"input": "99\n2", "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 and an integer threshold.\nFind the length of the longest subarr... | [{"input": "[98, 25, 67, 11, 48, 3, 60, 22, 43, 40, 48, 64, 82, 84, 56, 97, 23, 43, 14, 91, 55, 70, 64, 22, 44, 33, 42, 35, 13, 55, 51, 52, 74, 89, 12, 37, 97, 95, 93, 77, 17, 59, 13, 63, 26, 26, 14, 23, 30, 31, 58, 22, 100, 11, 82, 10, 95, 60, 65, 40, 85, 90, 47, 21, 81, 14, 94, 13, 89, 82, 4, 87, 6, 84, 30, 78, 88, 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 a binary array nums.\nA subarray of an array is good if it contains exactly one element with th... | [{"input": "[0, 1, 0, 0, 1]", "output": "3", "testtype": "functional", "fn_name": "numberOfGoodSubarraySplits"}, {"input": "[0, 1, 0, 0, 1]", "output": "3", "testtype": "functional", "fn_name": "numberOfGoodSubarraySplits"}, {"input": "[1, 1, 0, 1, 1]", "output": "2", "testtype": "functional", "fn_name": "numberOfGoodS... | 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 subarray of nums is called continuous if:\n\nLet i, i + 1, ..... | [{"input": "[3, 1, 8, 2, 7, 8, 9, 3, 10, 10, 9, 8, 2, 6, 3, 8, 7, 5, 5, 7, 2, 5, 9, 8, 3, 6, 2, 2, 1, 8, 10, 3, 3, 8, 9, 5, 5, 5, 5, 6, 10, 1, 8, 8, 9, 4, 5, 2, 7, 4, 8, 9, 6, 5, 8, 1, 9, 5, 6, 8, 5, 7, 4, 3, 1, 10, 10, 6, 6, 8, 3, 8, 6, 5, 2, 4, 6, 8, 4, 2, 8, 4, 10, 3, 9, 8, 5, 7, 5, 5, 7, 2, 10, 4, 5, 8, 9, 10, 6, 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 two 0-indexed integer arrays nums1 and nums2 of length n.\nLet's define another 0-indexed integ... | [{"input": "[4, 2, 7, 8, 6, 1, 8, 7, 6, 2]\n[4, 2, 1, 10, 2, 4, 2, 9, 4, 3]", "output": "4", "testtype": "functional", "fn_name": "maxNonDecreasingLength"}, {"input": "[43, 42, 75, 60, 58, 16]\n[91, 96, 98, 35, 17, 10]", "output": "3", "testtype": "functional", "fn_name": "maxNonDecreasingLength"}, {"input": "[27848682... | 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 subarray s of length m is called alternating if:\n\nm is grea... | [{"input": "[8178, 8178, 8178, 8179, 8178, 8179, 8178, 8178, 8179, 8179, 8179, 8178, 8179, 8178, 8179, 8179, 8178, 8178, 8178, 8179, 8179, 8178, 8179, 8178, 8178, 8179, 8179, 8179, 8178, 8178, 8179, 8179, 8179, 8179, 8178, 8179, 8179, 8178, 8178, 8179, 8179, 8178, 8179, 8178, 8179, 8178, 8178, 8178, 8179, 8179, 8179, 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 array nums consisting of positive integers.\nYou can do the following operation on ... | [{"input": "[95, 32, 74, 75]", "output": "276", "testtype": "functional", "fn_name": "maxArrayValue"}, {"input": "[67, 72, 9, 58]", "output": "139", "testtype": "functional", "fn_name": "maxArrayValue"}, {"input": "[2, 3, 7, 9, 3]", "output": "21", "testtype": "functional", "fn_name": "maxArrayValue"}, {"input": "[82, ... | 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. We say that two integers x and y form a prime number pair if:\n\n1 <= x <= y <= n... | [{"input": "61528", "output": "[[17, 61511], [41, 61487], [59, 61469], [149, 61379], [197, 61331], [317, 61211], [359, 61169], [521, 61007], [641, 60887], [659, 60869], [809, 60719], [839, 60689], [881, 60647], [911, 60617], [1019, 60509], [1031, 60497], [1277, 60251], [1319, 60209], [1361, 60167], [1367, 60161], [1427... | 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 employees in a company, numbered from 0 to n - 1. Each employee i has worked for hours[i] hours i... | [{"input": "[100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 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\nGiven three strings a, b, and c, your task is to find a string that has the minimum length and contains all t... | [{"input": "\"raejtnpndbrnfkvhwtpuuyvcimdjqkqbsjryknxgsvbrxzvdjyrvlbjmaqpjftwbakdcvgevlzykeztlfzddexzhsouxybbbkoua\"\n\"wqfebyibylvqhwmksjovneujfievgcbsfcsqdiwgbcwagfispvzkciclkijfguwjoxudodbyesanvzipjerdimtwhmtmfzkrshir\"\n\"lohdppbqkqdgaygemcaspusswrgyuiszpjmcjhozpcmfxfzggfrfkyprjwfsjbumiggqnejxvevumlydqassfjhgmjgoce... | 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": "[263, 593, 185, 455, 804, 616, 593, 225, 601, 588]\n2", "output": "false", "testtype": "functional", "fn_name": "checkArray"}, {"input": "[275, 359, 358, 791, 94, 57, 502, 669, 189, 506]\n10", "output": "false", "testtype": "functional", "fn_name": "checkArray"}, {"input": "[62, 84, 65, 82, 25, 59, 65, 13, ... | 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 string s and an integer k, partition s into k substrings such that the sum of the number of letter ch... | [{"input": "\"abababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababab\"\n100", "output": "100", "testtype": "functional", "fn_name": "minimumChanges"}, {"input": "\"pjionzgeew... | 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 strings words and a character separator, split each string in words by separator.\nReturn a... | [{"input": "[\"gvgamxranzwfjoxt\", \"tzymftcwwkcg\", \"jctqdxogzslyx\", \"clgranstnenvsckbfh\", \"yzmnymytyujdinorohn,ynkscjhpypxaohwtlorq,wadmazvicpeinehrgr\", \"diblxfnfkzrwnvmr\", \"wlsgffpy\", \"ukggjareepkjlp\", \"ibg\", \"ybdsj\", \"vkzkjvnrjulcyn\", \"igmfpujjeqni\", \"emxqvcaw\", \"adjapsiugvtwo\", \"qyidizrlpz... | 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 two positive integers n and x.\nReturn the number of ways n can be expressed as the sum of the x^th pow... | [{"input": "185\n1", "output": "193582642", "testtype": "functional", "fn_name": "numberOfWays"}, {"input": "345\n1", "output": "862028426", "testtype": "functional", "fn_name": "numberOfWays"}, {"input": "28\n1", "output": "222", "testtype": "functional", "fn_name": "numberOfWays"}, {"input": "10\n2", "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\nGiven a binary string s, partition the string into one or more substrings such that each substring is beautif... | [{"input": "\"110001010100100\"", "output": "-1", "testtype": "functional", "fn_name": "minimumBeautifulSubstrings"}, {"input": "\"0110110111\"", "output": "-1", "testtype": "functional", "fn_name": "minimumBeautifulSubstrings"}, {"input": "\"1111111111\"", "output": "10", "testtype": "functional", "fn_name": "minimumB... | 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 array of strings forbidden.\nA string is called valid if none of its subst... | [{"input": "\"ymlqaillegxchmqnajgcaosqdwvrqwvriflwlphmwjpvdwlhrqdlkstumkpjrouekkkoqopjcsufksgwwfvtghsplihpzyzxejmjheztbbtsyotdaeycklspmtzqhbzntuhtphpaehdabwibjctfqmnjdtkhyrslqypgwkezcrrraboeadnjsusdhoguduoartihtycadyaxbxwfskqwimywgzvmukevmjnidpjiohbazhzhxosegiipuysofgylieuofgvucpghnafoyyopzndosbaytqezfczkuekdespjaixkes... | 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\nYour laptop keyboard is faulty, and whenever you type a character 'i' on it, it reverses the string that you ... | [{"input": "\"iiacyhffiicnxwuvilvlaipirxnruzqcocixlwhiupatairinlkdswifdwpacifiacwihieywjoikiaegpsiiiiizgbqfivpmpimiviiybhguzxqbwhcgdoq\"", "output": "\"mfqbgzkhfwsdklnatapucocqzurnxralvlacyhffcnxwuvpxlwhrfdwpacacweywjoaegpsvpmpvybhguzxqbwhcgdoq\"", "testtype": "functional", "fn_name": "finalString"}, {"input": "\"aaaaa... | 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 string s, permute s to get a new string t such that:\n\nAll consonants remain in their orig... | [{"input": "\"uUlresVFbHbJwQjLXREaKjwlNIamaQfzfUPdlEPgGggatVeDADCgNyMLcqExIbubYJrvFZTicJWpEwWUMFArIUBIUIaMnIsStCaVNMwPROfrLiMeTaXPJGDnKzKkUuixgkCoKcjAJDSSEQayIpJLLzcCkaEdYIdeSSRGkjlAXcXuyeaHdORPBxonIFAydhMFMBmKkqbstVrZkWGQBvMCQparFCdcsSYOGsRYRSTAGyHsYDDTQFXezRDwaLTfABNFBvmlUxLJZKBdvSgymmofpiHFOLXlBUxFbzhlvjHqGMKmBtiKMj... | 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 element x of an integer array arr of length m is dominant if freq(x) * 2 > m, where freq(x) is the number ... | [{"input": "[386065914, 804335372, 386065914, 386065914, 804335372, 804335372, 804335372]", "output": "-1", "testtype": "functional", "fn_name": "minimumIndex"}, {"input": "[412663226, 412663226, 657461098, 412663226, 412663226, 412663226]", "output": "0", "testtype": "functional", "fn_name": "minimumIndex"}, {"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 and a non-negative integer k.\nIn one operation, you can do the followin... | [{"input": "[10, 0, 10, 0, 10, 0, 10, 0, 10, 0]\n10", "output": "10", "testtype": "functional", "fn_name": "maximumBeauty"}, {"input": "[5, 3, 5, 9, 1, 3, 5, 8, 9, 10]\n3375", "output": "10", "testtype": "functional", "fn_name": "maximumBeauty"}, {"input": "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n0", "output": "1", "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 an integer array nums. We consider an array good if it is a permutation of an array base[n].\nb... | [{"input": "[95, 53, 23, 8, 119, 1, 148, 179, 70, 185, 132, 161, 87, 80, 99, 60, 10, 115, 124, 73, 79, 71, 89, 58, 77, 111, 50, 167, 141, 189, 74, 82, 40, 22, 68, 13, 190, 30, 52, 45, 103, 177, 25, 158, 153, 15, 186, 3, 118, 105, 32, 91, 137, 108, 90, 112, 168, 156, 46, 191, 93, 139, 195, 135, 28, 155, 131, 17, 67, 169... | 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 x.\nYou are initially at position 0 in th... | [{"input": "[857353, 96331, 386391, 816108, 827248, 428468, 326035, 710726, 505362, 133522, 267602, 475509, 47092, 392831, 983512, 944163, 904138, 389574, 197368, 548854, 759879, 922519, 598297, 190737, 659402, 872800, 151323, 202933, 636470, 330438, 202733, 125334, 854430, 504788, 943883, 362899, 942526, 497646, 22497... | 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. You have to find the maximum sum of a pair of numbers from nums... | [{"input": "[10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000,... | 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, an integer modulo, and an integer k.\nYour task is to find the ... | [{"input": "[2, 3, 6, 2, 3, 5, 10, 2, 8, 9, 9, 8, 1, 10, 9, 10, 8, 10, 5, 8, 7, 1, 7, 1, 3, 10, 1, 2, 1, 5, 3, 4, 10, 9, 6, 4, 2, 8, 8, 5, 9, 7, 8, 4, 5, 9, 5, 2, 9, 9, 3, 7, 5, 10, 10, 6, 2, 8, 9, 1, 9, 2, 3, 9, 7, 3, 2, 5, 9, 2, 5, 4, 4, 8, 3, 2, 8, 6, 8, 5, 5, 5, 1, 2, 6, 9, 8, 5, 2, 8, 5, 6, 5, 4, 9, 10, 2, 6, 3, 5... | 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 an integer m. You need to determine if it is possible to split th... | [{"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, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 10... | 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 integer array nums of length n and an integer target, return the number of pairs (i, j) whe... | [{"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]\n-100", "output": "0", "testtype": "functional", "fn_name... | 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 usageLimits of length n.\nYour task is to create groups using numbers from 0 ... | [{"input": "[2, 9, 1, 9, 3]", "output": "5", "testtype": "functional", "fn_name": "maxIncreasingGroups"}, {"input": "[9, 10, 9]", "output": "3", "testtype": "functional", "fn_name": "maxIncreasingGroups"}, {"input": "[1, 2, 5]", "output": "3", "testtype": "functional", "fn_name": "maxIncreasingGroups"}, {"input": "[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 a 0-indexed array nums containing n integers.\nAt each second, you perform the following operat... | [{"input": "[897, 231, 228, 879, 851, 153, 175, 90, 23, 46, 112, 662, 603, 530, 954, 536, 320, 328, 359, 507, 622, 86, 845, 803, 983, 135, 488, 21, 123, 137, 55, 159, 208, 105, 763, 669, 945, 178, 358, 398, 583, 779, 76, 456, 767, 820, 777, 130, 116, 201, 107, 313, 850, 498, 535, 406, 863, 580, 972, 219, 628, 979, 220,... | 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 two positive integers low and high represented as strings, find the count of stepping numbers in the in... | [{"input": "\"1203109284118568358408114942744154309516373371543388344493782743693904745519867118487579839270928580\"\n\"6121833782106632749517843393634569515258465712511663330500608285264190592002792370635436513179865625\"", "output": "729890404", "testtype": "functional", "fn_name": "countSteppingNumbers"}, {"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 two 0-indexed integer arrays nums1 and nums2 of equal length. Every second, for all indices 0 <... | [{"input": "[782, 330, 947, 340, 668, 243, 812, 450, 766, 653, 691, 576, 903, 979, 900, 978, 984, 240, 164, 166, 39, 468, 971, 159, 852, 531, 801, 803, 783, 86, 29, 287, 105, 217, 71, 155, 844, 132, 95, 133, 766, 186, 833, 177, 259, 870, 816, 719, 475, 855, 374, 939, 978, 895, 994, 314, 221, 278, 633, 756, 253, 349, 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 a 2D integer array coordinates and an integer k, where coordinates[i] = [x_i, y_i] are the coor... | [{"input": "[[93, 19], [54, 75], [75, 10], [26, 67], [64, 19], [35, 74], [76, 99], [51, 62], [70, 77], [26, 24], [38, 95], [94, 37], [87, 28], [92, 61], [62, 33], [73, 40], [57, 5], [81, 49], [37, 38], [45, 85], [60, 49], [97, 18], [9, 49], [30, 33], [74, 14], [98, 85], [18, 85], [65, 61], [35, 88], [95, 44], [65, 11],... | 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 two positive integers m and k.\nReturn the maximum sum out of all alm... | [{"input": "[2, 3, 5, 2, 1, 2, 5, 7, 3, 7]\n4\n10", "output": "37", "testtype": "functional", "fn_name": "maxSum"}, {"input": "[8, 3, 9, 4, 6, 5, 3, 9, 8, 5]\n1\n10", "output": "60", "testtype": "functional", "fn_name": "maxSum"}, {"input": "[8, 3, 9, 4, 6, 5, 3, 9, 8, 5]\n1\n2", "output": "17", "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\nInitially, you have a bank account balance of 100 dollars.\nYou are given an integer purchaseAmount represent... | [{"input": "15", "output": "80", "testtype": "functional", "fn_name": "accountBalanceAfterPurchase"}, {"input": "1", "output": "100", "testtype": "functional", "fn_name": "accountBalanceAfterPurchase"}, {"input": "4", "output": "100", "testtype": "functional", "fn_name": "accountBalanceAfterPurchase"}, {"input": "30", ... | 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 strings words and a string s, determine if s is an acronym of words.\nThe string s is consi... | [{"input": "[\"pamsj\", \"gbewekudq\", \"gvlqgv\", \"pmdcth\", \"sdxndwvu\", \"tqdpqo\", \"dwdqp\", \"nvboj\", \"gjxwwzbx\", \"hvtydem\", \"ubamf\", \"ursumenl\", \"lesvluxkmo\", \"sqjwnqvdq\", \"rmzcyazrph\", \"ppftmgy\", \"wtmsrlsr\", \"njcvk\", \"ujmuipakzv\", \"pozuojhtx\", \"ctfvlb\", \"cpmxlbdkax\", \"dwquuh\", \... | 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 representing the number of houses on a number line, numbered from 0 to n - 1.\nAdd... | [{"input": "1000\n[[354, 643, 137], [455, 903, 782], [931, 971, 659], [451, 620, 148], [633, 876, 127]]", "output": "1441", "testtype": "functional", "fn_name": "maximizeTheProfit"}, {"input": "1000\n[[759, 918, 4], [727, 894, 9], [275, 580, 9], [205, 978, 7], [997, 998, 1]]", "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 two positive integers low and high.\nAn integer x consisting of 2 * n digits is symmetric if th... | [{"input": "1000\n10000", "output": "615", "testtype": "functional", "fn_name": "countSymmetricIntegers"}, {"input": "3351\n5284", "output": "149", "testtype": "functional", "fn_name": "countSymmetricIntegers"}, {"input": "4854\n6605", "output": "137", "testtype": "functional", "fn_name": "countSymmetricIntegers"}, {"i... | 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 strings s1 and s2, both of length 4, consisting of lowercase English letters.\nYou can appl... | [{"input": "\"abcd\"\n\"dacb\"", "output": "false", "testtype": "functional", "fn_name": "canBeEqual"}, {"input": "\"abcd\"\n\"dacb\"", "output": "false", "testtype": "functional", "fn_name": "canBeEqual"}, {"input": "\"abcd\"\n\"cdab\"", "output": "true", "testtype": "functional", "fn_name": "canBeEqual"}, {"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 integer array nums and an integer x.\nFind the minimum absolute difference between ... | [{"input": "[10, 5, 7, 9, 6, 4, 6, 1, 7, 6, 7, 6, 7, 2, 10, 9, 2, 9, 7, 10, 6, 6, 2, 4, 3, 4, 9, 3, 4, 7, 7, 3, 7, 10, 10, 3, 1, 3, 9, 10, 10, 6, 10, 6, 6, 7, 1, 10, 1, 3, 5, 3, 7, 1, 6, 5, 8, 2, 5, 4, 8, 8, 7, 4, 6, 7, 2, 7, 9, 1, 2, 10, 2, 2, 2, 2, 8, 1, 8, 8, 8, 2, 1, 5, 3, 10, 10, 7, 5, 6, 3, 9, 2, 4, 7, 8, 9, 4, 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 positive integers low, high, and k.\nA number is beautiful if it meets both of the following co... | [{"input": "33340762\n612987024\n1", "output": "18196584", "testtype": "functional", "fn_name": "numberOfBeautifulIntegers"}, {"input": "36954768\n642296821\n14", "output": "1240042", "testtype": "functional", "fn_name": "numberOfBeautifulIntegers"}, {"input": "17946863\n807558969\n17", "output": "1319380", "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 0-indexed strings str1 and str2.\nIn an operation, you select a set of indices in str1, and... | [{"input": "\"peqhhdcxlt\"\n\"oy\"", "output": "false", "testtype": "functional", "fn_name": "canMakeSubsequence"}, {"input": "\"cztk\"\n\"ve\"", "output": "false", "testtype": "functional", "fn_name": "canMakeSubsequence"}, {"input": "\"ltlp\"\n\"mm\"", "output": "true", "testtype": "functional", "fn_name": "canMakeSu... | 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 moves of length n consisting only of characters 'L', 'R', and '_'. The string represen... | [{"input": "\"________________________L________________________R\"", "output": "48", "testtype": "functional", "fn_name": "furthestDistanceFromOrigin"}, {"input": "\"_RLLRR_____LRRL_LRRRRL_RR__L_L_RLLRLRRRRL_RR_R_RR_\"", "output": "26", "testtype": "functional", "fn_name": "furthestDistanceFromOrigin"}, {"input": "\"RR... | 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 strings s and t of equal length n. You can perform the following operation on the string s:... | [{"input": "\"ababab\"\n\"ababab\"\n1", "output": "2", "testtype": "functional", "fn_name": "numberOfWays"}, {"input": "\"jq\"\n\"hp\"\n100000", "output": "0", "testtype": "functional", "fn_name": "numberOfWays"}, {"input": "\"abcd\"\n\"cdab\"\n2", "output": "2", "testtype": "functional", "fn_name": "numberOfWays"}, {"... | 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 non-negative powers of 2, and an integer target.\nIn one o... | [{"input": "[1048576, 2097152, 8388608, 4096, 8192, 8192, 33554432, 524288, 2, 64, 4, 64, 33554432, 32, 131072, 16384, 8, 134217728, 2, 16, 32, 268435456, 131072, 1, 524288, 512, 2097152, 262144, 1, 33554432, 256, 512, 16777216, 8, 4096, 2097152, 67108864, 1073741824, 131072, 8192, 4096, 64, 64, 268435456, 32, 1024, 32... | 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 2D integer matrix grid of size n * m, we define a 0-indexed 2D matrix p of size n * m as th... | [{"input": "[[143, 414, 160, 22, 584, 149, 412, 890, 451, 740, 31, 975, 861, 62, 58, 258, 316, 931, 689, 225, 247, 959, 314, 881, 669, 623, 568, 367, 309, 241, 588, 389, 327, 773, 855, 86, 88, 445, 170, 181, 384, 427, 731, 866, 958, 459, 565, 500, 199, 99, 234, 648, 433, 58, 938, 396, 269, 429, 184, 419, 925, 930, 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 integer array receiver of length n and an integer k.\nThere are n players having a ... | [{"input": "[7, 9, 7, 5, 3, 5, 2, 7, 9, 4]\n100000000", "output": "700000007", "testtype": "functional", "fn_name": "getMaxFunctionValue"}, {"input": "[2, 9, 3, 0, 4, 9, 4, 8, 4, 6]\n10000000", "output": "40000012", "testtype": "functional", "fn_name": "getMaxFunctionValue"}, {"input": "[8, 1, 9, 2, 0, 4, 4, 9, 1, 5]\n... | 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 binary strings s1 and s2, both of length n, and a positive integer x.\nYou can pe... | [{"input": "\"110100110111011111101000000111111000110010000110101001000110000001000010111001001110111011011101000101000110011001100110011101100011100111000100000001010110101011001000111011100011101110000100000101011100101000001011011111000010101010100110010110101111010100110001100111000011110110110100010000100110110000... | 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 array nums representing the coordinates of the cars parking on a number ... | [{"input": "[[39, 40], [16, 83], [74, 95], [55, 65], [49, 100], [59, 98], [64, 98], [63, 93], [66, 74], [37, 47], [85, 100], [100, 100], [13, 80], [31, 61], [40, 75], [48, 52], [74, 85], [98, 100], [16, 47], [8, 30], [97, 99], [21, 34], [59, 71], [85, 94], [51, 100], [47, 55], [39, 86], [39, 80], [50, 54], [35, 98], [5... | 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 positive integers and an integer k.\nIn one operation, you can remove the last... | [{"input": "[42, 28, 38, 34, 1, 35, 33, 38, 44, 32, 50, 28, 39, 43, 44, 31, 12, 3, 28, 5, 4, 15, 22, 32, 29, 34, 12, 31, 44, 37, 30, 24, 3, 14, 42, 15, 19, 21, 45, 33, 4, 41, 42, 3, 28, 25, 32, 39, 19, 11]\n1", "output": "46", "testtype": "functional", "fn_name": "minOperations"}, {"input": "[1, 2, 3, 4, 5, 6, 7, 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 nums of length n containing distinct positive integers. Return the minimum nu... | [{"input": "[97, 98, 99, 100, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,... | 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 num representing a non-negative integer.\nIn one operation, you can pick any... | [{"input": "\"7554470590556903051297132517035375502367663656796945212537429745343064380943553878266550484832142198\"", "output": "12", "testtype": "functional", "fn_name": "minimumOperations"}, {"input": "\"7875873129614258312273585770775876042480886223998504595302026701597763173145121202796783246955435513\"", "output"... | code_functional |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.