Implementation with Dijkstra

Inverted paths and calculating Dijkstra from end.. Somehow still WA...