What was you approach to solve Chefina and a Trip(CHEFTRIP)?
Problem link - link contest link - link
Reference to the editorial: