Help in debugging Lottery Money (Innerve summer code challenge)

Hello,

I thought that I had solved this problem correctly. But it is giving WA.
I knew kadane’s algorithm which I modified to solve this question.
I think I am missing some corner case or I have missed something stated in the question.

Here is the link to the problem.
Here is the link to my submission

Feedback will be appreciated.
Also will there be editorials posted for this contest?

They didn’t mention the tie breaking condition in the question statement. If there are multiple paths of the same number of cities, then choose the path where you spend MORE money. It’s not intuitive either.

Here is my code.

These things should be mentioned in the problem statement. Thank you. How does one earn reputation points so that I can upvote your answer?