FPEvalDataset/LeetCodeProblem
0304
1{2 "id": 2386,3 "name": "min_max_game",4 "difficulty": "Easy",5 "link": "https://leetcode.com/problems/min-max-game/",6 "date": "2022-05-29 00:00:00",7 "task_description": "You are given a **0-indexed** integer array `nums` whose length is a power of `2`. Apply the following algorithm on `nums`: Let `n` be the length of `nums`. If `n == 1`, **end** the process. Otherwise, **create** a new **0-indexed** integer array `newNums` of length `n / 2`. For every **even** index `i` where `0 <= i < n / 2`, **assign** the value of `newNums[i]` as `min(nums[2 * i], nums[2 * i + 1])`. For every **odd** index `i` where `0 <= i < n / 2`, **assign** the value of `newNums[i]` as `max(nums[2 * i], nums[2 * i + 1])`. **Replace** the array `nums` with `newNums`. **Repeat** the entire process starting from step 1. Return _the last number that remains in _`nums`_ after applying the algorithm._ **Example 1:** ``` **Input:** nums = [1,3,5,2,4,8,2,2] **Output:** 1 **Explanation:** The following arrays are the results of applying the algorithm repeatedly. First: nums = [1,5,4,2] Second: nums = [1,4] Third: nums = [1] 1 is the last remaining number, so we return 1. ``` **Example 2:** ``` **Input:** nums = [3] **Output:** 3 **Explanation:** 3 is already the last remaining number, so we return 3. ``` **Constraints:** `1 <= nums.length <= 1024` `1 <= nums[i] <= 109` `nums.length` is a power of `2`.",8 "public_test_cases": [9 {10 "label": "Example 1",11 "input": "nums = [1,3,5,2,4,8,2,2]",12 "output": "1 "13 },14 {15 "label": "Example 2",16 "input": "nums = [3]",17 "output": "3 "18 }19 ],20 "private_test_cases": [21 {22 "input": [23 115040532,24 691122985,25 74905644,26 691122985,27 74905644,28 488737920,29 409049507,30 691122985,31 74905644,32 424016316,33 139550887,34 488737920,35 409049507,36 778486804,37 581936863,38 691122985,39 74905644,40 898320970,41 424016316,42 316332152,43 322747948,44 139550887,45 10127500,46 488737920,47 409049507,48 714000633,49 529661213,50 778486804,51 581936863,52 766268468,53 256616097,54 691122985,55 893168349,56 74905644,57 898320970,58 562091841,59 623374598,60 424016316,61 316332152,62 175024652,63 322747948,64 421471664,65 139550887,66 27323869,67 10127500,68 285386703,69 54510532,70 488737920,71 920450369,72 409049507,73 714000633,74 376483632,75 529661213,76 689244382,77 749711836,78 778486804,79 581936863,80 952610726,81 46933645,82 766268468,83 256616097,84 930245976,85 109029077,86 69112298587 ],88 "output": 11504053289 },90 {91 "input": [92 422752264,93 444626536,94 383451709,95 444626536,96 964694290,97 383451709,98 444626536,99 354937044100 ],101 "output": 422752264102 },103 {104 "input": [105 347432181,106 347432181,107 347432181,108 253225415109 ],110 "output": 347432181111 },112 {113 "input": [114 277872296,115 945927896,116 351536846,117 945927896,118 351536846,119 505308252,120 355276338,121 945927896,122 351536846,123 740924939,124 38550376,125 505308252,126 355276338,127 720623023,128 50265300,129 945927896,130 351536846,131 818710986,132 268024035,133 740924939,134 38550376,135 917469833,136 218828997,137 505308252,138 355276338,139 675186659,140 272427923,141 720623023,142 50265300,143 349134637,144 197930247,145 945927896,146 351536846,147 933128750,148 89429569,149 818710986,150 268024035,151 630711263,152 740924939,153 442693871,154 38550376,155 987228952,156 110075355,157 917469833,158 218828997,159 825822362,160 168084080,161 505308252,162 355276338,163 930388442,164 188207825,165 675186659,166 272427923,167 816044008,168 613681487,169 720623023,170 50265300,171 918806830,172 349134637,173 278273618,174 197930247,175 846327293,176 114080947,177 945927896,178 351536846,179 962339954,180 153247899,181 933128750,182 89429569,183 949890359,184 736501846,185 818710986,186 268024035,187 936649815,188 630711263,189 623451241,190 740924939,191 784006358,192 364968461,193 442693871,194 38550376,195 827637389,196 775002894,197 987228952,198 110075355,199 898363618,200 496412781,201 917469833,202 218828997,203 775423695,204 299108265,205 825822362,206 168084080,207 655056704,208 55736741,209 505308252,210 355276338,211 822549513,212 165382074,213 930388442,214 188207825,215 623202735,216 97039735,217 675186659,218 272427923,219 899139750,220 58820112,221 816044008,222 613681487,223 692107265,224 446140510,225 720623023,226 50265300,227 786653476,228 631607382,229 918806830,230 738179041,231 349134637,232 3081800,233 278273618,234 197930247,235 814391196,236 846327293,237 839751160,238 114080947,239 766307757,240 394016082,241 945927896,242 842046573,243 351536846,244 581539229,245 962339954,246 153247899,247 893052643,248 933128750,249 886264387,250 237453609,251 89429569,252 168548190,253 949890359,254 736501846,255 874536926,256 390388306,257 818710986,258 268024035,259 930890158,260 936649815,261 787292160,262 630711263,263 790680442,264 623451241,265 528577751,266 757668896,267 740924939,268 540340338,269 784006358,270 364968461,271 634924643,272 442693871,273 402084206,274 38550376,275 50388559,276 486527953,277 827637389,278 889740846,279 775002894,280 987228952,281 711758512,282 110075355,283 554558129,284 898363618,285 430338156,286 855273022,287 496412781,288 917469833,289 513275787,290 287567580,291 218828997,292 775423695,293 544183099,294 960564854,295 299108265,296 403334797,297 825822362,298 168084080,299 420433761,300 257316455,301 655056704,302 614047974,303 55736741,304 55437983,305 505308252,306 355276338,307 829117431,308 425539800,309 822549513,310 473149306,311 165382074,312 930388442,313 219356010,314 188207825,315 221601673,316 339915824,317 623202735,318 97039735,319 643265311,320 675186659,321 302235312,322 801212847,323 272427923,324 899139750,325 473530827,326 701114055,327 58820112,328 103017505,329 816044008,330 613681487,331 819740209,332 623887143,333 692107265,334 446140510,335 818007276,336 45103587,337 720623023,338 50265300,339 236708934,340 646052908,341 786653476,342 631607382,343 943759801,344 918806830,345 256451102,346 738179041,347 798967010,348 56615261,349 349134637,350 3081800,351 585996046,352 278273618,353 187195679,354 365793711,355 197930247,356 814391196,357 1711047,358 846327293,359 989073716,360 454322636,361 839751160,362 803562099,363 114080947,364 656466739,365 766307757,366 829671791,367 394016082,368 945927896,369 556552137370 ],371 "output": 277872296372 },373 {374 "input": [375 439363306,376 983086361,377 18639521,378 983086361,379 18639521,380 926360015,381 429073836,382 983086361,383 18639521,384 618347797,385 331389171,386 926360015,387 429073836,388 823614485,389 206463919,390 983086361,391 18639521,392 551614501,393 528697263,394 618347797,395 729566617,396 331389171,397 806609119,398 926360015,399 429073836,400 906955449,401 28743328,402 823614485,403 575701114,404 206463919,405 430845510,406 983086361,407 18639521,408 476762353,409 551614501,410 483033277,411 528697263,412 757187572,413 618347797,414 289394534,415 930884662,416 729566617,417 331389171,418 248606565,419 828364048,420 806609119,421 104101301,422 926360015,423 586131558,424 429073836,425 124381100,426 906955449,427 871344524,428 28743328,429 372630435,430 823614485,431 575701114,432 898787203,433 206463919,434 11428664,435 430845510,436 479380797,437 101634865,438 983086361439 ],440 "output": 439363306441 }442 ],443 "haskell_template": "minMaxGame :: [Int] -> Int\nminMaxGame nums ",444 "ocaml_template": "let minMaxGame (nums: int list) : int = ",445 "scala_template": "def minMaxGame(nums: List[Int]): Int = { \n \n}",446 "java_template": "class Solution {\n public int minMaxGame(int[] nums) {\n \n }\n}",447 "python_template": "class Solution(object):\n def minMaxGame(self, nums):\n \"\"\"\n :type nums: List[int]\n :rtype: int\n \"\"\"\n "448}