summary refs log tree commit diff stats
path: root/solutions/day6.fs
diff options
context:
space:
mode:
Diffstat (limited to 'solutions/day6.fs')
-rw-r--r--solutions/day6.fs28
1 files changed, 13 insertions, 15 deletions
diff --git a/solutions/day6.fs b/solutions/day6.fs
index bb83388..fb2d451 100644
--- a/solutions/day6.fs
+++ b/solutions/day6.fs
@@ -1,20 +1,18 @@
-namespace Solutions
+module Solutions.Day6
+open System.IO
 
-module Day6 =
-    open System.IO
+let buf = File.ReadAllText("inputs/day6.txt")
 
-    let buf = File.ReadAllText("inputs/day6.txt")
-
-    let rec scan size str index =
-        if String.length str < size then -1
+let rec scan size str index =
+    if String.length str < size then -1
+    else
+        let current = str[..size - 1] |> Set.ofSeq
+        if Set.count current = size then index + size
         else
-            let current = str[..size - 1] |> Set.ofSeq
-            if Set.count current = size then index + size
-            else
-                scan size str[1..] index + 1
+            scan size str[1..] index + 1
 
-    let part1 () =
-        scan 4 buf 0
+let part1 () =
+    scan 4 buf 0
 
-    let part2 () =
-        scan 14 buf 0
\ No newline at end of file
+let part2 () =
+    scan 14 buf 0
\ No newline at end of file