TikTok interview question

remove redundant edge in a tree