FPEvalDataset/LeetCodeProblem
0304
1{2 "id": 2698,3 "name": "find_the_array_concatenation_value",4 "difficulty": "Easy",5 "link": "https://leetcode.com/problems/find-the-array-concatenation-value/",6 "date": "1675555200000",7 "task_description": "You are given a **0-indexed** integer array `nums`. The **concatenation** of two numbers is the number formed by concatenating their numerals. For example, the concatenation of `15`, `49` is `1549`. The **concatenation value** of `nums` is initially equal to `0`. Perform this operation until `nums` becomes empty: If `nums` has a size greater than one, add the value of the concatenation of the first and the last element to the **concatenation value** of `nums`, and remove those two elements from `nums`. For example, if the `nums` was `[1, 2, 4, 5, 6]`, add 16 to the `concatenation value`. If only one element exists in `nums`, add its value to the **concatenation value** of `nums`, then remove it. Return_ the concatenation value of `nums`_. **Example 1:** ``` **Input:** nums = [7,52,2,4] **Output:** 596 **Explanation:** Before performing any operation, nums is [7,52,2,4] and concatenation value is 0. - In the first operation: We pick the first element, 7, and the last element, 4. Their concatenation is 74, and we add it to the concatenation value, so it becomes equal to 74. Then we delete them from nums, so nums becomes equal to [52,2]. - In the second operation: We pick the first element, 52, and the last element, 2. Their concatenation is 522, and we add it to the concatenation value, so it becomes equal to 596. Then we delete them from the nums, so nums becomes empty. Since the concatenation value is 596 so the answer is 596. ``` **Example 2:** ``` **Input:** nums = [5,14,13,8,12] **Output:** 673 **Explanation:** Before performing any operation, nums is [5,14,13,8,12] and concatenation value is 0. - In the first operation: We pick the first element, 5, and the last element, 12. Their concatenation is 512, and we add it to the concatenation value, so it becomes equal to 512. Then we delete them from the nums, so nums becomes equal to [14,13,8]. - In the second operation: We pick the first element, 14, and the last element, 8. Their concatenation is 148, and we add it to the concatenation value, so it becomes equal to 660. Then we delete them from the nums, so nums becomes equal to [13]. - In the third operation: nums has only one element, so we pick 13 and add it to the concatenation value, so it becomes equal to 673. Then we delete it from nums, so nums become empty. Since the concatenation value is 673 so the answer is 673. ``` **Constraints:** `1 <= nums.length <= 1000` `1 <= nums[i] <= 104`",8 "public_test_cases": [9 {10 "label": "Example 1",11 "input": "nums = [7,52,2,4]",12 "output": "596 "13 },14 {15 "label": "Example 2",16 "input": "nums = [5,14,13,8,12]",17 "output": "673 "18 }19 ],20 "private_test_cases": [21 {22 "input": [23 4673,24 6349,25 8246,26 2307,27 1029,28 2892,29 3145,30 420,31 87,32 1208,33 6965,34 7059,35 8206,36 5085,37 6228,38 2713,39 7805,40 7667,41 2183,42 6199,43 3767,44 4749,45 5522,46 8150,47 5616,48 4028,49 9659,50 4652,51 2237,52 3506,53 3609,54 9445,55 2096,56 3976,57 2867,58 7434,59 8814,60 7877,61 9150,62 4251,63 7757,64 7784,65 619,66 6451,67 5730,68 5275,69 4507,70 7108,71 4383,72 8828,73 4246,74 5705,75 1886,76 2645,77 3463,78 9633,79 2104,80 5070,81 5374,82 4139,83 2033,84 4440,85 493,86 6175,87 2203,88 8568,89 9613,90 7581,91 8360,92 8086,93 5114,94 1491,95 8062,96 2265,97 339,98 1680,99 8109,100 3695,101 414,102 2503,103 5810,104 4705,105 971,106 9983,107 6480,108 3611,109 8128,110 6674,111 5491,112 1443,113 3815,114 8673,115 7120,116 1083,117 582,118 2372,119 6213,120 1149,121 561,122 104,123 5491,124 8515,125 2787,126 7605,127 601,128 2681,129 4202,130 5387,131 7295,132 2397,133 2331,134 1855,135 1335,136 8044,137 8666,138 6286,139 2877,140 856,141 4242,142 4393,143 4376,144 2133,145 2812,146 8089,147 5380,148 8220,149 3652,150 1782,151 6706,152 6048,153 716,154 4468,155 6684,156 3739,157 2937,158 5849,159 8069,160 145,161 138,162 1390,163 7045,164 4717,165 4355,166 2213,167 5368,168 3757,169 75,170 3823,171 1434,172 2446,173 1130,174 7884,175 6190,176 7273,177 1780,178 1287,179 7122,180 5660,181 6267,182 3303,183 7852,184 2698,185 6663,186 5995,187 9227,188 2951,189 4152,190 4137,191 2217,192 9781,193 306,194 7669,195 5721,196 5723,197 3969,198 8480,199 6101,200 3622,201 8191,202 3818,203 4624,204 7863,205 7144,206 2322,207 9799,208 8292,209 4590,210 383,211 689,212 6962,213 3887,214 623,215 2508,216 4576,217 4417,218 5274,219 5033,220 8288,221 438,222 1145,223 1417,224 1328,225 8742,226 9124,227 8979,228 1451,229 5883,230 7513,231 7090,232 5608,233 7012,234 6480,235 9512,236 3449,237 6237,238 3536,239 9912,240 5206,241 5316,242 9718,243 4410,244 795,245 1206,246 4418,247 9213,248 6948,249 3130,250 6851,251 3777,252 1058,253 2079,254 5133,255 9881,256 1498,257 1423,258 7312,259 4368,260 4615,261 5247,262 3188,263 3124,264 8226,265 7460,266 4360,267 6880,268 458,269 6850,270 7851,271 2863,272 8087,273 6115,274 1875,275 5805,276 3734,277 5716,278 2386,279 5221,280 2091,281 7367,282 3810,283 9865,284 9139,285 8403,286 1880,287 188,288 3519,289 360,290 6312,291 4541,292 6623,293 3549,294 7871,295 6234,296 532,297 6354,298 2971,299 7947,300 6071,301 2175,302 1340,303 9798,304 4369,305 3279,306 317,307 1063,308 9889,309 8087,310 7346,311 1206,312 285,313 4502,314 6788,315 8658,316 2399,317 9832,318 6732,319 1522,320 1646,321 80,322 3780,323 4746,324 1051,325 3480,326 843,327 1917,328 6051,329 6189,330 7128,331 6301,332 6590,333 563,334 8332,335 6463,336 6761,337 3060,338 7580,339 6513,340 6580,341 6947,342 4781,343 3234,344 1701,345 9034,346 2393,347 4124,348 560,349 3505,350 6375,351 6423,352 9723,353 8156,354 9995,355 3422,356 1685,357 4722,358 1099,359 3281,360 3136361 ],362 "output": 7330104576363 },364 {365 "input": [366 4110,367 492,368 4182,369 7323,370 4189,371 4503,372 9122,373 9219,374 208,375 3865,376 540,377 9524,378 2127,379 9272,380 5496,381 4246,382 6107,383 4713,384 7609,385 8109,386 8031,387 8473,388 9415,389 1489,390 8644,391 702,392 4593,393 4519,394 496,395 3350,396 9268,397 5457,398 6331,399 7392,400 4150,401 3620,402 3530,403 5966,404 5868,405 2782,406 511,407 9557,408 180,409 3003,410 2693,411 2036,412 3615,413 9726,414 2642,415 4118,416 7353,417 451,418 7281,419 8379,420 482,421 8432,422 8446,423 1691,424 494,425 9564,426 9180,427 9447,428 8226,429 9982,430 6684,431 6549,432 5538,433 4478,434 9839,435 2082,436 3811,437 8008,438 2431,439 1998,440 3228,441 8868,442 8882,443 3279,444 5860,445 8004,446 6466,447 6520,448 1290,449 4730,450 9272,451 8833,452 1643,453 2625,454 7987,455 1955,456 6945,457 9438,458 1999,459 8437,460 1134,461 4501,462 8181,463 4223,464 1202,465 6475,466 3581,467 1064,468 7901,469 814,470 427,471 3846,472 1140,473 3000,474 3105,475 7527,476 5519,477 3237,478 2481,479 7095,480 7956,481 1838,482 7736,483 2687,484 3265,485 2088,486 9205,487 5986,488 7539,489 8337,490 6611,491 47,492 232,493 3192,494 5042,495 4776,496 3096,497 1757,498 7770,499 9072,500 7885,501 886,502 9195,503 141,504 5308,505 1233,506 3851,507 3810,508 3126,509 1237,510 3249,511 7364,512 4851,513 9475,514 6406,515 2655,516 1018,517 1993,518 8416,519 3729,520 2467,521 1664,522 7163,523 8880,524 2618,525 1190,526 9942,527 6584,528 1572,529 8955,530 318,531 2849,532 7694,533 7437,534 7294,535 9916,536 5624,537 2454,538 5564,539 223,540 9125,541 9019,542 600,543 3883,544 4296,545 4546,546 4556,547 1868,548 2448,549 1800,550 7819,551 8383,552 2949,553 1524,554 7271,555 2366,556 9802,557 1198,558 7475,559 4234,560 3248,561 5493,562 2390,563 6243,564 7060,565 9047,566 6313,567 6150,568 9695,569 6069,570 4520,571 4123,572 3662,573 582,574 2720,575 9341,576 9512,577 1516,578 774,579 4529,580 1231,581 7411,582 5576,583 1293,584 425,585 8222,586 3623,587 1648,588 9512,589 8318,590 6100,591 4895,592 327,593 1306,594 9415,595 2149,596 6543,597 1002,598 1612,599 6210,600 9378,601 8541,602 9402,603 618,604 4242,605 5410,606 1632,607 7801,608 8037,609 702,610 8276,611 4409,612 8199,613 5409,614 9992,615 7377,616 3160,617 3271,618 9314,619 6784,620 5281,621 8599,622 6614,623 2667,624 9465,625 6159,626 7286,627 3137,628 681,629 3796,630 7393,631 8304,632 2561,633 9900,634 8108,635 9230,636 3207,637 2816,638 3260,639 2673,640 4941,641 6506,642 1714,643 519,644 9867,645 6783,646 6024,647 9824,648 184,649 1490,650 8866,651 3016,652 81,653 7765,654 1602,655 3528,656 1414,657 101,658 2420,659 2364,660 3847,661 8719,662 5162,663 2717,664 8983,665 5796,666 7309,667 4484,668 4295,669 5304,670 1782,671 4656,672 1860,673 2819,674 5274,675 9455,676 9840,677 7753,678 2210,679 4103,680 9455,681 6774,682 9832,683 412,684 3067,685 1031,686 1585,687 9187,688 5727,689 8528,690 2727,691 1167,692 7970,693 3840,694 8662,695 9095,696 8724,697 3401,698 1384,699 7946,700 6436,701 8675,702 8347,703 3002,704 862,705 7755,706 4625,707 9269,708 6706,709 2492,710 6230,711 9334,712 8741,713 5264,714 1178,715 7163,716 3428,717 8745,718 9617,719 6749,720 6449,721 9084,722 9102,723 7864,724 248,725 9325,726 8997,727 5248,728 4770,729 5048,730 5795,731 7978,732 2123,733 2637,734 4120,735 7926,736 6391,737 8120,738 7213,739 4107,740 5890,741 2902,742 3857,743 1135,744 6691,745 2942,746 6808,747 9089,748 8259,749 5768,750 1716,751 3131,752 4575,753 4028,754 8939,755 1728,756 7942,757 4731,758 5576,759 201,760 1467,761 9744,762 7566,763 9871,764 6348,765 3964,766 5664,767 7441,768 1878,769 9899,770 3247,771 183,772 4538,773 2040,774 4114,775 3166,776 8878,777 9774,778 5309,779 8417,780 8804,781 814,782 9345,783 4666,784 2201,785 9895,786 2104,787 7792,788 5086,789 7639,790 7964,791 7413,792 316,793 9211,794 3475,795 4243,796 5797,797 1088,798 5041,799 3805,800 9561,801 2302,802 6025,803 3125,804 1465,805 6678,806 3527,807 8985,808 774,809 2424,810 1210,811 8029,812 1259,813 5108,814 3404,815 8200,816 7354,817 247,818 544,819 8704,820 2408,821 6157,822 7225,823 521,824 4889,825 5316,826 2804,827 6683,828 940,829 9166,830 9155,831 5216,832 5169,833 4783,834 3098,835 3630,836 144,837 2972,838 6589,839 7155,840 7912,841 5480,842 7584,843 427,844 1666,845 712,846 2207,847 2586,848 4023,849 8067,850 5847,851 3638,852 8230,853 1102,854 9400,855 6044,856 3015,857 2925,858 4694,859 4907,860 1258,861 7,862 647,863 1387,864 80,865 852,866 4455,867 6500,868 8882,869 4907,870 2970,871 4373,872 8160,873 7509,874 3734,875 9750,876 4364,877 6538,878 7371,879 6652,880 3795,881 6454,882 4245,883 2968,884 9377,885 1122,886 9139,887 424,888 5033,889 2721,890 6895,891 2288,892 9695,893 6416,894 3099,895 1062,896 7427,897 3864,898 8303,899 8524,900 2781,901 2650,902 8165,903 5891,904 876,905 9941,906 6849,907 6321,908 4996,909 2271,910 4663,911 826,912 6401,913 561,914 4313,915 9796,916 8760,917 6042,918 9644,919 3838,920 2873,921 4678,922 4892,923 9734,924 2659,925 2631,926 5750,927 8526,928 7351,929 4388,930 6715,931 1813,932 8526,933 8522,934 7587,935 5585,936 656,937 715,938 6455,939 4724,940 2528,941 5173,942 2085,943 3026,944 8261,945 8912,946 3767,947 4647,948 4487,949 4165,950 6071951 ],952 "output": 13314516939953 },954 {955 "input": [956 7771,957 2874,958 8845,959 8919,960 5382,961 5640,962 3363,963 5080,964 1969,965 6990,966 7342,967 819,968 9767,969 1657,970 219,971 7296,972 575,973 9691,974 8681,975 5065,976 82,977 3158,978 4287,979 8517,980 7361,981 2168,982 6455,983 619,984 2641,985 9644,986 5548,987 3573,988 5192,989 152,990 4721,991 5310,992 5878,993 1212,994 5829,995 6076,996 8047,997 3540,998 4271,999 8648,1000 7568,1001 8107,1002 6409,1003 8668,1004 6641,1005 4814,1006 8832,1007 3226,1008 2445,1009 9116,1010 6975,1011 6349,1012 3894,1013 6620,1014 5022,1015 7848,1016 2636,1017 7626,1018 136,1019 5678,1020 1675,1021 7886,1022 3799,1023 7418,1024 35,1025 6169,1026 6036,1027 425,1028 6190,1029 8146,1030 7440,1031 4528,1032 7917,1033 4227,1034 804,1035 81,1036 1759,1037 4088,1038 8831,1039 7687,1040 908,1041 2921,1042 6980,1043 5739,1044 4006,1045 7547,1046 5049,1047 6848,1048 4418,1049 6872,1050 324,1051 5485,1052 2689,1053 4525,1054 7752,1055 6856,1056 6006,1057 4248,1058 681,1059 7064,1060 6220,1061 9797,1062 6131,1063 3954,1064 4105,1065 7677,1066 8586,1067 4437,1068 8063,1069 2558,1070 7324,1071 5227,1072 5204,1073 754,1074 9183,1075 9326,1076 2555,1077 9940,1078 9101,1079 1786,1080 4215,1081 460,1082 4908,1083 6948,1084 1063,1085 2619,1086 1539,1087 1154,1088 1051,1089 6334,1090 2979,1091 4887,1092 2547,1093 342,1094 9882,1095 6415,1096 9396,1097 1961,1098 9964,1099 4391,1100 6748,1101 8970,1102 7114,1103 6331,1104 7567,1105 2113,1106 9008,1107 1492,1108 5905,1109 9606,1110 481,1111 909,1112 3739,1113 4308,1114 8589,1115 5909,1116 7886,1117 813,1118 5134,1119 1924,1120 3642,1121 9981,1122 3896,1123 4942,1124 7399,1125 2244,1126 3980,1127 6135,1128 3991,1129 4204,1130 7954,1131 6014,1132 7985,1133 5356,1134 9285,1135 2597,1136 6104,1137 7346,1138 3679,1139 7963,1140 281,1141 5839,1142 1616,1143 9945,1144 9638,1145 4040,1146 2454,1147 534,1148 168,1149 1528,1150 5510,1151 7997,1152 2131,1153 3999,1154 4615,1155 2483,1156 2217,1157 8773,1158 8701,1159 4145,1160 143,1161 8030,1162 2060,1163 2061,1164 2329,1165 2450,1166 7699,1167 3185,1168 1300,1169 19881170 ],1171 "output": 50513759371172 },1173 {1174 "input": [1175 5492,1176 8538,1177 8304,1178 5363,1179 3128,1180 5724,1181 7835,1182 7529,1183 9146,1184 146,1185 25211186 ],1187 "output": 2314409011188 },1189 {1190 "input": [1191 8851,1192 519,1193 9161,1194 6834,1195 9866,1196 8989,1197 3955,1198 6611,1199 6466,1200 5367,