FPEvalDataset/LeetCodeProblem
0304
1{2 "id": 3186,3 "name": "minimum_sum_of_mountain_triplets_ii",4 "difficulty": "Medium",5 "link": "https://leetcode.com/problems/minimum-sum-of-mountain-triplets-ii/",6 "date": "2023-10-15 00:00:00",7 "task_description": "You are given a **0-indexed** array `nums` of integers. A triplet of indices `(i, j, k)` is a **mountain** if: `i < j < k` `nums[i] < nums[j]` and `nums[k] < nums[j]` Return _the **minimum possible sum** of a mountain triplet of_ `nums`. _If no such triplet exists, return_ `-1`. **Example 1:** ``` **Input:** nums = [8,6,1,5,3] **Output:** 9 **Explanation:** Triplet (2, 3, 4) is a mountain triplet of sum 9 since: - 2 < 3 < 4 - nums[2] < nums[3] and nums[4] < nums[3] And the sum of this triplet is nums[2] + nums[3] + nums[4] = 9. It can be shown that there are no mountain triplets with a sum of less than 9. ``` **Example 2:** ``` **Input:** nums = [5,4,8,7,10,2] **Output:** 13 **Explanation:** Triplet (1, 3, 5) is a mountain triplet of sum 13 since: - 1 < 3 < 5 - nums[1] < nums[3] and nums[5] < nums[3] And the sum of this triplet is nums[1] + nums[3] + nums[5] = 13. It can be shown that there are no mountain triplets with a sum of less than 13. ``` **Example 3:** ``` **Input:** nums = [6,5,4,3,4,5] **Output:** -1 **Explanation:** It can be shown that there are no mountain triplets in nums. ``` **Constraints:** `3 <= nums.length <= 105` `1 <= nums[i] <= 108`",8 "public_test_cases": [9 {10 "label": "Example 1",11 "input": "nums = [8,6,1,5,3]",12 "output": "9 "13 },14 {15 "label": "Example 2",16 "input": "nums = [5,4,8,7,10,2]",17 "output": "13 "18 },19 {20 "label": "Example 3",21 "input": "nums = [6,5,4,3,4,5]",22 "output": "-1 "23 }24 ],25 "private_test_cases": [26 {27 "input": [28 81858512,29 35815503,30 83188481,31 58012802,32 94927155,33 41881567,34 18962787,35 67599290,36 38994949,37 81114997,38 90604909,39 69745552,40 66223084,41 10430604,42 56336968,43 55016274,44 88514622,45 639493,46 25303596,47 4601886,48 24179991,49 87119989,50 93214888,51 83150027,52 37155022,53 83530666,54 39037007,55 1736670,56 12669932,57 69983116,58 23578017,59 65885796,60 60122465,61 27592004,62 88357521,63 43295163,64 19026294,65 73905838,66 22162464,67 31047372,68 85599430,69 15787880,70 28787495,71 54985171,72 27566102,73 7749255,74 89241825,75 3510788,76 85877280,77 29586958,78 6196534,79 36556301,80 34384437,81 28190611,82 79089568,83 34016006,84 18162685,85 24781931,86 16704886,87 30323454,88 69957240,89 25954020,90 38528886,91 86525602,92 96892173,93 60439039,94 52879530,95 75258588,96 75739641,97 71585451,98 64774135,99 15723678,100 21874627,101 55956238,102 22131543,103 30121129,104 69791276,105 6416736,106 43278321,107 76669420,108 35384360,109 60331819,110 80548784,111 63656068,112 79999739,113 73539064,114 38478312,115 12447887,116 39162324,117 98606078,118 65341074,119 58407244,120 71530894,121 29975951,122 75094124,123 84781273,124 64516344,125 20933860,126 70298875,127 34628818,128 62318536,129 46692242,130 69826084,131 39126078,132 24572819,133 86338991,134 99661032,135 22926920,136 587838,137 55424874,138 11595153,139 2235927,140 94768098,141 27311785,142 68499472,143 12661385,144 37433865,145 16149302,146 30191755,147 20405907,148 86582510,149 87607398,150 23899015,151 52647427,152 61929688,153 28543664,154 45011715,155 67820627,156 92610643,157 85284098,158 35720797,159 45757883,160 87128766,161 71665218,162 77006185,163 16983217,164 34497453,165 57478277,166 45932129,167 67772836,168 83521662,169 55190221,170 41206814,171 51023805,172 46366345,173 86941491,174 70534083,175 33632134,176 81688369,177 48944152,178 39479180,179 41338858,180 86517050,181 52719712,182 16459138,183 49050729,184 18772836,185 18108489,186 43353123,187 35078080,188 96575497,189 66379070,190 72336169,191 93231876,192 3940555,193 89541099,194 67529288,195 2758163,196 25825953,197 54707038,198 47083812,199 9417199,200 83058782,201 44821864,202 15773292,203 88401209,204 58923884,205 55983502,206 94793541,207 81817410,208 24681956,209 26667463,210 98740374,211 7419,212 12850958,213 978623,214 58152171,215 14454951,216 7859811,217 73343337,218 25109687,219 53769563,220 52631908,221 28804801,222 88244922,223 60122461,224 3452588,225 47829365,226 83162934,227 99685013,228 25598164,229 9808616,230 3244388,231 51226333,232 10821412,233 25803161,234 93117996,235 90487851,236 6433298,237 70750269,238 35596180,239 76624797,240 30818166,241 50296534,242 62599426,243 69474502,244 53459255,245 85437216,246 98683842,247 84971023,248 79520940,249 13604310,250 27453033,251 64474767,252 52107092,253 50597438,254 98800617,255 84047919,256 98013997,257 14385086,258 35179023,259 61938407,260 97414114,261 4952847,262 9706395,263 14084426,264 18060814,265 18483298,266 48673043,267 24795865,268 80097308,269 99184520,270 49374748,271 30283370,272 92691412,273 46255591,274 73253805,275 73982441,276 89043025,277 80974632,278 5419468,279 49745152,280 3341465,281 26503439,282 16957503,283 18095308,284 26511358,285 76333410,286 27444443,287 21853552,288 90461779,289 2189771,290 96812724,291 18574457,292 60398720,293 29317734,294 81216485,295 19386462,296 27681585,297 77478547,298 72387026,299 89197861,300 84865132,301 86736745,302 95245875,303 35230812,304 88890747,305 31565638,306 91847872,307 87720751,308 7290889,309 56381282,310 93841481,311 66665244,312 6142349,313 85052719,314 8459293,315 78748585,316 83272365,317 41707738,318 43567920,319 63734607,320 23168352,321 85067671,322 42436525,323 45869470,324 27337394,325 16897061,326 17304350,327 506679,328 960409,329 67604928,330 92201077,331 10493114,332 41031984,333 86434546,334 14788619,335 56557377,336 80728173,337 29169676,338 99391843,339 13463329,340 61791690,341 66735029,342 36160752,343 24150625,344 75472999,345 34895864,346 78599364,347 25473043,348 26231557,349 96050091,350 36696319,351 13116683,352 68428632,353 43376870,354 77906392,355 37519559,356 99373631,357 17146854,358 35105364,359 27115656,360 28908395,361 44903477,362 85315921,363 62353043,364 19994698,365 47238499,366 17372186,367 68564249,368 2692088,369 90938546,370 55316303,371 32483458,372 14597839,373 55848419,374 5308024,375 76214805,376 17478861,377 53512175,378 29669380,379 90061985,380 69546870,381 61948241,382 60592202,383 82282242,384 51581946,385 34267924,386 68131519,387 65036932,388 18202465,389 18224249,390 66764143,391 61092449,392 87884884,393 23234198,394 98071672,395 90236894,396 71465939,397 95498399,398 93002267,399 20297178,400 45148588,401 67133476,402 2363461,403 12954819,404 18662563,405 64726896,406 16366875,407 3963444,408 46140872,409 11579571,410 72350523,411 66916470,412 54277987,413 35051489,414 94248532,415 13104996,416 88003294,417 19042673,418 77469425,419 84990176,420 4977755,421 3631335,422 23151252,423 55234741,424 62837843,425 50366121,426 75896693,427 48194661,428 20510549,429 92604331,430 54685243,431 74657836,432 40472394,433 86623050,434 53345566,435 36476522,436 65621426,437 34661033,438 24826832,439 46303023,440 89437737,441 56726933,442 20403434,443 27930884,444 44458091,445 72422002,446 42091175,447 74055311,448 82625115,449 65934587,450 71028446,451 78864024,452 37990420,453 97868134,454 5773454,455 99468241,456 85361740,457 69500276,458 35291543,459 12157530,460 98058311,461 62080432,462 66564492,463 17689334,464 23088791,465 36513748,466 9284624,467 79239906,468 18020124,469 92294029,470 9441861,471 22673233,472 84145228,473 15315879,474 3148419,475 35239233,476 69826656,477 53217088,478 28604175,479 42170124,480 92435341,481 99589258,482 27892835,483 41483204,484 76637342,485 25387814,486 71676744,487 33317030,488 83521656,489 58541258,490 86906300,491 84890472,492 79940952,493 38458839,494 69912208,495 60728356,496 97751362,497 42640612,498 82030834,499 27403292,500 4019546,501 82926308,502 28217770,503 91757897,504 27375924,505 97985423,506 68172371,507 2676755,508 83730658,509 22768986,510 41283704,511 50797850,512 38728071,513 99284707,514 27228350,515 74381834,516 39121141,517 55364728,518 37948870,519 73062201,520 17360110,521 61938440,522 11642396,523 29544111,524 93648913,525 22763491,526 96768261,527 13265713,528 44906691,529 26777887,530 76128548,531 80952655,532 49309111,533 56738090,534 61806442,535 14413129,536 13640689,537 89314579,538 20447667,539 16633750,540 94867387,541 3296652,542 32289216,543 58617409,544 37766617,545 2227104,546 33988879,547 48305289,548 16968916,549 80598291,550 63018832,551 51117492,552 31949367,553 14479528,554 58330723,555 14759862,556 95058236,557 45567252,558 82656413,559 12965146,560 93607765,561 79266129,562 40359081,563 45212340,564 70569296,565 17293163,566 44214376,567 94418145,568 59335413,569 89016805,570 37869728,571 51712234,572 56092094,573 50260397,574 63603016,575 66080798,576 57546047,577 9981362,578 18128538,579 16984782,580 73493967,581 51324017,582 44539685,583 63763310,584 29133735,585 66925537,586 59160212,587 50986964,588 46816660,589 46544742,590 28532977,591 42527785,592 16813265,593 10719415,594 88890357,595 48588205,596 63343870,597 97143767,598 26168671,599 55195023,600 22799054,601 31905918,602 55247550,603 74455445,604 16421720,605 23064122,606 97254421,607 47359206,608 6955418,609 81182109,610 56950540,611 24553852,612 78526403,613 17846862,614 81087494,615 10800037,616 25406563,617 64128276,618 66888082,619 2115078,620 44651295,621 94680467,622 79662871,623 2920671,624 33727927,625 76353805,626 23499038,627 53243982,628 94382273,629 40825544,630 77112404,631 36735033,632 38727562,633 94267738,634 67815355,635 17279920,636 51385140,637 72094294,638 58574406,639 15817794,640 45017793,641 3543404,642 36388657,643 3738016,644 9956255,645 99528427,646 67213971,647 83651943,648 67210793,649 39453040,650 30218682,651 82279865,652 43336900,653 74503508,654 64451677,655 11145544,656 12452325,657 71013147,658 6797931,659 24858562,660 90363802,661 31988988,662 16537063,663 79673132,664 43287884,665 83149233,666 90952681,667 85764336,668 47201993,669 93212360,670 80761322,671 26140202,672 84276696,673 5965979,674 79215077,675 15288453,676 32619091,677 71994215,678 95480111,679 15773404,680 38444846,681 35402134,682 41747565,683 78701157,684 52965560,685 68790358,686 57966521,687 67396815,688 84051082,689 36000977,690 44110769,691 99400593,692 85406184,693 8654085,694 71901471,695 75365704,696 6383031,697 68445238,698 8915267,699 51998195,700 5440542,701 78486441,702 88539741,703 32882296,704 80137566,705 39764153,706 15146586,707 85812312,708 14616461,709 55491634,710 29352184,711 60832450,712 63821442,713 56905275,714 91469448,715 69666501,716 60972842,717 47856908,718 80569385,719 97350876,720 64797064,721 9622257,722 84794264,723 14784518,724 6706732,725 64872016,726 24339521,727 12646346,728 815003,729 88193770,730 4081625,731 48555303,732 63419785,733 83927088,734 16401834,735 60189058,736 43602099,737 71681581,738 50954604,739 47538703,740 72406231,741 99785590,742 81287931,743 5563717,744 7643856,745 30034374,746 53245007,747 48713820,748 98490278,749 2475301,750 58388600,751 68771397,752 15146926,753 37760101,754 71634955,755 27850451,756 33326290,757 61977127,758 93046823,759 33893648,760 79834085,761 67488532,762 31663915,763 52103850,764 81365223,765 75131630,766 3077383,767 20371483,768 44114738,769 95950197,770 75602859,771 93250243,772 42688052,773 60815888,774 63574478,775 26126042,776 43043684,777 83051810,778 1012308,779 39559244,780 12063644,781 19320126,782 57981879,783 42601075,784 94569442,785 48589147,786 21626083,787 86702543,788 72570676,789 14078868,790 300396,791 85671290,792 99058241,793 5164751,794 80696663,795 73603116,796 52436993,797 89251575,798 22309057,799 22587341,800 87194567,801 22546384,802 55908163,803 86240931,804 79754758,805 53173455,806 60302690,807 36193580,808 94619117,809 78674715,810 3555316,811 19315552,812 3606987,813 4533408,814 98759433,815 95711980,816 71912610,817 80605288,818 96167561,819 47459869,820 45565137,821 51047173,822 99984180,823 14403366,824 52987751,825 43124319,826 77403801,827 29104539,828 1602455,829 24751556,830 73042616,831 96512402,832 81571418,833 90300999,834 96489970,835 64833644,836 29455525,837 2988940,838 70698780,839 42806158,840 99767058,841 92579737,842 34874835,843 37452402,844 7281814,845 66789266,846 8504568,847 81305078,848 50214612,849 47863856,850 61611946,851 8393746,852 92114502,853 76101234,854 58895791,855 44707597,856 98402410,857 56357246,858 19977568,859 96831885,860 53877417,861 40485319,862 7456293,863 4166539,864 53502297,865 7826566,866 98245545,867 89905420,868 4256696,869 46809649,870 59261456,871 79178913,872 89474109,873 39778251,874 27905374,875 4590002,876 3285663,877 31678243,878 86548710,879 1503292,880 4177044,881 99005220,882 18814915,883 39361387,884 37482458,885 70241993,886 87342671,887 10787362,888 46241040,889 76615042,890 87459743,891 66047770,892 89681940,893 72760095,894 37085483,895 56286838,896 27273862,897 82032818,898 36869497,899 81590590,900 13118018,901 218444,902 22448986,903 98980105,904 43455776,905 25218696,906 63025661,907 33897559,908 70301622,909 76027810,910 58784173,911 16107375,912 16757937,913 9456942,914 14148925,915 66667380,916 88972887,917 22264719,918 80105533,919 82491811,920 24733740,921 4045536,922 28663580,923 3905613,924 86233902,925 80816701,926 4314890,927 67794216,928 31986058,929 61692799,930 70136079,931 3096976,932 25459424,933 7369532,934 62175752,935 22279138,936 10829596,937 77311391,938 31449512,939 78542931,940 22132902,941 12367912,942 97884910,943 26610114,944 47957935,945 29409274,946 15541034,947 37073075,948 95645800,949 35663599,950 22735578,951 4345719,952 94448712,953 33806790,954 96857305,955 19624935,956 98999972,957 29602787,958 29669089,959 99203854,960 73570331,961 87529870,962 39600116,963 69791005,964 2315710,965 41224831,966 23331818,967 1402558,968 71885779,969 75197483,970 96576370,971 69805078,972 70869797,973 36572407,974 16591228,975 31128969,976 92968416,977 3192317,978 14786132,979 92339303,980 63626095,981 97749764,982 50536174,983 46436064,984 80162687,985 38936169,986 95618813,987 31758575,988 95809152,989 34264394,990 71106104,991 99227516,992 10462232,993 1957620,994 41261503,995 36529723,996 53955080,997 18180561,998 83715551,999 76294995,1000 28349748,1001 58236757,1002 14223140,1003 6792146,1004 17109017,1005 6978177,1006 78954198,1007 28523211,1008 83137112,1009 46826846,1010 704473,1011 26245905,1012 14257945,1013 82476775,1014 22342511,1015 77630031,1016 39874272,1017 88380611,1018 96381580,1019 25945355,1020 56060791,1021 55679695,1022 71382847,1023 23098471,1024 49625217,1025 16798666,1026 30059928,1027 34865990,1028 18476299,1029 54613899,1030 63263883,1031 59847607,1032 78624402,1033 74701743,1034 21361269,1035 58051032,1036 58416612,1037 10257946,1038 18803121,1039 48851266,1040 72698876,1041 33729980,1042 15979003,1043 75667602,1044 36148469,1045 11553200,1046 20451352,1047 11278122,1048 96215574,1049 70837743,1050 47688146,1051 25196813,1052 63410265,1053 53069813,1054 94820679,1055 28384391,1056 34283640,1057 54790983,1058 89284651,1059 6263966,1060 99807564,1061 2808162,1062 95756466,1063 28766312,1064 86386628,1065 98147193,1066 29861948,1067 7131303,1068 87600807,1069 25747415,1070 30787153,1071 68904044,1072 59291764,1073 98297002,1074 48317087,1075 64845212,1076 10459419,1077 43175380,1078 53395907,1079 4740741,1080 45542745,1081 417498,1082 11329202,1083 84016435,1084 91144344,1085 31164450,1086 61113520,1087 17445812,1088 95123692,1089 58171535,1090 83802695,1091 57847363,1092 2658121,1093 80708472,1094 15458840,1095 70474370,1096 93870088,1097 49557854,1098 9462936,1099 26120402,1100 74988914,1101 98274603,1102 15587708,1103 8215608,1104 66229007,1105 75958532,1106 50101008,1107 52437295,1108 5785361,1109 88270402,1110 72106912,1111 95340619,1112 64656412,1113 93263572,1114 38883430,1115 63917893,1116 78909340,1117 41426112,1118 58365347,1119 22901830,1120 74084983,1121 47400711,1122 9825173,1123 81489722,1124 13975898,1125 74672375,1126 66675889,1127 92359481,1128 84427747,1129 54760411,1130 44144811,1131 8419176,1132 11295704,1133 6545469,1134 31033246,1135 2076653,1136 29900420,1137 33055962,1138 58417876,1139 11814824,1140 13515855,1141 65066722,1142 73030839,1143 18317331,1144 63900,1145 37044391,1146 68773417,1147 94147768,1148 40240525,1149 90867521,1150 32256645,1151 1550119,1152 11738387,1153 4451562,1154 42562076,1155 14715950,1156 32615788,1157 46567325,1158 50230484,1159 8428478,1160 26593827,1161 24767706,1162 61078258,1163 11925863,1164 37035185,1165 25212035,1166 41718087,1167 15176601,1168 63001175,1169 76663388,1170 9833506,1171 56234962,1172 54977050,1173 21371416,1174 5470614,1175 97613203,1176 49521963,1177 74391169,1178 65095845,1179 93268852,1180 17739439,1181 57597922,1182 33442417,1183 17095987,1184 6124839,1185 3717785,1186 46097102,1187 25913572,1188 31233414,1189 67875514,1190 46613976,1191 39137170,1192 81876232,1193 681550,1194 45129206,1195 23238229,1196 10690208,1197 44229870,1198 50465032,1199 5316239,1200 92339761,