In the toy problem described by I Failed a Twitter Interview, we are given a list of integers
3, 2, 1, 4, 2
representing the heights of walls
3 2 1 4 2
and we imagine pouring water onto this structure such that puddles accumulate in the gaps.
We are then asked: How much water is held by the structure? (In the above example, the answer is 3).
Monoids
I find mys…
Keep reading with a 7-day free trial
Subscribe to Type Classes to keep reading this post and get 7 days of free access to the full post archives.