Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
https://github.com/0xmycf/Advent-of-code/blob/main/2022/aoc22/src/Days/Day08.hs I parsed the grid as Map (V2 Int) Int and padded the grid with values of -1. I then used unfoldr with Map.lookup to get all 4 ways for a specific tree. In part A I simply filtered all trees out where the given predicate wasn't fulfilled. In part B I used a modified takeWhile function to take all trees which are smaller + one more than the current tree. I also had to get rid of the -1.
Code for the day, with parsing and extra utilities located in src/Util/