You are given an integer array nums. In a single step, remove every element nums[i] for which nums[i - 1] > nums[i] holds, where nums.length. All such removals in a step occur simultaneously.
Repeat this process until the array becomes non decreasing.
Return the number of steps required to make nums non decreasing.
Constraints:
nums.length
nums[i]
You are given an integer array nums. In a single step, remove every element nums[i] for which nums[i - 1] > nums[i] holds, where nums.length. All such removals in a step occur simultaneously.
Repeat this process until the array becomes non decreasing.
Return the number of steps required to make nums non decreasing.
Constraints:
nums.length
nums[i]