Pergunta de entrevista da empresa Capital One

Justify using one data structure over the other for this problem.