Describe your approach to solving the Traveling Salesman Problem in a resource-constrained environment.
Implement an exact solver for a complete directed graph. Given an n x n cost matrix, return the minimum cost of a tour that starts at city 0, visits every city exactly once, and returns to city 0. Use a bitmask dynamic programming approach suitable for n <= 20.
Function: tsp_min_cost(distances) Input is a square matrix of nonnegative numbers. Return a number.
def tsp_min_cost(distances):