WA Doubt In TRAVELER

[My Solution] (CodeChef: Practical coding for everyone)
From what I understand of the problem:

  1. Check if the cities are valid
  2. Check if the paths are valid
  3. Check for distinct cities
    I believe I have done the following and am unable to understand the reason for the WA. I found similar logic in other users’ solutions.