Moen Interview Question

The question was a fun puzzle.