Minimum increments by index value required to obtain at least two equal Array elements | Function to calculate the minimum number of steps required ; Stores minimum difference ; Driver Code
def incrementCount ( arr , N ) : NEW_LINE INDENT mini = arr [ 0 ] - arr [ 1 ] NEW_LINE for i in range ( 2 , N ) : NEW_LINE INDENT mini = min ( mini , arr [ i - 1 ] - arr [ i ] ) NEW_LINE DEDENT print ( mini ) NEW_LINE DEDENT N = 3 NEW_LINE arr = [ 12 , 8 , 4 ] NEW_LINE incrementCount ( arr , N ) NEW_LINE