Cummins interview question

see description