My logic is to find the no of connected component and divide them by 2 and use ceil function if total_component != 1 else print 0.If total component is 3 then my output will be 2.
If my logic is correct whats wrong with my code.pls explain
Is my logic correct?
I didnt understand the logic behind counting total no of odd degree vertices in a connected component
@vishal23rfx
So each odd component requires you to add a line segment to it considering each vertex in a euler path needs to have even degree
Why the answer is maximum of no of components and no of pairs of odd degree verices?
@vishal23rfx
In case there are connected components than the odd edges in graph
In that case if you take only t-1 / 2 you’ll end up joining odd degree components but leave the even degree ones as is leaving the graph unconnected