Given a matrix cost of size n where cost[i][j] denotes the cost of moving from city i to city j. Your task is to complete a tour from the city 0 (0 based index) to all other cities such that you visit each city atmost once and then at the end come back to city 0 in min cost.
- Time : O(2^n * n^2)
- Space : O(n * 2^n)
c++
1 | class Solution { |