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
#r "/home/you/src/thisthing/lib/JSONNet/Newtonsoft.Json.dll" | |
open System | |
open System.Collections.Generic // for dictionary | |
open Newtonsoft.Json | |
// Identifier type | |
type Id = System.Guid | |
module EventStore = |
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
let rec minimum data mini = | |
match data with | |
| first::second::tail -> | |
let min = abs (first - second) |> minimumBetweenTwoNumbers mini | |
match tail with | |
| [] -> min | |
| _ -> minimum second::tail min |
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 = |