Pergunta de entrevista da empresa Coolblue

Complete a function to generate the expected outcome (functional programming using reduce() and other JS functions)