Pergunta de entrevista da empresa Walmart Global Tech

they had a puzzle question at the end