You are viewing a single comment's thread. Return to all comments →
Swift
func minimumAbsoluteDifference(arr: [Int]) -> Int { var value = Int.max let list = arr.sorted() for i in 0..<arr.count-1 { value = min( value, abs( list[i] - list[i+1] )) } return value }
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 →
Swift