Genapsys interview question

an analytical /algorithm question about , and asked to break it down and solve it