educative.io

Educative

I don't understand the second traveling salesman solution

What are TSPrecursive check index and end?

TSPrecursive is a helper function. We create a tuple of two things: a set of visited cities and the last city visited. check is a dictionary to keep track of the visited cities. end is used for the last city visited (the way start is used for start city in the previous solution). index is just an iterator for the cities.