Mubashir needs your help to equalize (make all list elements the same) a list.
Create a function that takes a list of integers lst and a constant c and returns minimum number of operations required to equalize the given list.
x to equalize the given list.clst = [1, 2, 2, 1, 2, 1, 2, 2, 2, 1, 1, 1], c = 2
equalize(lst, c) β 4
You have chosen x = 1 (change all values of the list to 1)
[1, 2, 2, 1, 2, 1, 2, 2, 2, 1, 1, 1]
[1, 1, 1, 1, 2, 1, 2, 2, 2, 1, 1, 1] -> Step 1
[1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1] -> Step 2
[1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1] -> Step 3
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1] -> Step 4
N/A