Cool puzzle, finally pass all the tests with BFS.
I used A* which is a generalised Dijkstra. No problem, even in a slow language like Python.
BFS is sufficient to pass all tests.Basically, here's what I did:Look for closest '?' and proceed in that manner.If 'C' is found try to go to 'C' (in case there's no path, go to the '?')Once you've reached 'C' use BFS to reach 'T' fastest