I tried a greedy solution for this problem:
1. If there exist a pair of adjacent vertices like $$$(u,v)$$$ such that $$$deg(u)\geq3$$$ and $$$deg(v)\geq3$$$, then remove the edge between $$$u$$$ and $$$v$$$.
2. Then, if there exist a pair of adjacent vertices like $$$(u,v)$$$ such that $$$deg(u)\geq3$$$ and $$$deg(v)\geq2$$$, then remove the edge between $$$u$$$ and $$$v$$$.
3. Then, if there exist a pair of adjacent vertices like $$$(u,v)$$$ such that $$$deg(u)\geq3$$$ and $$$deg(v)\geq1$$$, then remove the edge between $$$u$$$ and $$$v$$$.
At last, I add edges between the leaves of different components .
Why isn't it correct??
submission