Minimum Absolute Difference in an Array

  • + 0 comments
    def minimumAbsoluteDifference(arr):
        # Write your code here
        s = sorted(arr)
        return min([abs(s[i] - s[i - 1]) for i in range(1, len(s))])