Pergunta de entrevista da empresa KPMG

How would you code a given problem using R or Python?