Fleetworks interview question

Algorithm problem solving which is reasonable