= minimum cost to visit exactly the cities in mask, ending at city last. Base case: . You start at city , having visited only city , with zero travel cost.
The mask means only bit is set. Goal: Visit all cities (mask ), then return to city . The answer is . You check all possible final cities and add the return flight cost.