Bellman Ford Algorithm

Given a graph with n vertices and weighted edges, find the shortest distance from source to all other vertices using Bellman-Ford algorithm.

Examples
Input: [3,[[0,1,2],[1,2,3],[0,2,5]],0]
Output: [0,2,5]
Hints

Bellman Ford Algorithm

Given a graph with n vertices and weighted edges, find the shortest distance from source to all other vertices using Bellman-Ford algorithm.