Although it is a simple question,But there are recursive ideas。
Constantly convert the one -dimensional list into a two -dimensional list for operation(This can be avoidedindexChaos caused by changes)
Then useflagCount,Comparison of maximum and minimum values。
Just return to the end,Although it must be returned to a number,Still‘nums[0]’To avoid warning。
1 | 2293. Great mini game |
1 | class Solution: |