File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 11import gleam/bool
22import gleam/int
3- import gleam/io
43import gleam/list
54import gleam/string
5+ import pocket_watch
66import rememo/memo
77
88pub type Input {
99 Input ( towels : List ( String ) , patterns : List ( String ) )
1010}
1111
1212pub fn parse ( input : String ) -> Input {
13+ use <- pocket_watch . simple ( "parse" )
1314 case string . split ( input , "\n \n " ) {
1415 [ towels_str , patterns_str ] -> {
1516 Input (
@@ -22,6 +23,7 @@ pub fn parse(input: String) -> Input {
2223}
2324
2425pub fn pt_1 ( input : Input ) {
26+ use <- pocket_watch . simple ( "part 1" )
2527 input . patterns
2628 |> list . count ( pt_1_possible ( input . towels , _) )
2729}
@@ -51,6 +53,7 @@ fn pt_1_possible_aux(towels: List(String), todos: List(String)) -> Bool {
5153}
5254
5355pub fn pt_2 ( input : Input ) {
56+ use <- pocket_watch . simple ( "part 2" )
5457 use cache <- memo . create ( )
5558 input . patterns
5659 |> list . map ( pt_2_all ( input . towels , _, cache ) )
You can’t perform that action at this time.
0 commit comments