Skip to content

Commit c22a253

Browse files
committed
Runtime: 105 ms (Top 27.62%) | Memory: 42 MB (Top 97.79%)
1 parent 8f3fd2f commit c22a253

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
// Runtime: 105 ms (Top 27.62%) | Memory: 42 MB (Top 97.79%)
12
var minMaxGame = function(nums) {
23
while (nums.length > 1) {
34
let half = nums.length / 2;
45
for (let i = 0; i < half; i++)
56
nums[i] = i % 2 === 0 ? Math.min(nums[2 * i], nums[2 * i + 1]) : Math.max(nums[2 * i], nums[2 * i + 1]);
6-
7+
78
nums.length = half;
89
}
9-
10+
1011
return nums[0];
11-
};
12+
};

0 commit comments

Comments
 (0)