FPEvalDataset/LeetCodeProblem
0304
1{2 "id": 2722,3 "name": "prime_in_diagonal",4 "difficulty": "Easy",5 "link": "https://leetcode.com/problems/prime-in-diagonal/",6 "date": "1680393600000",7 "task_description": "You are given a 0-indexed two-dimensional integer array `nums`. Return _the largest **prime** number that lies on at least one of the diagonals of _`nums`. In case, no prime is present on any of the diagonals, return_ 0._ Note that: An integer is **prime** if it is greater than `1` and has no positive integer divisors other than `1` and itself. An integer `val` is on one of the **diagonals** of `nums` if there exists an integer `i` for which `nums[i][i] = val` or an `i` for which `nums[i][nums.length - i - 1] = val`. In the above diagram, one diagonal is **[1,5,9]** and another diagonal is** [3,5,7]**. **Example 1:** ``` **Input:** nums = [[1,2,3],[5,6,7],[9,10,11]] **Output:** 11 **Explanation:** The numbers 1, 3, 6, 9, and 11 are the only numbers present on at least one of the diagonals. Since 11 is the largest prime, we return 11. ``` **Example 2:** ``` **Input:** nums = [[1,2,3],[5,17,7],[9,11,10]] **Output:** 17 **Explanation:** The numbers 1, 3, 9, 10, and 17 are all present on at least one of the diagonals. 17 is the largest prime, so we return 17. ``` **Constraints:** `1 <= nums.length <= 300` `nums.length == numsi.length` `1 <= nums[i][j] <= 4*106`",8 "public_test_cases": [9 {10 "label": "Example 1",11 "input": "nums = [[1,2,3],[5,6,7],[9,10,11]]",12 "output": "11 "13 },14 {15 "label": "Example 2",16 "input": "nums = [[1,2,3],[5,17,7],[9,11,10]]",17 "output": "17 "18 }19 ],20 "private_test_cases": [21 {22 "input": [23 [24 3001813,25 3813454,26 1356727,27 172767,28 2258969,29 117454,30 1905831,31 913695,32 1585007,33 203343,34 3354327,35 1787213,36 1222299,37 2118734,38 1959200,39 3165285,40 2437779,41 1276332,42 2772882,43 601754,44 94912,45 2569119,46 1890380,47 555428,48 1468999,49 1855897,50 799049,51 231069,52 2457479,53 152775,54 1401082,55 148409,56 3392268,57 3838751,58 3675074,59 537139,60 3076816,61 1041486,62 1876262,63 50809,64 738998,65 1216714,66 507089,67 3806385,68 1326842,69 1181381,70 2203577,71 3364654,72 23702,73 1604348,74 784348,75 268891,76 479598,77 2467357,78 1957062,79 1424577,80 835189,81 3053200,82 2120945,83 1027207,84 1687847,85 93154,86 798689,87 3275714,88 282528,89 1730395,90 3527843,91 3562359,92 3667553,93 1863700,94 2077730,95 1190792,96 3190438,97 1756136,98 1186994,99 174652,100 1649619,101 51122,102 913561,103 2112965,104 2371752,105 2884801,106 1208334,107 3800201,108 2412137,109 3774587,110 1868911,111 2343379,112 812625,113 3003548,114 3536141,115 2348763,116 508374,117 329581,118 3005975,119 1533780,120 2659085,121 1766274,122 2394457,123 2721303,124 3008556,125 2494429,126 3276405,127 2303192,128 520639,129 3382507,130 509424,131 3434656,132 1767171,133 1057324,134 478314,135 2615289,136 813237,137 2348097,138 2819805,139 2964087,140 2058636,141 2874593,142 123420,143 3973555,144 1328042,145 1592032,146 804385,147 3195336,148 625673,149 2623933,150 1231355,151 1201182,152 522017,153 1174847,154 293925,155 64261,156 187520,157 139001,158 1337190,159 807103,160 716191,161 3891054,162 3578389,163 234531,164 1200917,165 2479229,166 2461274,167 3862189,168 2611724,169 143230,170 2975524,171 1410481,172 3871425,173 855258,174 1882248,175 3892650,176 3866057,177 2968794,178 1466917,179 3694313,180 459392,181 3480246,182 1223393,183 3697137,184 3395233,185 651660,186 3739567,187 1165681,188 629872,189 2470423,190 2286805,191 1804771,192 1481989,193 2546445,194 3874576,195 3045190,196 473877,197 1425454,198 3347765,199 975073,200 2738575,201 2099256,202 1652328,203 1891685,204 348214,205 785419,206 1095605,207 3328855,208 3764788,209 2487689,210 162279,211 1442344,212 1825283,213 3590593,214 1888421,215 983625,216 551106,217 467950,218 2418917,219 666637,220 574973,221 467484,222 1613105,223 1361674,224 2470420,225 3732691,226 3940770,227 3260582,228 3561443,229 3043230,230 3977369,231 1392543,232 668582,233 3594875,234 2496729,235 461856,236 1826637,237 1505469,238 3064256,239 2481267,240 1823584,241 2892996,242 2011333,243 1391026,244 209649,245 1269998,246 3545151,247 598028,248 1410621,249 1245503,250 2244553,251 356225,252 2162991,253 1897604,254 1309112,255 141367,256 2010741,257 3974413,258 1985484,259 998325,260 2544337,261 3150822,262 702823,263 500204,264 311979,265 3887385,266 3803500,267 3356452,268 587830,269 2197435,270 1035347,271 3910696,272 3795792,273 2681903,274 951225,275 134122,276 3357811,277 3180331,278 1756623,279 3117881,280 2379242,281 1084609,282 2653697,283 826932,284 164457,285 111311,286 1112950,287 2013984,288 823686,289 2243079,290 3798600,291 2875931,292 936492,293 1604877,294 2650713,295 637554,296 3420779,297 1216825,298 3057673,299 3489242,300 2780756,301 1101102,302 1180999,303 645791,304 2597446,305 3721485,306 1701247,307 568016,308 752849,309 3275411,310 2951589,311 444410,312 1406595,313 945427,314 763660,315 3985173,316 3917753,317 3539869318 ],319 [320 217548,321 276235,322 3140719,323 2345517,324 2322676,325 308095,326 2569930,327 1661504,328 3788334,329 2810121,330 1991020,331 3511474,332 500281,333 1052685,334 606231,335 2154363,336 3090282,337 3322552,338 1148864,339 640892,340 2662267,341 988556,342 1391290,343 1023747,344 479289,345 262731,346 2096516,347 881666,348 2481122,349 992660,350 724165,351 3008442,352 3172960,353 2963470,354 3576090,355 3215181,356 2105055,357 1965406,358 1525221,359 3071959,360 2817848,361 2490328,362 2988055,363 805940,364 2396505,365 1741003,366 309515,367 3004051,368 2884716,369 3312655,370 1974839,371 952609,372 3676935,373 2096598,374 2388888,375 3149434,376 833766,377 2657778,378 2192960,379 1755072,380 771974,381 2995103,382 426861,383 3529744,384 595192,385 2258764,386 1010551,387 2124533,388 2012701,389 3988229,390 3975382,391 991910,392 328650,393 1576719,394 2408445,395 2257316,396 1739107,397 3301394,398 133967,399 863526,400 3239435,401 871050,402 3753368,403 1359163,404 695254,405 1072476,406 2625251,407 2642722,408 1015015,409 930008,410 1340532,411 1063218,412 573271,413 1977308,414 220322,415 3621267,416 3713014,417 1186274,418 1851212,419 2263277,420 202543,421 2811937,422 3305573,423 541744,424 1960325,425 2849309,426 3608721,427 477242,428 805057,429 2796155,430 1673799,431 3292554,432 1955802,433 1919474,434 1847136,435 3133463,436 2197250,437 1627971,438 2219651,439 1215580,440 3421102,441 3257846,442 1097368,443 129019,444 2863760,445 2874464,446 325976,447 852470,448 567684,449 2896591,450 1151862,451 2540959,452 349224,453 2851021,454 230493,455 1561343,456 206860,457 3631625,458 1818234,459 1997666,460 35237,461 3313115,462 1153733,463 1383151,464 2644371,465 2615051,466 2192815,467 1862104,468 2716485,469 1296995,470 656034,471 1460182,472 2781788,473 2329989,474 3506756,475 702640,476 2755873,477 602543,478 816124,479 3433732,480 3430122,481 349103,482 2771399,483 322183,484 2840641,485 3407140,486 734803,487 910228,488 15906,489 1201313,490 1438980,491 2680866,492 2025682,493 416900,494 1909729,495 328060,496 682855,497 3388840,498 1225695,499 1176247,500 3402451,501 2496256,502 2914910,503 729179,504 3896499,505 595856,506 3395524,507 3200154,508 2086926,509 3664375,510 3228727,511 554104,512 1545627,513 703127,514 1061877,515 2450609,516 3503284,517 125284,518 2736555,519 3221660,520 1705574,521 1519682,522 2537019,523 326459,524 107078,525 1418567,526 2571895,527 3833122,528 2701424,529 2255574,530 1232090,531 3904835,532 2016889,533 2168281,534 215881,535 2304065,536 3327193,537 977855,538 1235862,539 351627,540 119537,541 184095,542 3150465,543 1980899,544 2759620,545 2827540,546 1303272,547 1957026,548 696850,549 2521051,550 3654783,551 612255,552 766157,553 1063891,554 3120442,555 307992,556 2532821,557 2822959,558 3240273,559 1850551,560 3562086,561 301853,562 1890678,563 1641142,564 489553,565 2981988,566 998565,567 2282199,568 1651579,569 997645,570 3497992,571 2736520,572 190644,573 1561084,574 2772484,575 3454478,576 3592705,577 3608094,578 2924279,579 1973515,580 2693062,581 101666,582 657620,583 2501680,584 2315557,585 1506776,586 2184211,587 2390838,588 3001760,589 3208614,590 1663101,591 2288051,592 3248655,593 2754636,594 96717,595 2055559,596 1206159,597 123786,598 2414298,599 3982588,600 858230,601 620167,602 3678219,603 1714101,604 3401899,605 2509808,606 2349610,607 2269345,608 1968221,609 2259776,610 3238731,611 1210959,612 1796755,613 2509192614 ],615 [616 1508202,617 3081011,618 1105113,619 3642659,620 3820327,621 2281748,622 59045,623 704118,624 2341019,625 1263496,626 2531994,627 2472444,628 3756604,629 3537775,630 674963,631 3920621,632 3175686,633 619258,634 3905111,635 2698241,636 1452539,637 2882835,638 1939580,639 628133,640 3226937,641 2438261,642 3691379,643 59482,644 3320733,645 1382450,646 1965446,647 3115016,648 12687,649 3696869,650 3371622,651 1196940,652 316633,653 3080643,654 2768967,655 3623064,656 2167604,657 620071,658 1103265,659 1664485,660 880678,661 2146454,662 2266225,663 563492,664 750883,665 2777433,666 1649111,667 258742,668 1470375,669 2519320,670 760932,671 3993659,672 3165503,673 771921,674 1557349,675 572137,676 772057,677 777193,678 2094196,679 1777185,680 643536,681 572105,682 3272386,683 3563473,684 2371567,685 3024505,686 2596524,687 591506,688 1135978,689 2950615,690 2654014,691 3739324,692 626571,693 388675,694 1003133,695 738796,696 454189,697 2739196,698 2645394,699 3572226,700 3659662,701 293684,702 2104689,703 2465231,704 476536,705 3876354,706 156489,707 3908204,708 2358961,709 1416160,710 3848630,711 920685,712 2595073,713 2798365,714 575040,715 2749908,716 343318,717 88076,718 2201772,719 2685933,720 2446166,721 2559949,722 3726582,723 3673062,724 3239713,725 1879299,726 3131126,727 2207643,728 2426940,729 668402,730 2800512,731 599987,732 905052,733 1834090,734 3557213,735 663359,736 2889430,737 2956874,738 1237262,739 2253536,740 336577,741 343035,742 499970,743 570608,744 230782,745 424941,746 2859272,747 1549554,748 67275,749 109612,750 1896167,751 808565,752 3622761,753 2619574,754 1135154,755 2986765,756 3447237,757 3694914,758 630681,759 2338671,760 2569412,761 926087,762 3624242,763 3286236,764 1149963,765 2209827,766 2751139,767 1024046,768 2108199,769 1682856,770 39619,771 2172654,772 1647842,773 1539137,774 1035934,775 2028039,776 3717715,777 190349,778 1375930,779 3136755,780 931655,781 2421663,782 3570201,783 3527051,784 3924616,785 1272626,786 3216969,787 2556549,788 3871665,789 3082966,790 2753316,791 15323,792 3197024,793 32103,794 2971035,795 118304,796 2479723,797 3697172,798 2828732,799 3027368,800 314539,801 1055848,802 910386,803 935378,804 3028188,805 1010178,806 3185420,807 2142953,808 3429662,809 421298,810 1990469,811 2581313,812 3607954,813 1904592,814 1000640,815 2844602,816 3391164,817 832950,818 1469319,819 2400238,820 3741925,821 1673607,822 2404958,823 3078590,824 1263384,825 1354243,826 3055402,827 1699423,828 437852,829 1429979,830 3783560,831 3878929,832 1375653,833 891664,834 1828171,835 3973303,836 467086,837 1199954,838 1505462,839 3532463,840 2888296,841 474810,842 3271556,843 1349548,844 636150,845 3027308,846 3273743,847 3560609,848 2858382,849 393904,850 3019188,851 2780180,852 81849,853 1419752,854 1623010,855 2124453,856 2005018,857 2615535,858 1073052,859 1237814,860 873378,861 2763194,862 3693460,863 3200497,864 1455858,865 414780,866 2645940,867 2592887,868 1471609,869 2563193,870 2130907,871 337349,872 1523629,873 3366435,874 784007,875 2741257,876 1593568,877 3814951,878 2872912,879 3950281,880 3228743,881 3089704,882 167862,883 2423277,884 3568816,885 2370869,886 2749523,887 3303920,888 3090880,889 3437687,890 929969,891 3276818,892 66214,893 1563772,894 3059716,895 1681156,896 3849567,897 2935045,898 3677990,899 710210,900 1847909,901 3413681,902 679036,903 3678469,904 2114835,905 1375280,906 1216003,907 2451761,908 2768443,909 2613343910 ],911 [912 3274596,913 3639190,914 2749174,915 2897927,916 2187846,917 3954181,918 1403227,919 1578204,920 495915,921 3157204,922 1810066,923 3321470,924 1208648,925 818757,926 1162392,927 1561734,928 3353863,929 1679218,930 2567992,931 3944024,932 2479284,933 1491935,934 3058420,935 528642,936 666171,937 1532854,938 3839148,939 1143167,940 663950,941 550853,942 1542544,943 622090,944 2454285,945 2548092,946 1084784,947 1898925,948 2002030,949 269002,950 568266,951 2113745,952 3063860,953 3158603,954 1379191,955 1459903,956 2759247,957 3739075,958 1693247,959 1309036,960 2898128,961 418292,962 2336012,963 3734404,964 1516212,965 2200624,966 655751,967 1245014,968 1289370,969 3336443,970 574267,971 903424,972 3353289,973 497787,974 1614397,975 2061714,976 936006,977 737387,978 1852620,979 2299902,980 2427124,981 573246,982 2841209,983 3432681,984 3321315,985 2374833,986 25832,987 801658,988 1725434,989 176711,990 1680814,991 2460711,992 3800724,993 83,994 1266098,995 1898652,996 2545344,997 653880,998 1961450,999 1600571,1000 1921254,1001 1610985,1002 2512713,1003 3841743,1004 3201475,1005 1816550,1006 2497489,1007 2183467,1008 66506,1009 159856,1010 1881880,1011 3308001,1012 2588250,1013 3530497,1014 2871686,1015 2428077,1016 3450843,1017 3918749,1018 1974796,1019 2511017,1020 1567984,1021 1279513,1022 3002093,1023 3072680,1024 1521201,1025 56315,1026 135329,1027 2436146,1028 1050954,1029 200851,1030 761601,1031 1717663,1032 3745801,1033 2470978,1034 2616729,1035 3070846,1036 3331046,1037 1023156,1038 2705210,1039 258441,1040 2590710,1041 3190430,1042 1203180,1043 1545235,1044 288828,1045 20792,1046 2042420,1047 1540186,1048 2185822,1049 906911,1050 655710,1051 10544,1052 3784338,1053 3405102,1054 370226,1055 1594896,1056 585431,1057 407680,1058 2784590,1059 3528214,1060 3262926,1061 3653503,1062 1467279,1063 2130070,1064 499808,1065 3582027,1066 304522,1067 1841301,1068 1862292,1069 3275776,1070 1749071,1071 791237,1072 679601,1073 2526643,1074 2911273,1075 1761963,1076 2950900,1077 2847601,1078 1077820,1079 648589,1080 2042667,1081 77356,1082 3897958,1083 618765,1084 741042,1085 1824541,1086 1722382,1087 193555,1088 1370297,1089 2355176,1090 3603562,1091 126576,1092 723908,1093 1745433,1094 992117,1095 2824731,1096 817783,1097 1403217,1098 1071899,1099 3971368,1100 1950750,1101 2922987,1102 636210,1103 1666736,1104 2242490,1105 1376688,1106 3488612,1107 2307096,1108 752351,1109 1097703,1110 413119,1111 3748580,1112 2814629,1113 2800909,1114 3821742,1115 1577841,1116 1236336,1117 538992,1118 2662838,1119 2310535,1120 680403,1121 2950278,1122 1522681,1123 1479089,1124 1906159,1125 2008532,1126 1384773,1127 3383509,1128 2724078,1129 2701182,1130 3232154,1131 2264939,1132 3803093,1133 3029869,1134 2114685,1135 1644810,1136 2030398,1137 3406024,1138 1180832,1139 1633341,1140 613932,1141 2055150,1142 1223043,1143 3431191,1144 55407,1145 913,1146 1678883,1147 2491465,1148 2022845,1149 3329472,1150 2332353,1151 1698644,1152 1332289,1153 2946319,1154 1751483,1155 1070898,1156 1440789,1157 2999976,1158 3960832,1159 3593657,1160 2115604,1161 3419052,1162 1371509,1163 1272311,1164 539179,1165 737785,1166 3226945,1167 3348180,1168 3952026,1169 2359103,1170 721829,1171 896191,1172 2403010,1173 805600,1174 458234,1175 1049963,1176 1287674,1177 3790129,1178 494073,1179 6849,1180 2052557,1181 1680054,1182 3817920,1183 2654751,1184 2651741,1185 609251,1186 928201,1187 1130392,1188 2610314,1189 3142461,1190 3152902,1191 838487,1192 3091203,1193 3120697,1194 3408463,1195 2404269,1196 243092,1197 691157,1198 3463321,1199 3010132,1200 1034248,