Skip to content

Commit

Permalink
Fixed concatenation issue with printing the enclosing path distance.
Browse files Browse the repository at this point in the history
  • Loading branch information
iancaffey committed Dec 8, 2016
1 parent 84b6aa3 commit d17e127
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kotlin/greedy/TravelingSalesman.kt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fun solve(nodes: List<Triple<Int, Int, Int>>) {
path.add(nearest.second)
unvisited.remove(nearest.second)
}
println("Distance: " + distance + distance(start, path.last()))
println("Distance: " + (distance + distance(start, path.last())))
path.forEach { println(it.first) }
println(-1)
}
Expand Down

0 comments on commit d17e127

Please sign in to comment.