I tried a greedy solution forthis problem:
if there exist a pair of adjacent vertices like (u,v) such that deg(u)>=3 and deg(v)>=3, then remove the edge between u and v.
Then, if there exist a pair of adjacent vertices like (u,v) such that deg(u)>=3 and deg(v)>=2, then remove the edge between u and v.
Then, if there exist a pair of adjacent vertices like (u,v) such that deg(u)>=3 and deg(v)>=1, then remove the edge between u and v.
At last, I add edges between the leaves of different components .
Why it is not correct??
submission