Cummins interview question

solve problem with creativity