write spec and solution