You are viewing a single comment's thread. Return to all comments →
Haskell
module Main where import Data.List (sort) solve :: [Integer] -> Integer solve = minimum . map abs . (zipWith (-) <*> tail) . sort main :: IO () main = getLine >> getLine >>= print . solve . map read . words
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 →
Haskell