Someone solved this in 7 rows. Your turn.

Mystery Function