diff --git a/day11.ml b/day11.ml index 2a13c9e..fe1da14 100644 --- a/day11.ml +++ b/day11.ml @@ -74,19 +74,10 @@ let change_seats is_far l = ) ) l -let hash = Hashtbl.create 1000 - -let grid_equal g1 g2 = (* abusing hash but not a drug problem *) - match Hashtbl.find_opt hash g2 with - | Some _ -> true - | None -> - let _ = Hashtbl.add hash g2 0 in - false - let rec start is_far grid = (* keep changing seats until the grid stops changing *) (* print_grid grid; *) let grid' = change_seats is_far grid in - if grid_equal grid grid' + if grid = grid' then grid' else start is_far grid'