-
-
Save mathias-brandewinder/d410214d2a7b1d5eb301 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open System | |
let readInt () = Console.In.ReadLine() |> int | |
let N = readInt () | |
let readline = [ for i in 0 .. N - 1 -> readInt () ] | |
let minimumBetweenTwoNumbers n1 n2 = min n1 n2 | |
let rec minimum data mini = | |
match data with | |
| first::second::tail -> | |
let min = (first-second) |> abs |> minimumBetweenTwoNumbers mini | |
match tail with | |
| [] -> min | |
| _ -> minimum (second::tail) min | |
let compute = | |
minimum readline 10000000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment