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