KPMG interview question

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