Added Solution to #21

I ♥ functools