O(n^2) solution to Traveling Salesperson