Problem statement

https://binarysearch.com/problems/Making-List-Values-Equal/

Solution

Number of steps is maximum numbers minus minimum number.

Complexity

It is O(n) for time and O(1) for space.

Code

class Solution:
    def solve(self, nums):
        return max(nums) - min(nums)