Getting NZEC in SPATH SPOJ.

dijkstra
graph
greedy
nzec

#1

This is MY SOLUTION for the problem SPATH, I don’t know why I am getting NZEC, anyone please help me to figure out what is wrong with my code.


#2

You cannot create arrays of parameterized types.

Try replacing

`static List<Pair> adj[] = new List[10002];`

with

static List<List<Pair>> adj = new ArrayList<>();

and if you are using The Class List Please import all of its methods as well.

Check more here


#3

@rds_98

If this was the case them my code should not even work locally.


#4

@vijju123

can you take a look at this.