using namespace std;

class Node

{

```
public :
int node;
int delay;
Node()
{
this->node = 0;
this->delay = 0;
}
Node(int delay , int node)
{
this->delay = delay;
this->node = node;
}
```

};

class comp

{

```
public:
bool operator()( Node &a ,Node &b)
{
if(a.delay > b.delay)
{
return true;
}
return false;
}
```

};

int networkDelayTime(int N ,vector<vector>& times, int K)

```
{
priority_queue<Node,vector<Node>,comp> minHeap;
vector<vector<int>> graph(N,vector<int>(N,-1));
vector<int> distance(N,1e9);
for(auto &edge : times)
{
graph[edge[0]-1][edge[1]-1] = edge[2];
}
minHeap.push(Node(0,K-1));
distance[K-1] = 0;
int maxDelay = -1;
while(!minHeap.empty())
{
Node current = minHeap.top();
minHeap.pop();
int currentDelay = current.delay;
int currentNode = current.node;
for(int neigh = 0 ; neigh<N; neigh++)
{
if(graph[currentNode][neigh]!=-1)
{
if(graph[currentNode][neigh]+currentDelay < distance[neigh])
{
distance[neigh] = graph[currentNode][neigh]+currentDelay;
minHeap.push(Node(distance[neigh],neigh));
}
}
}
}
for(auto &it : distance)
{
if(it == 1e9)
{
return -1;
}
maxDelay = max(maxDelay,it);
}
return maxDelay;
}
```

int main()

{

```
int nodes, source, e;
cin>>nodes>>e;
vector<vector<int>>edges(e);
for (int i = 0; i < e; i++)
{
int u,v,t;
cin>>u>>v>>t;
edges[i].push_back(u);
edges[i].push_back(v);
edges[i].push_back(t);
}
cin>>source;
int ans = networkDelayTime(nodes,edges,source);
cout<<ans;
```

}

This is my code It got pass at Leetcode but It didn’t passed in Platform . Pls help me out.