You are viewing a single comment's thread. Return to all comments →
Python 3
def minimum_absolute_difference(arr): n = len(arr) arr = sorted(arr) r = [] for i in range(n-1): r.append(abs(arr[i]-arr[i+1])) return min(r)
Seems like cookies are disabled on this browser, please enable them to open this website
Minimum Absolute Difference in an Array
You are viewing a single comment's thread. Return to all comments →
Python 3