Function to find the minimum absolute value of ( K - arr [ i ] ) for each possible value of K over the range [ 0 , N - 1 ] |
def minimumDistance ( arr , N ) : NEW_LINE INDENT ind = 0 ; NEW_LINE prev = arr [ ind ] ; NEW_LINE s = len ( arr ) ; NEW_LINE DEDENT