The hack of the question is -
If there are 6 vertices, then for the graph to remain connected, atleast 5 edges are required (Minimum Spanning tree). And so if we have only 4 edges and 6 vertices then Graph is always going to be disconnected.
In the question, there are 10 edges given. To reduce the number of edges to 4, we need to remove 6 edges.
Hence, 6 is the answer.