Ameex interview question

how will solve the issue