Hello @amanb25, may be you are getting confused in the indexing. In the question we have been given the statement and the conditions considering the city from 1 and while coding we have shifted the city and instead of starting from 1 we are starting from 0. So you can say that city 1 is now city 0, city 2 is now city 1, city 3 is now city 2, city 4 is now city 3 and so on.
So here the logic in the code is absolutely right.
I hope you were confused with the indexing here we have 4 cities 0,1,2,3.
So do the ques accordingly and the main aim of shifting the city nos. is the array indexing starts from 0 and hence we started with state 0.
Pls feel free to ask if you have any other issues or the confusion.