You are viewing a single comment's thread. Return to all comments →
My Python3 solution:
return min([abs(arr[counter+1] - arr[counter]) for counter in range(len(arr)-1)])
I'm not really sure how it works, but if you sort the data structure, finding the minimum is all about comparing consectutive indexes to each other instead of to every index. After this, we do our usual absolute value and minimum value.