Implementing Dijkstra Algorithm Leetcode