Compute rainwater accumulation on a height grid | Chalk Interview Question