Solutions to ++, flatten, flatmap