question
stringlengths
58
4.29k
label
class label
3 classes
you give integer array num integer minK maxKA fixedbound subarray num subarray satisfie follow conditionsThe minimum value subarray equal minKThe maximum value subarray equal maxkreturn number fixedbound subarraysA subarray contiguous array Example 1input num 135275 mink 1 maxk 5output 2explanation the fixedbound subar...
0array
give integer array num integer k return number subarray num great common divisor subarray elements ka subarray contiguous nonempty sequence element arrayThe great common divisor array large integer evenly divide array element Example 1input num 931263 k 3output 4explanation the subarray num 3 great common divisor subar...
0array
you give 0indexe array num cost consist n positive integersyou follow operation number timesincrease decrease element array num 1the cost operation ith element costiReturn minimum total cost element array num equal Example 1input num 1352 cost 23114output 8explanation we element equal 2 follow way increase 0th element ...
0array
you give positive integer array nums target lengthIn operation choose distinct index j 0 j numslength andset numsi numsi 2 andset numsj numsj 2two array consider similar frequency element samereturn minimum number operation require num similar target the test case generate num similar target Example 1input num 8126 tar...
0array
you give array equallength string word assume length string nEach string wordsi convert difference integer array differencei length n 1 differenceij wordsij1 wordsij 0 j n 2 note difference letter difference position alphabet ie position 0 b 1 z 25For example stre acb difference integer array 2 0 1 2 2 1all string word...
2string
you give 0indexed array num consist positive integer represent target number line you give integ spaceyou machine destroy target seed machine numsi allow destroy target value represent numsi c space c nonnegative integer you want destroy maximum number target numsreturn minimum value numsi seed machine destroy maximum ...
0array
you give 0indexed array nonnegative integer num for integer num find respective second great integerthe second great integer numsi numsj thatj inumsj numsiThere exist exactly index k numsk numsi k jIf numsj second great integer consider 1for example array 1 2 4 3 second great integer 1 4 2 3 3 4 1return integer array a...
0array
give integer array num positive integer return average value integer divisible 3note average n element sum n element divide n round near integer Example 1input num 136101215output 9explanation 6 12 number divisible 3 6 12 2 9example 2input num 124710output 0explanation there single number satisfie requirement return 0 ...
0array
you give 0indexed array num size n consist nonnegative integersYou need apply n 1 operation array ith operation 0indexe apply follow ith element numsif numsi numsi 1 multiply numsi 2 set numsi 1 0 otherwise skip operationafter perform operation shift 0s end arrayfor example array 102001 shift 0s end 121000return result...
0array
you give integer array num integer k find maximum subarray sum subarray num meet follow conditionsThe length subarray k andall element subarray distinctreturn maximum subarray sum subarray meet condition if subarray meet condition return 0A subarray contiguous nonempty sequence element array Example 1input num 1542999 ...
0array
you give 0indexed integer array cost costsi cost hire ith workeryou give integer k candidate we want hire exactly k worker accord follow rulesyou run k session hire exactly worker sessionin hiring session choose worker low cost candidate worker candidate worker break tie smallest indexfor example cost 327712 candidate ...
0array
there robot factory Xaxis you give integer array robot roboti position ith robot you give 2D integer array factory factoryj positionj limitj indicate positionj position jth factory jth factory repair limitj robotsThe position robot unique the position factory unique Note robot position factory initiallyall robot initia...
0array