FPEvalDataset/LeetCodeProblem
0304
1{2 "id": 2402,3 "name": "maximum_xor_after_operations",4 "difficulty": "Medium",5 "link": "https://leetcode.com/problems/maximum-xor-after-operations/",6 "date": "2022-06-11 00:00:00",7 "task_description": "You are given a **0-indexed** integer array `nums`. In one operation, select **any** non-negative integer `x` and an index `i`, then **update** `nums[i]` to be equal to `nums[i] AND (nums[i] XOR x)`. Note that `AND` is the bitwise AND operation and `XOR` is the bitwise XOR operation. Return _the **maximum** possible bitwise XOR of all elements of _`nums`_ after applying the operation **any number** of times_. **Example 1:** ``` **Input:** nums = [3,2,4,6] **Output:** 7 **Explanation:** Apply the operation with x = 4 and i = 3, num[3] = 6 AND (6 XOR 4) = 6 AND 2 = 2. Now, nums = [3, 2, 4, 2] and the bitwise XOR of all the elements = 3 XOR 2 XOR 4 XOR 2 = 7. It can be shown that 7 is the maximum possible bitwise XOR. Note that other operations may be used to achieve a bitwise XOR of 7. ``` **Example 2:** ``` **Input:** nums = [1,2,3,9,2] **Output:** 11 **Explanation:** Apply the operation zero times. The bitwise XOR of all the elements = 1 XOR 2 XOR 3 XOR 9 XOR 2 = 11. It can be shown that 11 is the maximum possible bitwise XOR. ``` **Constraints:** `1 <= nums.length <= 105` `0 <= nums[i] <= 108`",8 "public_test_cases": [9 {10 "label": "Example 1",11 "input": "nums = [3,2,4,6]",12 "output": "7 "13 },14 {15 "label": "Example 2",16 "input": "nums = [1,2,3,9,2]",17 "output": "11 "18 }19 ],20 "private_test_cases": [21 {22 "input": [23 69275964,24 45689662,25 90974422,26 20534074,27 80893042,28 7919351,29 56063645,30 58450300,31 7946529,32 57440275,33 89846487,34 38137598,35 80424295,36 38906956,37 11827049,38 46528161,39 44320604,40 39126637,41 29466179,42 75362694,43 95784621,44 82806144,45 58349873,46 89187086,47 47659279,48 24395597,49 14753435,50 51154352,51 15927038,52 20980005,53 73912592,54 67230173,55 95870029,56 55755852,57 28744038,58 1311679,59 75203838,60 58667151,61 61423107,62 92866770,63 43612254,64 87568610,65 48257667,66 46761550,67 50240683,68 79746671,69 41537428,70 81657916,71 55770004,72 37726888,73 63170962,74 39023911,75 78601334,76 45467461,77 55801522,78 22624185,79 24953565,80 47663153,81 49776778,82 20972652,83 52636439,84 75819723,85 21820674,86 15781731,87 92187424,88 11941206,89 4265820,90 7163127,91 40875593,92 5863150,93 73070064,94 51125012,95 50480285,96 51347245,97 45650541,98 4881696,99 63447585,100 96221570,101 7945889,102 93490862,103 81539236,104 2872241,105 31379849,106 92861816,107 68834753,108 86962669,109 27968566,110 28804418,111 4444236,112 68568946,113 75026665,114 13139747,115 65166716,116 28571432,117 37861847,118 84605908,119 95965826,120 15835634,121 48546746,122 66798757,123 7706245,124 40569279,125 3028301,126 90939301,127 19307693,128 97961559,129 30302832,130 92230215,131 57221540,132 30175093,133 67293906,134 66385800,135 60893720,136 32247772,137 1460131,138 25102238,139 32261842,140 96842121,141 51732246,142 22491337,143 96962969,144 58893056,145 61922937,146 87200140,147 262751,148 70712525,149 24563600,150 9719778,151 81374425,152 36350668,153 57258145,154 57547869,155 62326551,156 50127962,157 90682959,158 928934,159 77568294,160 84047258,161 7328718,162 89292027,163 72098340,164 2233831,165 42043926,166 70403232,167 19718536,168 69559663,169 56016295,170 20596363,171 99554868,172 85743108,173 5061352,174 35472862,175 71006516,176 87795947,177 44502645,178 39491717,179 83167665,180 27128908,181 94674427,182 70244290,183 99236602,184 6396128,185 28352857,186 32421810,187 35362269,188 58299758,189 67748428,190 47776770,191 96230907,192 49683524,193 57419457,194 10680782,195 28590851,196 93702679,197 39689688,198 107846,199 65339425,200 21395940,201 65615512,202 69506637,203 71318734,204 79806539,205 79181849,206 31472779,207 1511592,208 52035390,209 22703840,210 35445349,211 64138466,212 72960134,213 85392226,214 20287470,215 44140021,216 30700286,217 9288783,218 91166154,219 32204995,220 55750671,221 98798974,222 224460,223 59214488,224 13700572,225 87680175,226 5953852,227 57707885,228 91123021,229 31312499,230 9822963,231 71909279,232 95240437,233 12067111,234 87742329,235 34743858,236 23689137,237 52565687,238 83214341,239 22041622,240 91275559,241 29038938,242 68160556,243 42945118,244 35885656,245 10083212,246 21634140,247 85644789,248 11351308,249 19735907,250 71031505,251 94264118,252 24830352,253 53666707,254 3588224,255 23904843,256 64529016,257 23397114,258 75474483,259 7607359,260 12385837,261 36616455,262 13234685,263 16102749,264 2543763,265 78778769,266 81355530,267 88237822,268 66112646,269 7756209,270 74379654,271 87717022,272 15773661,273 48714179,274 81309177,275 65407005,276 54999950,277 12548259,278 96705089,279 72956213,280 14354876,281 10024013,282 70295921,283 19714882,284 79696979,285 4907128,286 57504104,287 73886104,288 79601297,289 14802933,290 81631544,291 10573570,292 89024761,293 54933265,294 81464056,295 74451376,296 26443678,297 15474714,298 7246551,299 4287078,300 87575950,301 33746169,302 16841286,303 54122357,304 15696840,305 66531952,306 94214265,307 64245500,308 62536287,309 16819592,310 12373894,311 68259057,312 93723481,313 65010778,314 27635249,315 91864581,316 22219692,317 90269941,318 7716746,319 46857321,320 43070673,321 80401466,322 58034236,323 23714339,324 3970910,325 25057101,326 83954856,327 47380854,328 18224461,329 66010208,330 81226667,331 76292264,332 2580821,333 33074471,334 74979756,335 17678183,336 34800366,337 65472713,338 13172121,339 61124292,340 53706310,341 59279197,342 51775666,343 31202059,344 88857332,345 54606824,346 10283591,347 23855742,348 90063164,349 7539876,350 70285189,351 74278125,352 33230776,353 90783230,354 16049761,355 94199421,356 42010484,357 35614372,358 42786169,359 49832137,360 45000752,361 44597140,362 24262498,363 85271331,364 27379773,365 33570473,366 71021511,367 57243534,368 82723338,369 70289041,370 31088911,371 81800425,372 99242752,373 43807058,374 19797852,375 82262130,376 22611927,377 93848160,378 42739084,379 97552830,380 35383062,381 31708730,382 32319270,383 69414650,384 30841804,385 94363534,386 52332544,387 86835854,388 20486871,389 65610433,390 65324625,391 88625732,392 82599455,393 15548171,394 64789054,395 22319257,396 41593368,397 96003300,398 65046720,399 75047317,400 82726087,401 23906228,402 72636675,403 30146794,404 68647294,405 22626819,406 14317853,407 62856362,408 88518776,409 97485576,410 62764315,411 66208017,412 91361333,413 50136670,414 93192985,415 85640613,416 36105369,417 45868942,418 92097692,419 56775019,420 43520700,421 4741307,422 48769879,423 61209082,424 51636661,425 30235184,426 55618346,427 32610168,428 28640185,429 51494242,430 23177253,431 94862810,432 47408780,433 38996522,434 5394032,435 16991361,436 31312951,437 45286237,438 15998085,439 62824536,440 37679493,441 25096382,442 75591159,443 93867926,444 45939408,445 66543006,446 76192104,447 13093279,448 81842793,449 3215124,450 92671518,451 89954401,452 25036411,453 44119207,454 87918761,455 20103281,456 36862532,457 88571977,458 76710220,459 37283627,460 27658357,461 4933187,462 42595716,463 76740595,464 78606730,465 44587840,466 46959275,467 19595850,468 74436953,469 94058137,470 63798727,471 10445894,472 75278348,473 67910222,474 61734903,475 27337364,476 79042984,477 23294057,478 65175487,479 19835568,480 34245101,481 69779269,482 36486905,483 10383641,484 44653609,485 3434444,486 13392268,487 36100050,488 81890957,489 26163094,490 47218193,491 10896531,492 91700267,493 65796587,494 89891834,495 46031909,496 12724763,497 95757640,498 96614647,499 18575033,500 21997542,501 38586393,502 22699236,503 35953580,504 6418887,505 61923400,506 19748393,507 88400980,508 45885917,509 77865596,510 87974620,511 22878276,512 92613795,513 5709603,514 53632852,515 97910421,516 38627245,517 21161764,518 46461692,519 14519346,520 4336295,521 62112519,522 29165125,523 31818321,524 64566173,525 85410187,526 6998527,527 35138007,528 97859742,529 85982922,530 8135639,531 95753498,532 63961243,533 66575717,534 47798882,535 10982414,536 5632662,537 46031980,538 62736399,539 50494324,540 67542851,541 46511498,542 22719101,543 56298735,544 67710286,545 36940784,546 13043683,547 41538683,548 90614029,549 26687113,550 8315685,551 51026440,552 98514365,553 48720517,554 24675555,555 39820580,556 86958886,557 90257901,558 12362386,559 14201887,560 42603507,561 93946688,562 59910448,563 47551163,564 20814990,565 71554027,566 99966857,567 54203461,568 46219588,569 42573947,570 8314886,571 45559157,572 82578957,573 39966698,574 90915463,575 76822094,576 60440652,577 84345769,578 10778729,579 24930120,580 92882043,581 39782450,582 31466343,583 25959231,584 23988254,585 37980956,586 34287881,587 55709054,588 24986726,589 14903041,590 64174317,591 62581325,592 90175954,593 38946613,594 80223757,595 67226481,596 12329335,597 79169931,598 30769822,599 54750692,600 69213397,601 35216790,602 49902645,603 27127644,604 58462912,605 69179217,606 97598688,607 66000937,608 4051662,609 6121530,610 50981642,611 81947694,612 81965013,613 92992789,614 37278482,615 2544575,616 4849601,617 25198002,618 41774480,619 22149611,620 45620162,621 2377944,622 11766599,623 7326410,624 21551349,625 4111692,626 20322635,627 5186329,628 27230528,629 7334713,630 27765441,631 10508756,632 26572296,633 5219812,634 5893502,635 6338431,636 15376330,637 98247669,638 30841697,639 61879810,640 10251846,641 50886255,642 87154001,643 22890019,644 31878545,645 12825209,646 75054429,647 54950478,648 44103941,649 63964068,650 13043135,651 94719300,652 96116089,653 2843355,654 5077201,655 6289217,656 82974947,657 28079539,658 667398,659 945246,660 70350468,661 23835819,662 32412670,663 28430458,664 65635347,665 36059683,666 84851961,667 99585089,668 56955441,669 29695269,670 3394317,671 94701729,672 44720835,673 40032466,674 44285651,675 83076541,676 33070924,677 37214180,678 40374862,679 19035825,680 79228021,681 67924979,682 48650169,683 48449333,684 53701688,685 42113295,686 21591256,687 991683,688 91957344,689 3156028,690 57186036,691 99955903,692 81578725,693 605775,694 46341970,695 58717875,696 35291563,697 41525994,698 84212394,699 49920122,700 90717230,701 98535668,702 76285569,703 36996172,704 74335401,705 43334368,706 47138998,707 1572624,708 22229752,709 68084193,710 35003714,711 71917717,712 82465733,713 39805084,714 87544487,715 69448458,716 77962326,717 80838737,718 86571447,719 44998651,720 70983827,721 46848028,722 77027236,723 58101841,724 34791632,725 58598540,726 73947877,727 85568395,728 37800694,729 95938896,730 38810045,731 70432293,732 3380570,733 11988372,734 28176054,735 77610073,736 2129697,737 31988651,738 94330749,739 46565272,740 39098210,741 96938926,742 61978135,743 64644074,744 62039028,745 29378216,746 98698978,747 37074558,748 35997332,749 5458941,750 93885376,751 15955000,752 40067925,753 45503898,754 33204168,755 10887456,756 14731415,757 69255723,758 28155717,759 58855656,760 30843478,761 95625679,762 10575465,763 81943459,764 98577433,765 33689502,766 73382894,767 23208245,768 18805915,769 37810741,770 36432792,771 28066335,772 71561830,773 14429401,774 10373634,775 40857785,776 58354911,777 42148038,778 63201954,779 11888128,780 25864138,781 49363056,782 79530612,783 38122183,784 3849135,785 85362030,786 98859350,787 70629721,788 72189213,789 86897112,790 59045125,791 26798319,792 94002008,793 74729741,794 2244,795 29735561,796 99719876,797 61782922,798 46047642,799 29509329,800 60696208,801 95267193,802 46341818,803 44809914,804 11602103,805 64122332,806 3745074,807 55307569,808 13614309,809 98851933,810 80996560,811 16008632,812 74083077,813 48451535,814 85635988,815 45718695,816 61358261,817 59403383,818 10296061,819 80883965,820 16922534,821 27505270,822 43540257,823 5834267,824 10509003,825 27130418,826 11476312,827 47727357,828 71880133,829 97692257,830 35663936,831 28036820,832 85511255,833 24641056,834 12014499,835 65736149,836 85625396,837 74704969,838 41527724,839 42600437,840 40551745,841 62810325,842 22028709,843 44341222,844 60401662,845 99712655,846 31231494,847 92554649,848 50302991,849 12963530,850 20939802,851 2781043,852 64617880,853 93688838,854 49966683,855 88814245,856 28854040,857 91841353,858 50966484,859 93071337,860 78803607,861 71789510,862 72878436,863 51682917,864 54254695,865 86679303,866 79271054,867 20438119,868 93512639,869 48181567,870 51931252,871 64045493,872 62438420,873 60428915,874 28226464,875 18386582,876 24251039,877 70947912,878 82042016,879 17755982,880 39633116,881 25249198,882 52091711,883 8568883,884 95687080,885 79421880,886 16162030,887 53819388,888 19345563,889 80026204,890 72839705,891 55593407,892 686738,893 52979100,894 81987670,895 78834224,896 46307534,897 45349996,898 85435677,899 69334276,900 55300459,901 58723591,902 7301758,903 58106964,904 99547338,905 9290339,906 58666975,907 73352372,908 98590278,909 93889185,910 55947324,911 41365636,912 2221915,913 45222938,914 24110459,915 44909091,916 2560629,917 66617777,918 10813887,919 3783514,920 19793212,921 4801700,922 65184690,923 6934821,924 75830541,925 59819824,926 7656119,927 55115907,928 48330243,929 13617800,930 46505314,931 29455269,932 57748588,933 35958169,934 40382866,935 78263394,936 32352447,937 42815089,938 12315577,939 46607531,940 16225743,941 61209398,942 94532683,943 70200161,944 26152348,945 27186430,946 33859384,947 10618828,948 63658267,949 24169064,950 72675784,951 49909270,952 63505972,953 15261895,954 10607878,955 19365852,956 71705694,957 41207893,958 29428040,959 25037556,960 52247031,961 10201288,962 95926353,963 38362152,964 25712746,965 30191927,966 49861180,967 9782445,968 96480366,969 65240254,970 52084570,971 90882099,972 82273708,973 43170000,974 24256108,975 15292925,976 37261889,977 56243614,978 82594275,979 62708598,980 12199769,981 26311049,982 69405510,983 40286546,984 71229547,985 76237946,986 59301382,987 36888888,988 37519842,989 19681115,990 67925498,991 75947906,992 36315542,993 816217,994 43825736,995 37424896,996 55609488,997 97494439,998 6031745,999 25652862,1000 45130470,1001 45285589,1002 27296595,1003 86943731,1004 25427262,1005 41938611,1006 44975764,1007 16517987,1008 52554922,1009 60678321,1010 72173747,1011 9656839,1012 27733482,1013 62787742,1014 76387702,1015 99453598,1016 92663965,1017 47836753,1018 46258643,1019 53806642,1020 10450254,1021 83285693,1022 41692230,1023 30347296,1024 58634347,1025 91146864,1026 36786912,1027 14880061,1028 27364234,1029 94920689,1030 29178487,1031 6458605,1032 75395835,1033 75416364,1034 42063723,1035 4387973,1036 92653599,1037 40791605,1038 25130810,1039 27460835,1040 37595794,1041 86462982,1042 78278921,1043 52873404,1044 50048968,1045 74656396,1046 64358855,1047 37337231,1048 87901917,1049 5468751,1050 55122603,1051 9324892,1052 27594984,1053 2960160,1054 6233851,1055 58654235,1056 3936117,1057 35250532,1058 53404241,1059 7468500,1060 59662122,1061 50814903,1062 24026541,1063 70717162,1064 62503111,1065 90556239,1066 75435481,1067 98343759,1068 76468955,1069 55992497,1070 3504534,1071 99404359,1072 50575787,1073 8180631,1074 82306192,1075 50504153,1076 69320596,1077 97140502,1078 39000250,1079 30185641,1080 57060332,1081 17711355,1082 41065471,1083 13885281,1084 33452123,1085 75987474,1086 28503047,1087 28033096,1088 49175519,1089 26562653,1090 32133038,1091 81357884,1092 77770283,1093 30889846,1094 40220747,1095 46790056,1096 97875555,1097 22756228,1098 78080052,1099 14237830,1100 96455658,1101 91403481,1102 13022126,1103 53194436,1104 8845376,1105 71981252,1106 51724134,1107 23262057,1108 23911183,1109 71035426,1110 45722160,1111 73319957,1112 51091091,1113 15448319,1114 27538677,1115 87702060,1116 3759748,1117 85358291,1118 7341851,1119 47416344,1120 94738489,1121 4433450,1122 72269100,1123 83225608,1124 201055,1125 57592616,1126 20078392,1127 41279169,1128 7408540,1129 9841237,1130 40273254,1131 51293801,1132 963349,1133 85149500,1134 8686643,1135 69231227,1136 26698074,1137 99138810,1138 7950727,1139 52359298,1140 20892968,1141 55019101,1142 44740135,1143 94499600,1144 2414969,1145 65055240,1146 86086711,1147 57188038,1148 68614288,1149 32014195,1150 61735696,1151 82457021,1152 37304659,1153 8161251,1154 14910288,1155 58730570,1156 47460528,1157 76672052,1158 46425031,1159 69302348,1160 83219026,1161 79081044,1162 99128136,1163 26991957,1164 56740422,1165 1271495,1166 13415173,1167 27917861,1168 47830534,1169 69358791,1170 6708853,1171 66163479,1172 56844462,1173 18438760,1174 11245054,1175 69064974,1176 52561416,1177 96619949,1178 67617639,1179 71231836,1180 43772298,1181 91273535,1182 89942422,1183 40254169,1184 97578960,1185 44127519,1186 69366824,1187 96887032,1188 56440830,1189 35791587,1190 75851655,1191 27958851,1192 28181623,1193 40225790,1194 93136849,1195 268251,1196 87085996,1197 23742881,1198 11802449,1199 27982297,1200 85381817,