Skip to content

Instantly share code, notes, and snippets.

View mathias-brandewinder's full-sized avatar

Mathias Brandewinder mathias-brandewinder

View GitHub Profile
#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 =
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
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 =