Remember these three things to avoid getting caught in errors and losing scores

  1. E contains undirected edge.
  2. B contains directed edge.
  3. E[i][0] or E[i][1] can be greater than A.


No both E and B contains undirected edges


It’s already given in the problem statement that B contains directed edges.
“All roads are one way ie they go from B[i][0] to B[i][1].”