369. Vertices With No Edges
A vertex is isolated when no edge touches it. Print how many isolated vertices the graph has.
An isolated vertex is a component all by itself, which is why it is easy to miss: nothing in the edge list ever mentions it. A solution that walks the edges and never looks at the vertex range will report 0 every time.
This is the same degree array as problem 368, read differently.
Constraints - `1 ≤ n ≤ 100000` - `0 ≤ m ≤ 200000` - There are no self-loops and no repeated edges.
Input
The first line contains two integers n and m, the number of vertices and
edges. Each of the next m lines contains two integers u and v, an
undirected edge between those vertices. Vertices are numbered 1 to n.
Output
Print one integer, the number of isolated vertices.
Hints
Four rungs, in order. The last two open once you have submitted an attempt. A wrong one counts.