FPEvalDataset/LeetCodeProblem
0305
1{2 "id": 3587,3 "name": "maximum_points_tourist_can_earn",4 "difficulty": "Medium",5 "link": "https://leetcode.com/problems/maximum-points-tourist-can-earn/",6 "date": "2024-10-12 00:00:00",7 "task_description": "You are given two integers, `n` and `k`, along with two 2D integer arrays, `stayScore` and `travelScore`. A tourist is visiting a country with `n` cities, where each city is **directly** connected to every other city. The tourist's journey consists of **exactly** `k` **0-indexed** days, and they can choose **any** city as their starting point. Each day, the tourist has two choices: **Stay in the current city**: If the tourist stays in their current city `curr` during day `i`, they will earn `stayScore[i][curr]` points. **Move to another city**: If the tourist moves from their current city `curr` to city `dest`, they will earn `travelScore[curr][dest]` points. Return the **maximum** possible points the tourist can earn. **Example 1:** **Input:** n = 2, k = 1, stayScore = [[2,3]], travelScore = [[0,2],[1,0]] **Output:** 3 **Explanation:** The tourist earns the maximum number of points by starting in city 1 and staying in that city. **Example 2:** **Input:** n = 3, k = 2, stayScore = [[3,4,2],[2,1,2]], travelScore = [[0,2,1],[2,0,4],[3,2,0]] **Output:** 8 **Explanation:** The tourist earns the maximum number of points by starting in city 1, staying in that city on day 0, and traveling to city 2 on day 1. **Constraints:** `1 <= n <= 200` `1 <= k <= 200` `n == travelScore.length == travelScore[i].length == stayScore[i].length` `k == stayScore.length` `1 <= stayScore[i][j] <= 100` `0 <= travelScore[i][j] <= 100` `travelScore[i][i] == 0`",8 "public_test_cases": [9 {10 "label": "Example 1",11 "input": "n = 2, k = 1, stayScore = [[2,3]], travelScore = [[0,2],[1,0]]",12 "output": "3 "13 },14 {15 "label": "Example 2",16 "input": "n = 3, k = 2, stayScore = [[3,4,2],[2,1,2]], travelScore = [[0,2,1],[2,0,4],[3,2,0]]",17 "output": "8 "18 }19 ],20 "private_test_cases": [21 {22 "input": [23 117,24 130,25 [26 [27 89,28 78,29 98,30 87,31 91,32 77,33 57,34 75,35 99,36 48,37 7,38 9,39 20,40 25,41 34,42 83,43 12,44 16,45 65,46 81,47 70,48 34,49 7,50 97,51 27,52 33,53 1,54 8,55 80,56 58,57 31,58 8,59 92,60 39,61 98,62 55,63 71,64 71,65 48,66 26,67 18,68 21,69 3,70 65,71 61,72 94,73 77,74 66,75 79,76 48,77 68,78 12,79 58,80 17,81 20,82 95,83 27,84 86,85 80,86 77,87 80,88 3,89 57,90 62,91 71,92 80,93 31,94 59,95 92,96 14,97 3,98 83,99 80,100 7,101 58,102 51,103 98,104 7,105 88,106 44,107 35,108 94,109 98,110 95,111 98,112 16,113 48,114 62,115 56,116 76,117 68,118 34,119 30,120 8,121 30,122 9,123 94,124 81,125 32,126 30,127 90,128 42,129 92,130 4,131 96,132 26,133 73,134 62,135 38,136 88,137 85,138 23,139 35,140 68,141 74,142 17,143 87144 ],145 [146 29,147 48,148 34,149 61,150 24,151 11,152 27,153 38,154 53,155 45,156 19,157 38,158 95,159 5,160 76,161 45,162 80,163 67,164 17,165 56,166 20,167 31,168 79,169 61,170 29,171 26,172 76,173 48,174 73,175 88,176 54,177 91,178 45,179 30,180 6,181 41,182 26,183 91,184 39,185 33,186 17,187 85,188 76,189 38,190 64,191 40,192 68,193 47,194 73,195 67,196 89,197 53,198 17,199 73,200 54,201 83,202 55,203 70,204 74,205 36,206 25,207 3,208 87,209 68,210 20,211 64,212 38,213 63,214 72,215 20,216 77,217 8,218 43,219 87,220 87,221 39,222 35,223 10,224 14,225 36,226 51,227 63,228 12,229 28,230 96,231 35,232 67,233 48,234 40,235 52,236 58,237 90,238 23,239 63,240 40,241 9,242 15,243 38,244 94,245 27,246 37,247 95,248 55,249 43,250 40,251 37,252 19,253 55,254 9,255 9,256 31,257 96,258 36,259 21,260 57,261 61,262 7263 ],264 [265 62,266 60,267 22,268 20,269 96,270 72,271 28,272 37,273 67,274 20,275 63,276 59,277 56,278 53,279 74,280 20,281 65,282 7,283 36,284 77,285 46,286 57,287 98,288 95,289 79,290 85,291 37,292 19,293 9,294 31,295 74,296 94,297 89,298 97,299 63,300 12,301 72,302 11,303 90,304 36,305 84,306 94,307 29,308 99,309 11,310 56,311 76,312 11,313 73,314 85,315 31,316 75,317 96,318 62,319 48,320 99,321 81,322 23,323 51,324 45,325 40,326 56,327 66,328 17,329 34,330 97,331 9,332 25,333 85,334 50,335 37,336 60,337 40,338 10,339 95,340 26,341 65,342 35,343 50,344 23,345 55,346 28,347 48,348 85,349 14,350 77,351 64,352 21,353 10,354 32,355 86,356 72,357 98,358 35,359 8,360 9,361 50,362 42,363 61,364 38,365 87,366 24,367 39,368 58,369 13,370 25,371 51,372 29,373 79,374 78,375 64,376 44,377 13,378 46,379 86,380 29,381 90382 ],383 [384 81,385 5,386 87,387 29,388 9,389 83,390 88,391 100,392 19,393 94,394 59,395 71,396 11,397 54,398 87,399 61,400 24,401 49,402 55,403 19,404 61,405 74,406 36,407 10,408 3,409 27,410 13,411 41,412 19,413 100,414 10,415 64,416 12,417 55,418 58,419 57,420 1,421 5,422 91,423 50,424 28,425 92,426 65,427 90,428 19,429 20,430 22,431 17,432 68,433 64,434 30,435 6,436 82,437 60,438 72,439 23,440 1,441 44,442 9,443 21,444 71,445 13,446 44,447 74,448 64,449 54,450 64,451 38,452 52,453 29,454 59,455 22,456 12,457 93,458 19,459 32,460 71,461 85,462 1,463 53,464 68,465 23,466 80,467 62,468 100,469 16,470 100,471 32,472 5,473 38,474 43,475 60,476 66,477 36,478 19,479 99,480 36,481 75,482 45,483 26,484 87,485 77,486 71,487 96,488 95,489 17,490 70,491 15,492 74,493 49,494 5,495 81,496 35,497 41,498 18,499 57,500 27501 ],502 [503 14,504 18,505 71,506 89,507 50,508 2,509 86,510 63,511 37,512 36,513 65,514 31,515 74,516 43,517 43,518 42,519 43,520 97,521 16,522 22,523 35,524 39,525 53,526 100,527 97,528 6,529 80,530 40,531 74,532 99,533 33,534 13,535 69,536 39,537 35,538 3,539 50,540 19,541 38,542 18,543 99,544 97,545 99,546 98,547 89,548 94,549 41,550 54,551 55,552 5,553 56,554 64,555 46,556 87,557 46,558 79,559 98,560 3,561 81,562 25,563 60,564 53,565 61,566 50,567 25,568 20,569 52,570 17,571 75,572 15,573 74,574 2,575 13,576 39,577 19,578 84,579 83,580 78,581 5,582 27,583 10,584 11,585 39,586 65,587 23,588 8,589 6,590 28,591 36,592 61,593 65,594 59,595 100,596 10,597 40,598 100,599 27,600 95,601 87,602 94,603 85,604 87,605 82,606 4,607 90,608 7,609 1,610 68,611 38,612 39,613 31,614 27,615 64,616 12,617 93,618 16,619 68620 ],621 [622 33,623 64,624 48,625 42,626 28,627 34,628 19,629 50,630 18,631 76,632 71,633 41,634 64,635 45,636 92,637 52,638 35,639 68,640 84,641 5,642 15,643 83,644 74,645 35,646 49,647 23,648 7,649 94,650 3,651 14,652 47,653 18,654 90,655 33,656 14,657 84,658 100,659 53,660 5,661 13,662 3,663 78,664 71,665 74,666 19,667 69,668 61,669 81,670 31,671 13,672 57,673 18,674 22,675 55,676 10,677 37,678 42,679 83,680 86,681 94,682 6,683 77,684 64,685 31,686 62,687 67,688 81,689 94,690 38,691 39,692 93,693 53,694 77,695 59,696 75,697 58,698 97,699 50,700 78,701 95,702 18,703 19,704 48,705 20,706 56,707 8,708 14,709 16,710 58,711 2,712 1,713 92,714 43,715 4,716 91,717 38,718 48,719 61,720 60,721 17,722 20,723 53,724 72,725 79,726 12,727 21,728 65,729 71,730 37,731 73,732 60,733 89,734 42,735 94,736 4,737 5,738 48739 ],740 [741 91,742 58,743 94,744 41,745 68,746 1,747 90,748 24,749 31,750 37,751 7,752 26,753 79,754 2,755 32,756 16,757 16,758 83,759 42,760 1,761 87,762 16,763 64,764 56,765 32,766 41,767 65,768 86,769 94,770 72,771 2,772 5,773 28,774 4,775 83,776 21,777 62,778 60,779 90,780 33,781 76,782 77,783 39,784 37,785 40,786 24,787 34,788 49,789 81,790 80,791 59,792 35,793 88,794 72,795 89,796 2,797 67,798 11,799 73,800 16,801 46,802 31,803 69,804 1,805 7,806 88,807 45,808 8,809 76,810 84,811 70,812 24,813 72,814 52,815 3,816 47,817 92,818 43,819 46,820 93,821 88,822 29,823 76,824 91,825 56,826 75,827 55,828 61,829 97,830 95,831 33,832 45,833 82,834 24,835 45,836 20,837 10,838 78,839 41,840 19,841 62,842 45,843 41,844 67,845 74,846 6,847 22,848 93,849 68,850 70,851 45,852 78,853 32,854 38,855 14,856 13,857 14858 ],859 [860 38,861 7,862 76,863 65,864 98,865 68,866 60,867 12,868 76,869 82,870 2,871 22,872 52,873 93,874 88,875 58,876 22,877 47,878 23,879 5,880 51,881 93,882 38,883 69,884 79,885 92,886 29,887 76,888 65,889 45,890 45,891 49,892 95,893 1,894 11,895 96,896 55,897 91,898 21,899 62,900 51,901 48,902 63,903 12,904 84,905 46,906 1,907 5,908 42,909 65,910 68,911 90,912 61,913 68,914 25,915 14,916 31,917 96,918 76,919 27,920 45,921 27,922 84,923 34,924 91,925 92,926 43,927 98,928 54,929 69,930 83,931 57,932 4,933 100,934 85,935 78,936 17,937 65,938 18,939 72,940 46,941 54,942 87,943 60,944 72,945 97,946 15,947 20,948 4,949 43,950 59,951 71,952 29,953 23,954 6,955 89,956 62,957 87,958 20,959 70,960 98,961 92,962 56,963 38,964 7,965 66,966 58,967 79,968 36,969 52,970 15,971 10,972 61,973 32,974 51,975 33,976 32977 ],978 [979 96,980 98,981 65,982 44,983 45,984 38,985 32,986 56,987 42,988 49,989 78,990 91,991 27,992 1,993 70,994 42,995 14,996 71,997 1,998 37,999 9,1000 77,1001 19,1002 87,1003 10,1004 42,1005 82,1006 95,1007 39,1008 56,1009 35,1010 20,1011 51,1012 96,1013 49,1014 100,1015 56,1016 83,1017 47,1018 94,1019 43,1020 94,1021 2,1022 85,1023 19,1024 73,1025 5,1026 90,1027 91,1028 13,1029 55,1030 21,1031 16,1032 27,1033 70,1034 30,1035 86,1036 66,1037 53,1038 78,1039 77,1040 37,1041 15,1042 5,1043 53,1044 94,1045 22,1046 15,1047 69,1048 16,1049 55,1050 31,1051 7,1052 21,1053 25,1054 71,1055 59,1056 14,1057 31,1058 100,1059 21,1060 48,1061 9,1062 64,1063 56,1064 11,1065 16,1066 48,1067 90,1068 67,1069 52,1070 14,1071 20,1072 10,1073 61,1074 66,1075 81,1076 70,1077 67,1078 17,1079 93,1080 29,1081 24,1082 84,1083 87,1084 82,1085 21,1086 99,1087 100,1088 67,1089 20,1090 85,1091 24,1092 26,1093 9,1094 73,1095 271096 ],1097 [1098 94,1099 58,1100 36,1101 97,1102 25,1103 37,1104 18,1105 53,1106 86,1107 59,1108 8,1109 91,1110 53,1111 21,1112 6,1113 51,1114 80,1115 83,1116 21,1117 68,1118 47,1119 96,1120 48,1121 33,1122 30,1123 36,1124 67,1125 54,1126 96,1127 56,1128 41,1129 23,1130 63,1131 3,1132 96,1133 6,1134 16,1135 36,1136 94,1137 21,1138 100,1139 9,1140 98,1141 73,1142 98,1143 31,1144 98,1145 89,1146 98,1147 73,1148 35,1149 55,1150 59,1151 36,1152 73,1153 47,1154 84,1155 64,1156 6,1157 64,1158 79,1159 11,1160 94,1161 61,1162 48,1163 60,1164 94,1165 52,1166 100,1167 34,1168 63,1169 7,1170 56,1171 29,1172 57,1173 53,1174 13,1175 2,1176 29,1177 26,1178 79,1179 60,1180 98,1181 32,1182 22,1183 39,1184 52,1185 10,1186 31,1187 16,1188 81,1189 37,1190 76,1191 47,1192 7,1193 66,1194 91,1195 82,1196 4,1197 78,1198 60,1199 53,1200 68,