You are given a nums whose length is a power of
Apply the following algorithm on nums:
If the length of nums is equal to nums[
Create a new newNums of length nums.length
For every even index i where i nums.length newNums[i] nums[i], nums[i
For every odd index i where i nums.length newNums[i] nums[i], nums[i
Replace the array nums with newNums.
Repeat the entire process from step
Return the final remaining value in nums after applying the algorithm.
Constraints:
nums.length
nums[i]
nums.length is a power of
You are given a nums whose length is a power of
Apply the following algorithm on nums:
If the length of nums is equal to nums[
Create a new newNums of length nums.length
For every even index i where i nums.length newNums[i] nums[i], nums[i
For every odd index i where i nums.length newNums[i] nums[i], nums[i
Replace the array nums with newNums.
Repeat the entire process from step
Return the final remaining value in nums after applying the algorithm.
Constraints:
nums.length
nums[i]
nums.length is a power of