IMEC (Belgium) interview question

most difficult task I have done