Sollicitatievraag bij Flatiron Health

How would you approach this problem using R?