Practice Minimum Number Game
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
While nums is nonempty, Alice removes its smallest value, then Bob removes the smallest remaining value. Append Bob's removed value to arr first, followed by Alice's. The input has even length. Return arr after all rounds.
Source: Minimum Number Game on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
Input
nums = [5,4,2,3]
Output
[3,2,5,4]
# Example 2
Input
nums = [2,5]
Output
[5,2]
Constraints
2 <= nums.length <= 100
1 <= nums[i] <= 100
nums.length % 2 == 0
Related LeetCode Problems
Practice more problems similar to Minimum Number Game.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.