Day 8 of #AdventOfCode: part 1 one took me a long time and I almost gave up on #gleam but I slept on it and got it working this morning.
Since Gleam only has a List type that is not optimised for index based access I implemented part 1 in a way that does not index into it and also pre-calculates the max values in each direction to avoid having to make repeated scans in all four directions.
When it came to part 2 I just did the index based scanning thing and it was a lot quicker to write and also still ran in well under half a second so definitely a case of premature optimisation on part 1.