FPEvalDataset/LeetCodeProblem
0302
1{2 "id": 2636,3 "name": "maximum_subsequence_score",4 "difficulty": "Medium",5 "link": "https://leetcode.com/problems/maximum-subsequence-score/",6 "date": "2023-01-07 00:00:00",7 "task_description": "You are given two **0-indexed** integer arrays `nums1` and `nums2` of equal length `n` and a positive integer `k`. You must choose a **subsequence** of indices from `nums1` of length `k`. For chosen indices `i0`, `i1`, ..., `ik - 1`, your **score** is defined as: The sum of the selected elements from `nums1` multiplied with the **minimum** of the selected elements from `nums2`. It can defined simply as: `(nums1[i0] + nums1[i1] +...+ nums1[ik - 1]) * min(nums2[i0] , nums2[i1], ... ,nums2[ik - 1])`. Return _the **maximum** possible score._ A **subsequence** of indices of an array is a set that can be derived from the set `{0, 1, ..., n-1}` by deleting some or no elements. **Example 1:** ``` **Input:** nums1 = [1,3,3,2], nums2 = [2,1,3,4], k = 3 **Output:** 12 **Explanation:** The four possible subsequence scores are: - We choose the indices 0, 1, and 2 with score = (1+3+3) * min(2,1,3) = 7. - We choose the indices 0, 1, and 3 with score = (1+3+2) * min(2,1,4) = 6. - We choose the indices 0, 2, and 3 with score = (1+3+2) * min(2,3,4) = 12. - We choose the indices 1, 2, and 3 with score = (3+3+2) * min(1,3,4) = 8. Therefore, we return the max score, which is 12. ``` **Example 2:** ``` **Input:** nums1 = [4,2,3,1,1], nums2 = [7,5,10,9,6], k = 1 **Output:** 30 **Explanation:** Choosing index 2 is optimal: nums1[2] * nums2[2] = 3 * 10 = 30 is the maximum possible score. ``` **Constraints:** `n == nums1.length == nums2.length` `1 <= n <= 105` `0 <= nums1[i], nums2[j] <= 105` `1 <= k <= n`",8 "public_test_cases": [9 {10 "label": "Example 1",11 "input": "nums1 = [1,3,3,2], nums2 = [2,1,3,4], k = 3",12 "output": "12 "13 },14 {15 "label": "Example 2",16 "input": "nums1 = [4,2,3,1,1], nums2 = [7,5,10,9,6], k = 1",17 "output": "30 "18 }19 ],20 "private_test_cases": [21 {22 "input": [23 [24 5393025 ],26 [27 1565728 ],29 130 ],31 "output": 84438201032 },33 {34 "input": [35 [36 13123,37 96697,38 51489,39 92326,40 2701541 ],42 [43 57232,44 88564,45 15473,46 88738,47 698848 ],49 350 ],51 "output": 1156921987252 },53 {54 "input": [55 [56 33213,57 7718,58 84861,59 24857,60 84851,61 22278,62 28946,63 19681,64 85381,65 180566 ],67 [68 94611,69 43359,70 3274,71 30544,72 83548,73 17710,74 67160,75 86364,76 71297,77 6981578 ],79 580 ],81 "output": 1692915552082 },83 {84 "input": [85 [86 1286,87 42212,88 10548,89 14204,90 18448,91 5006,92 85038,93 93667,94 9966,95 78038,96 36255,97 22668,98 10011,99 2574,100 3766,101 31481,102 89182,103 71745,104 46157,105 81352,106 1092,107 68103,108 97522,109 57055,110 49778,111 52844,112 67239,113 40889,114 18997,115 40170,116 1172,117 86872,118 99447,119 75606,120 71710,121 29433,122 42731,123 61768,124 70447,125 47482,126 57855,127 92373,128 20152,129 6600,130 3862,131 42227,132 30483,133 50052,134 48629,135 54680,136 84081,137 69681,138 63286,139 141,140 6268,141 59779,142 78024,143 24406,144 76681,145 83077,146 42622,147 59568,148 17087,149 97426,150 72051,151 97315,152 79901,153 11321,154 18690,155 77536,156 3105,157 95840,158 97859,159 64191,160 88862,161 17535,162 74262,163 94119,164 9762,165 9950,166 30036,167 18819,168 9111,169 61600,170 19615,171 78257,172 61418,173 66221,174 68411,175 40665,176 42013,177 7676,178 91646,179 10699,180 4199,181 52191,182 84159,183 13108,184 63532,185 21023186 ],187 [188 40564,189 99192,190 10563,191 2843,192 9527,193 35283,194 62564,195 54240,196 32112,197 71826,198 4295,199 88641,200 84588,201 92690,202 73899,203 54990,204 17921,205 69168,206 79914,207 10997,208 75349,209 2988,210 16180,211 44152,212 22425,213 52423,214 72016,215 36833,216 86316,217 68374,218 43451,219 9752,220 83169,221 42997,222 77819,223 29219,224 49777,225 69323,226 9230,227 2774,228 94930,229 35869,230 7129,231 76201,232 73376,233 58959,234 92200,235 96623,236 40076,237 20610,238 43997,239 84913,240 12360,241 55465,242 59481,243 29357,244 23440,245 66044,246 33547,247 13939,248 99313,249 67748,250 1203,251 9661,252 2115,253 31103,254 33825,255 25916,256 37499,257 94378,258 50916,259 11318,260 90527,261 83363,262 7839,263 3783,264 10576,265 95537,266 41790,267 25235,268 52283,269 50115,270 66593,271 72081,272 51898,273 44933,274 36232,275 92804,276 26494,277 16276,278 58343,279 29083,280 4730,281 70532,282 78573,283 22457,284 96190,285 26561,286 72584,287 89964288 ],289 10290 ],291 "output": 63301589280292 },293 {294 "input": [295 [296 4268,297 72583,298 2332,299 90591,300 13994,301 76500,302 23695,303 59190,304 56411,305 5358,306 22539,307 12202,308 12059,309 60224,310 5129,311 4962,312 66069,313 52538,314 80161,315 31189,316 53810,317 78522,318 63401,319 31148,320 54445,321 79387,322 98405,323 95956,324 24420,325 4936,326 91679,327 62853,328 73571,329 50668,330 4259,331 69925,332 82974,333 47964,334 3919,335 98430,336 29328,337 23285,338 36582,339 45514,340 85445,341 25342,342 62245,343 57539,344 90627,345 12680,346 2042,347 64384,348 76874,349 50050,350 13979,351 66543,352 36310,353 28300,354 56097,355 60414,356 20901,357 79676,358 527,359 63740,360 72705,361 59576,362 41402,363 95925,364 68866,365 74914,366 96357,367 42304,368 89024,369 89835,370 58747,371 52707,372 7910,373 86597,374 61307,375 79716,376 6365,377 94373,378 76583,379 41242,380 31768,381 46439,382 35466,383 56546,384 94006,385 31732,386 44682,387 66069,388 33772,389 87159,390 81166,391 92878,392 89994,393 697,394 87677,395 61519,396 82119,397 1775,398 31680,399 25124,400 30483,401 63953,402 4336,403 25802,404 68352,405 19810,406 61850,407 27272,408 53007,409 238,410 42907,411 58263,412 74236,413 74102,414 46631,415 34612,416 79618,417 60078,418 91061,419 24067,420 60959,421 76488,422 79287,423 9178,424 19357,425 53081,426 77027,427 95587,428 6595,429 98572,430 10951,431 19181,432 40917,433 87676,434 1629,435 36091,436 98426,437 15650,438 50878,439 99071,440 2897,441 62910,442 69862,443 78666,444 44516,445 74439,446 96926,447 1072,448 51812,449 92735,450 50983,451 91678,452 20163,453 71770,454 8860,455 68661,456 66104,457 83515,458 22819,459 60279,460 62721,461 83914,462 21426,463 71809,464 68319,465 51009,466 17705,467 36485,468 60208,469 18488,470 23824,471 83132,472 93926,473 70733,474 92499,475 22509,476 99440,477 46830,478 37631,479 82830,480 66603,481 14113,482 13310,483 25664,484 80007,485 1337,486 33441,487 82696,488 62111,489 46475,490 25434,491 29780,492 10443,493 24496,494 34701,495 28491,496 21961,497 91078,498 78296,499 92571,500 54487,501 43772,502 92242,503 71723,504 24844,505 43734,506 7802,507 45962,508 77294,509 53115,510 73360,511 91730,512 70045,513 77852,514 97483,515 43677,516 44534,517 13725,518 44245,519 72058,520 396,521 43930,522 46843,523 56976,524 62641,525 43265,526 58871,527 8193,528 53549,529 62278,530 61953,531 37913,532 10015,533 34335,534 80226,535 20997,536 49555,537 31543,538 42391,539 31678,540 73369,541 13156,542 91923,543 15950,544 88424,545 12258,546 64228,547 92044,548 54016,549 73961,550 34445,551 59439,552 40143,553 80318,554 95050,555 64257,556 85762,557 26164,558 2666,559 96041,560 49754,561 19022,562 65131,563 26335,564 71330,565 76179,566 9602,567 55295,568 64196,569 29912,570 40083,571 44734,572 22456,573 52460,574 83523,575 87452,576 27276,577 27236,578 61534,579 50578,580 21126,581 88482,582 57590,583 55826,584 55685,585 55620,586 44044,587 3606,588 81866,589 6639,590 67475,591 80140,592 66047,593 66830,594 13743,595 55071,596 37195,597 39818,598 46402,599 8685,600 40080,601 16885,602 50919,603 93026,604 86216,605 1412,606 3988,607 61700,608 29877,609 62569,610 96518,611 64928,612 60248,613 37939,614 69445,615 5118,616 89925,617 53653,618 67001,619 84899,620 73466,621 94893,622 89658,623 71586,624 74568,625 48350,626 53633,627 13052,628 51921,629 49652,630 70039,631 75303,632 27121,633 79096,634 43090,635 48891,636 82416,637 29848,638 62424,639 5373,640 8684,641 99200,642 60580,643 76238,644 2041,645 5463,646 35638,647 31895,648 28451,649 26521,650 83679,651 39719,652 14638,653 49263,654 142,655 9060,656 51528,657 67213,658 42901,659 96278,660 19175,661 82579,662 69127,663 96808,664 21557,665 78867,666 5726,667 4259,668 98888,669 22996,670 59623,671 95604,672 29378,673 40804,674 74552,675 38803,676 11198,677 62224,678 20059,679 84342,680 7759,681 18657,682 17297,683 17035,684 61343,685 51807,686 79723,687 51892,688 58263,689 97690,690 23496,691 93574,692 39625,693 17972,694 97838,695 31619,696 86182,697 27482,698 27057,699 97066,700 73035,701 35813,702 8011,703 48413,704 72095,705 96962,706 37175,707 90032,708 87195,709 43549,710 17505,711 67525,712 77481,713 75268,714 79426,715 15563,716 74405,717 7717,718 74244,719 55467,720 80812,721 28745,722 3120,723 62556,724 72933,725 63561,726 894,727 82200,728 2820,729 45014,730 7532,731 57480,732 38669,733 38232,734 23917,735 8025,736 30200,737 31977,738 60552,739 97396,740 31663,741 98517,742 72330,743 25810,744 80941,745 84561,746 17824,747 41621,748 54829,749 52316,750 50673,751 98709,752 54710,753 95878,754 64221,755 62835,756 60170,757 78556,758 53815,759 79686,760 5715,761 94096,762 21098,763 15783,764 56945,765 95260,766 55671,767 30169,768 67001,769 58314,770 27085,771 99423,772 33236,773 52707,774 42427,775 8616,776 51912,777 60711,778 60664,779 552,780 81583,781 54938,782 2819,783 11551,784 39223,785 49281,786 97815,787 14012,788 58539,789 53525,790 40212,791 19753,792 98990,793 6224,794 90614,795 89432,796 65885,797 27148,798 11547,799 9110,800 19605,801 37402,802 91184,803 31920,804 97735,805 66844,806 64797,807 85953,808 2372,809 10870,810 45553,811 39642,812 51317,813 90449,814 70098,815 15602,816 30128,817 37132,818 37470,819 63855,820 557,821 7314,822 14889,823 35789,824 34886,825 4546,826 20346,827 11273,828 83661,829 98592,830 53083,831 91751,832 89733,833 96293,834 33087,835 98747,836 88595,837 74494,838 10148,839 2025,840 7187,841 16235,842 88760,843 50675,844 35801,845 31022,846 70474,847 1100,848 24407,849 8079,850 25644,851 45572,852 86996,853 41238,854 40803,855 2087,856 46700,857 42345,858 65293,859 82927,860 25064,861 73190,862 54364,863 77858,864 34627,865 27974,866 72845,867 60119,868 53964,869 1206,870 10160,871 49057,872 44302,873 33196,874 58182,875 15802,876 31446,877 47695,878 27856,879 73783,880 32676,881 96086,882 48377,883 86490,884 54473,885 37970,886 76366,887 99674,888 82602,889 8231,890 99276,891 8696,892 35885,893 28703,894 8406,895 4741,896 40302,897 42436,898 83118,899 49540,900 14163,901 72426,902 8356,903 90089,904 58782,905 14231,906 1906,907 14444,908 35749,909 64314,910 79370,911 8568,912 83884,913 81149,914 78988,915 48021,916 47878,917 69077,918 44761,919 87208,920 34920,921 4894,922 24455,923 8649,924 90755,925 32163,926 88569,927 45089,928 76317,929 6479,930 26436,931 49030,932 71869,933 33471,934 13727,935 16269,936 71248,937 77800,938 1675,939 36195,940 33723,941 32555,942 46153,943 57117,944 91799,945 67977,946 79762,947 83072,948 20920,949 84929,950 77964,951 36373,952 98059,953 43724,954 12600,955 53432,956 84222,957 20474,958 16827,959 24898,960 97593,961 30793,962 80389,963 4438,964 57519,965 46426,966 55917,967 47972,968 5584,969 76303,970 91609,971 59129,972 5239,973 13184,974 33134,975 209,976 25960,977 96491,978 40962,979 91575,980 68743,981 42930,982 17973,983 63657,984 30750,985 20902,986 50416,987 2615,988 10539,989 41057,990 76757,991 65703,992 21294,993 84349,994 10367,995 51607,996 80058,997 69098,998 36500,999 91167,1000 95361,1001 79560,1002 39468,1003 1607,1004 16492,1005 6132,1006 15043,1007 89997,1008 34723,1009 48562,1010 30018,1011 10256,1012 87212,1013 65867,1014 83094,1015 16322,1016 15960,1017 46928,1018 84951,1019 89714,1020 21150,1021 19644,1022 23393,1023 96267,1024 41290,1025 62142,1026 20010,1027 20645,1028 46604,1029 11330,1030 12174,1031 79200,1032 42269,1033 32180,1034 10483,1035 11652,1036 45438,1037 70641,1038 42952,1039 16571,1040 71669,1041 74666,1042 40423,1043 7662,1044 1733,1045 34650,1046 59847,1047 12815,1048 39599,1049 4829,1050 36065,1051 75056,1052 41620,1053 80262,1054 25288,1055 88945,1056 18445,1057 28812,1058 80811,1059 18482,1060 97226,1061 83179,1062 516,1063 50290,1064 27571,1065 63564,1066 97578,1067 32919,1068 23426,1069 3862,1070 34991,1071 87025,1072 90762,1073 21271,1074 45222,1075 77136,1076 95363,1077 812,1078 74050,1079 3125,1080 8337,1081 23169,1082 24284,1083 45926,1084 72164,1085 92244,1086 78059,1087 34471,1088 33974,1089 17425,1090 21365,1091 24667,1092 66195,1093 92533,1094 49871,1095 8643,1096 26734,1097 62280,1098 45,1099 26232,1100 43807,1101 3867,1102 20611,1103 33357,1104 82949,1105 65378,1106 2914,1107 50934,1108 5537,1109 66686,1110 12824,1111 53632,1112 27996,1113 35458,1114 12468,1115 43657,1116 96289,1117 42611,1118 40044,1119 22201,1120 50508,1121 60694,1122 573,1123 90626,1124 30155,1125 63372,1126 15903,1127 24444,1128 67195,1129 38335,1130 21420,1131 46992,1132 76883,1133 50303,1134 36764,1135 65327,1136 38071,1137 18645,1138 44406,1139 54888,1140 24832,1141 25654,1142 12493,1143 70909,1144 21500,1145 99034,1146 84673,1147 93934,1148 36456,1149 22903,1150 8668,1151 56277,1152 44129,1153 58926,1154 85204,1155 75471,1156 80243,1157 68899,1158 42349,1159 9031,1160 49671,1161 83483,1162 96929,1163 50902,1164 75433,1165 72812,1166 10206,1167 80305,1168 32287,1169 16748,1170 9754,1171 50119,1172 18300,1173 4205,1174 80290,1175 67924,1176 69563,1177 45426,1178 23064,1179 51503,1180 11278,1181 65192,1182 1289,1183 36653,1184 89261,1185 89098,1186 7567,1187 78786,1188 967,1189 16855,1190 27970,1191 86254,1192 33530,1193 14975,1194 71117,1195 99829,1196 12995,1197 97572,1198 28929,1199 55430,1200 57711,