Company: Josh Technology
Difficulty: medium
Stabilize the Skyline Welcome to the city of Numoria, where every building\'s height is recorded in the array nums. Your mission is to stabilize the skyline! In one move, you must demolish any tower that is shorter than the one before it. Specifically, for every tower at position i (where 0 Given an array nums, return the number of steps performed to make the skyline stable. Examples Example 1: Input: nums = [5,3,4,4,7,3,6,11,8,5,11] Output: 3 Explanation: The following are the steps performed: Step 1: [5,3,4,4,7,3,6,11,8,5,11] becomes [5,4,4,7,6,11,11] Step 2: [5,4,4,7,6,11,11] becomes [5,4,7,11,11] Step 3: [5,4,7,11,11] becomes [5,7,11,11] [5,7,11,11] is a non-decreasing array. Therefore, we return 3. Example 2: Input: nums = [10,1,2,9,1,2,3,4] Output: 4 Constraints: 1 ≤ nums[i] ≤ 10 9 No library functions should be used, except for basic ones like min, max, etc. Pass-by reference and global variables are not allowed Time Complexity: O(N) Space Complexity: O(N) Code Template: #includ