Cummins interview question

Not difficult