Pergunta de entrevista da empresa General Motors (GM)

Coding challenge. Was two coding challenge problem leetcode ez