Reksoft interview question

They just told me solve the coding problem