Simulate the Process | Python | Beginner friendly| My Notes
\n#base case\nif len(nums)==1:\n            return nums[0]\n\n#as long as my length doesn\'t become 1, I repeat the process\nwhile len(nums)!=1:\n\t#we take a n
```\n#base case\nif len(nums)==1:\n            return nums[0]\n\n#as long as my length doesn\'t become 1, I repeat the process\nwhile len(nums)!=1:\n\t#we take a newnums everytime of size n//2\n\tnewnums = [-1]*(len(nums)//2)\n\tfor i in range(0,len(nums)//2):\n\t\tif i%2==0:\n\t\t\tnewnums[i] = min(nums[2 * i], nums[2 * i + 1])\n\t\telse:\n\t\t\tnewnums[i] = max(nums[2 * i], nums[2 * i + 1])\n\t#add the newarray to the older one.\n\tnums = newnums\n\nreturn nums[0]\n```
['Simulation', 'Python']