Help-RoadTrip

I was solving the Roadtrip
and got WA in couple of test cases in this code.