A fun algorithm challenge