This is a coding problem I was given by a company.