Redundnt connection GRAPH PROBLEM LEETCODE

problem url

my solution


my code is giving wrong answer plz help me to correct it

Hello @coderajay03 please explain your approach.

its a very simple approach using the simple union and find function in DSU and whenever sees a cycle forming then not doing union there and going ahead acquiring the last pair which will make cycle and returning in form of a vector.

@coderajay03 you have raised your doubt again another TA will help you.

you earlier said graph not your domain that’s why I specified in title GRAPH PROBLEM but still :slight_smile:

@coderajay03 you have raised your doubt again thats why i cant help you because it is now assigned to another TA.
there is not like anything that it is not my domain.

@coderajay03
pls reopen this doubt ,i will help u with the issue.

please solve it now aman bhaiya

its not reopend yet.

how to reopen ???

i haven’t meaked it as resolved

can u pls share the ss of ur dashboard , from where u have raised this doubt

first mark as resolve and then share the ss.

making as resolved and now again reopend it as you said

’

bro it is still not visible in live doubts.

try to open another doubt.

i am doing it please do something well if u can see above comments u can see my msgs too just resolve here only na

i can help u here but then it will be counted in some other ta’s contribution who has not even replied once.
so helping u here means helping that unresponsible ta which i dont want.
btw ping me at likedin will help u over there