I would appreciate feedback again this time. This program seems similar to the first one in many ways; I probably could have applied set intersection as Ian did in his solution to the other program but using
select/3 made more sense to me. I have also applied Alan’s feedback about formatting, and I think it looks better.
Thanks for your time!