Cummins interview question

How to overcome problem?