mirror of
https://github.com/Smaug123/mystery-hunt-2023-reactivation
synced 2025-10-05 12:48:39 +00:00
17 lines
401 B
Forth
17 lines
401 B
Forth
namespace Solve
|
|
|
|
[<RequireQualifiedAccess>]
|
|
module Seq =
|
|
|
|
let range (s : int seq) : int =
|
|
use e = s.GetEnumerator ()
|
|
if not (e.MoveNext ()) then 0 else
|
|
|
|
let mutable min = e.Current
|
|
let mutable max = e.Current
|
|
while e.MoveNext () do
|
|
if e.Current < min then min <- e.Current
|
|
if e.Current > max then max <- e.Current
|
|
max - min
|
|
|