FPEvalDataset/LeetCodeProblem
0304
1{2 "id": 3397,3 "name": "find_the_integer_added_to_array_i",4 "difficulty": "Easy",5 "link": "https://leetcode.com/problems/find-the-integer-added-to-array-i/",6 "date": "2024-04-21 00:00:00",7 "task_description": "You are given two arrays of equal length, `nums1` and `nums2`. Each element in `nums1` has been increased (or decreased in the case of negative) by an integer, represented by the variable `x`. As a result, `nums1` becomes **equal** to `nums2`. Two arrays are considered **equal** when they contain the same integers with the same frequencies. Return the integer `x`. **Example 1:** **Input:** nums1 = [2,6,4], nums2 = [9,7,5] **Output:** 3 **Explanation:** The integer added to each element of `nums1` is 3. **Example 2:** **Input:** nums1 = [10], nums2 = [5] **Output:** -5 **Explanation:** The integer added to each element of `nums1` is -5. **Example 3:** **Input:** nums1 = [1,1,1,1], nums2 = [1,1,1,1] **Output:** 0 **Explanation:** The integer added to each element of `nums1` is 0. **Constraints:** `1 <= nums1.length == nums2.length <= 100` `0 <= nums1[i], nums2[i] <= 1000` The test cases are generated in a way that there is an integer `x` such that `nums1` can become equal to `nums2` by adding `x` to each element of `nums1`.",8 "public_test_cases": [9 {10 "label": "Example 1",11 "input": "nums1 = [2,6,4], nums2 = [9,7,5]",12 "output": "3 "13 },14 {15 "label": "Example 2",16 "input": "nums1 = [10], nums2 = [5]",17 "output": "-5 "18 },19 {20 "label": "Example 3",21 "input": "nums1 = [1,1,1,1], nums2 = [1,1,1,1]",22 "output": "0 "23 }24 ],25 "private_test_cases": [26 {27 "input": [28 [29 900,30 406,31 917,32 736,33 331,34 89,35 81,36 268,37 776,38 577,39 299,40 33,41 555,42 191,43 54,44 329,45 85,46 429,47 623,48 887,49 533,50 290,51 806,52 636,53 946,54 10555 ],56 [57 697,58 203,59 714,60 533,61 128,62 -114,63 -122,64 65,65 573,66 374,67 96,68 -170,69 352,70 -12,71 -149,72 126,73 -118,74 226,75 420,76 684,77 330,78 87,79 603,80 433,81 743,82 -9883 ]84 ],85 "output": -20386 },87 {88 "input": [89 [90 102,91 64,92 584,93 874,94 258,95 453,96 115,97 505,98 147,99 784,100 692,101 257,102 884,103 872,104 194,105 380,106 23,107 268,108 125,109 419,110 704,111 749,112 149,113 458,114 730,115 731,116 113,117 649,118 697,119 895,120 172,121 384,122 568,123 414,124 69,125 407,126 696,127 501,128 285,129 478,130 524,131 198,132 11,133 942,134 464,135 816,136 461,137 869,138 211139 ],140 [141 673,142 635,143 1155,144 1445,145 829,146 1024,147 686,148 1076,149 718,150 1355,151 1263,152 828,153 1455,154 1443,155 765,156 951,157 594,158 839,159 696,160 990,161 1275,162 1320,163 720,164 1029,165 1301,166 1302,167 684,168 1220,169 1268,170 1466,171 743,172 955,173 1139,174 985,175 640,176 978,177 1267,178 1072,179 856,180 1049,181 1095,182 769,183 582,184 1513,185 1035,186 1387,187 1032,188 1440,189 782190 ]191 ],192 "output": 571193 },194 {195 "input": [196 [197 728,198 220,199 82200 ],201 [202 1309,203 801,204 663205 ]206 ],207 "output": 581208 },209 {210 "input": [211 [212 382,213 525,214 20,215 929,216 409,217 352,218 407,219 278,220 120,221 425,222 299,223 168,224 262,225 257,226 274,227 447,228 147,229 941,230 307,231 991,232 380,233 775,234 384,235 536,236 143,237 384,238 600,239 131,240 870,241 20,242 937,243 71,244 809,245 664,246 524,247 707,248 930,249 724,250 730,251 477,252 326,253 390,254 310255 ],256 [257 1308,258 1451,259 946,260 1855,261 1335,262 1278,263 1333,264 1204,265 1046,266 1351,267 1225,268 1094,269 1188,270 1183,271 1200,272 1373,273 1073,274 1867,275 1233,276 1917,277 1306,278 1701,279 1310,280 1462,281 1069,282 1310,283 1526,284 1057,285 1796,286 946,287 1863,288 997,289 1735,290 1590,291 1450,292 1633,293 1856,294 1650,295 1656,296 1403,297 1252,298 1316,299 1236300 ]301 ],302 "output": 926303 },304 {305 "input": [306 [307 106,308 441,309 732,310 944,311 345,312 134,313 985,314 522,315 51,316 242,317 685,318 270,319 710,320 946,321 769,322 870,323 910,324 453,325 753,326 495,327 794,328 779,329 553,330 821,331 359,332 604,333 964,334 885,335 919,336 341,337 454,338 829,339 473,340 39,341 135,342 560,343 189,344 590,345 584346 ],347 [348 569,349 904,350 1195,351 1407,352 808,353 597,354 1448,355 985,356 514,357 705,358 1148,359 733,360 1173,361 1409,362 1232,363 1333,364 1373,365 916,366 1216,367 958,368 1257,369 1242,370 1016,371 1284,372 822,373 1067,374 1427,375 1348,376 1382,377 804,378 917,379 1292,380 936,381 502,382 598,383 1023,384 652,385 1053,386 1047387 ]388 ],389 "output": 463390 },391 {392 "input": [393 [394 181,395 844,396 69,397 52,398 815,399 368,400 150,401 273,402 872,403 972,404 198,405 926,406 818,407 534,408 488,409 182,410 708,411 254,412 89,413 601,414 769,415 401,416 340,417 593,418 28,419 429,420 25,421 624,422 594,423 406,424 479,425 171,426 556,427 757,428 988,429 478,430 763,431 833,432 795,433 382,434 374,435 936,436 572,437 509,438 169,439 781,440 745,441 538,442 905,443 632,444 868,445 274,446 758,447 955,448 468,449 771,450 192,451 627,452 77,453 606,454 971,455 571,456 409,457 381,458 932,459 810,460 508,461 143,462 735,463 616,464 233,465 367,466 396,467 413,468 119,469 970,470 96,471 637,472 325,473 188,474 421,475 551,476 547,477 443,478 570,479 428480 ],481 [482 808,483 1471,484 696,485 679,486 1442,487 995,488 777,489 900,490 1499,491 1599,492 825,493 1553,494 1445,495 1161,496 1115,497 809,498 1335,499 881,500 716,501 1228,502 1396,503 1028,504 967,505 1220,506 655,507 1056,508 652,509 1251,510 1221,511 1033,512 1106,513 798,514 1183,515 1384,516 1615,517 1105,518 1390,519 1460,520 1422,521 1009,522 1001,523 1563,524 1199,525 1136,526 796,527 1408,528 1372,529 1165,530 1532,531 1259,532 1495,533 901,534 1385,535 1582,536 1095,537 1398,538 819,539 1254,540 704,541 1233,542 1598,543 1198,544 1036,545 1008,546 1559,547 1437,548 1135,549 770,550 1362,551 1243,552 860,553 994,554 1023,555 1040,556 746,557 1597,558 723,559 1264,560 952,561 815,562 1048,563 1178,564 1174,565 1070,566 1197,567 1055568 ]569 ],570 "output": 627571 },572 {573 "input": [574 [575 553,576 442,577 222,578 424,579 602,580 283,581 297,582 580,583 513,584 175,585 25,586 6,587 446,588 346,589 973,590 353,591 451,592 151,593 35,594 948,595 283,596 303,597 765,598 559,599 510,600 354,601 19,602 951,603 206,604 363,605 856,606 407,607 233,608 127,609 175,610 393,611 472,612 189,613 859,614 355,615 160,616 78,617 264,618 853,619 745,620 134,621 558,622 521,623 145,624 80,625 629,626 425,627 41,628 620,629 116,630 265,631 876,632 686,633 210,634 27,635 159,636 397,637 561,638 530,639 713,640 24,641 204,642 67,643 317,644 197,645 566,646 555,647 19,648 324,649 190,650 745,651 6,652 165,653 910,654 289655 ],656 [657 1244,658 1133,659 913,660 1115,661 1293,662 974,663 988,664 1271,665 1204,666 866,667 716,668 697,669 1137,670 1037,671 1664,672 1044,673 1142,674 842,675 726,676 1639,677 974,678 994,679 1456,680 1250,681 1201,682 1045,683 710,684 1642,685 897,686 1054,687 1547,688 1098,689 924,690 818,691 866,692 1084,693 1163,694 880,695 1550,696 1046,697 851,698 769,699 955,700 1544,701 1436,702 825,703 1249,704 1212,705 836,706 771,707 1320,708 1116,709 732,710 1311,711 807,712 956,713 1567,714 1377,715 901,716 718,717 850,718 1088,719 1252,720 1221,721 1404,722 715,723 895,724 758,725 1008,726 888,727 1257,728 1246,729 710,730 1015,731 881,732 1436,733 697,734 856,735 1601,736 980737 ]738 ],739 "output": 691740 },741 {742 "input": [743 [744 24,745 9,746 953,747 877,748 639,749 686,750 942,751 589,752 107,753 347,754 881,755 965,756 500,757 187,758 855,759 854,760 641,761 51,762 742,763 81,764 357,765 659,766 562,767 250,768 670,769 298,770 316,771 45,772 455,773 750,774 992,775 166,776 121,777 668,778 525,779 320,780 69,781 415,782 537,783 323,784 228,785 903,786 777,787 910,788 459,789 54,790 411,791 286,792 357,793 629,794 113,795 497,796 333,797 660,798 680,799 431,800 241,801 101,802 866,803 215,804 885,805 343,806 15,807 613,808 459,809 311,810 147,811 346,812 293,813 393,814 780,815 646,816 721,817 127,818 641,819 965,820 882,821 771822 ],823 [824 916,825 901,826 1845,827 1769,828 1531,829 1578,830 1834,831 1481,832 999,833 1239,834 1773,835 1857,836 1392,837 1079,838 1747,839 1746,840 1533,841 943,842 1634,843 973,844 1249,845 1551,846 1454,847 1142,848 1562,849 1190,850 1208,851 937,852 1347,853 1642,854 1884,855 1058,856 1013,857 1560,858 1417,859 1212,860 961,861 1307,862 1429,863 1215,864 1120,865 1795,866 1669,867 1802,868 1351,869 946,870 1303,871 1178,872 1249,873 1521,874 1005,875 1389,876 1225,877 1552,878 1572,879 1323,880 1133,881 993,882 1758,883 1107,884 1777,885 1235,886 907,887 1505,888 1351,889 1203,890 1039,891 1238,892 1185,893 1285,894 1672,895 1538,896 1613,897 1019,898 1533,899 1857,900 1774,901 1663902 ]903 ],904 "output": 892905 },906 {907 "input": [908 [909 771,910 471,911 733,912 559,913 790,914 63,915 458,916 44,917 859,918 715,919 431,920 142,921 592,922 75,923 779,924 117,925 763,926 489,927 599,928 921,929 690,930 370,931 86,932 317,933 487,934 996,935 920,936 852,937 173,938 307,939 462,940 741,941 539,942 263,943 525,944 594,945 5,946 118,947 323,948 246,949 668,950 852,951 456,952 996,953 723,954 956,955 848,956 896,957 983,958 779,959 31,960 485,961 118,962 379,963 440,964 179,965 190,966 309,967 506,968 628,969 265,970 291,971 361,972 936,973 474,974 324,975 64,976 182,977 714,978 39,979 695,980 737,981 944,982 926,983 442,984 702,985 275,986 871,987 161988 ],989 [990 729,991 429,992 691,993 517,994 748,995 21,996 416,997 2,998 817,999 673,1000 389,1001 100,1002 550,1003 33,1004 737,1005 75,1006 721,1007 447,1008 557,1009 879,1010 648,1011 328,1012 44,1013 275,1014 445,1015 954,1016 878,1017 810,1018 131,1019 265,1020 420,1021 699,1022 497,1023 221,1024 483,1025 552,1026 -37,1027 76,1028 281,1029 204,1030 626,1031 810,1032 414,1033 954,1034 681,1035 914,1036 806,1037 854,1038 941,1039 737,1040 -11,1041 443,1042 76,1043 337,1044 398,1045 137,1046 148,1047 267,1048 464,1049 586,1050 223,1051 249,1052 319,1053 894,1054 432,1055 282,1056 22,1057 140,1058 672,1059 -3,1060 653,1061 695,1062 902,1063 884,1064 400,1065 660,1066 233,1067 829,1068 1191069 ]1070 ],1071 "output": -421072 },1073 {1074 "input": [1075 [1076 494,1077 93,1078 976,1079 743,1080 397,1081 829,1082 935,1083 849,1084 282,1085 831,1086 890,1087 292,1088 542,1089 253,1090 302,1091 693,1092 855,1093 202,1094 73,1095 882,1096 210,1097 363,1098 224,1099 379,1100 139,1101 942,1102 417,1103 941,1104 621,1105 693,1106 961,1107 947,1108 972,1109 659,1110 970,1111 371,1112 555,1113 389,1114 103,1115 552,1116 2231117 ],1118 [1119 1400,1120 999,1121 1882,1122 1649,1123 1303,1124 1735,1125 1841,1126 1755,1127 1188,1128 1737,1129 1796,1130 1198,1131 1448,1132 1159,1133 1208,1134 1599,1135 1761,1136 1108,1137 979,1138 1788,1139 1116,1140 1269,1141 1130,1142 1285,1143 1045,1144 1848,1145 1323,1146 1847,1147 1527,1148 1599,1149 1867,1150 1853,1151 1878,1152 1565,1153 1876,1154 1277,1155 1461,1156 1295,1157 1009,1158 1458,1159 11291160 ]1161 ],1162 "output": 9061163 }1164 ],1165 "haskell_template": "addedInteger :: [Int] -> [Int] -> Int\naddedInteger nums1 nums2 ",1166 "ocaml_template": "let addedInteger (nums1: int list) (nums2: int list) : int = ",1167 "scala_template": "def addedInteger(nums1: List[Int],nums2: List[Int]): Int = { \n \n}",1168 "java_template": "class Solution {\n public int addedInteger(int[] nums1, int[] nums2) {\n \n }\n}",1169 "python_template": "class Solution(object):\n def addedInteger(self, nums1, nums2):\n \"\"\"\n :type nums1: List[int]\n :type nums2: List[int]\n :rtype: int\n \"\"\"\n "1170}