This same question I encountered in the coding round of MIcrosoft for my on-campus placement
@utkarshsharma1185 Жыл бұрын
Thanks aryan bhaiya for the nice and clear explanation
@SouravKumar-rg4yj Жыл бұрын
keep this good work please...really helpful for many people.. thanks a lot man❤
@kunalsabadra6802 Жыл бұрын
Nice explanation bro 🔥❤🔥
@girikgarg8 Жыл бұрын
Nice explanation
@oqant0424 Жыл бұрын
thanks Aryan!
@geeteshyadav12 Жыл бұрын
Keep it up
@k.k.harjeeth54229 ай бұрын
from collections import defaultdict class Solution: def minReorder(self, n: int, connections: List[List[int]]) -> int: edges=set() for i in connections: edges.add(tuple(i)) neighbors=defaultdict(list) for a,b in connections: neighbors[a].append(b) neighbors[b].append(a) visited=set() count=0 def dfs(city): nonlocal count visited.add(city) for i in neighbors[city]: if(i not in visited and (i,city) not in edges): count+=1 dfs(i) elif(i not in visited): dfs(i) dfs(0) return count
@stuartYoung559 Жыл бұрын
change += dfs(gr, visited, abs(to)) + (to > 0); i have seen this kind of syntax for very first time, can anyone explain me this to>0 , i tried to give if condition above dfs call , but answer coming was not correct like if(t>0)change++; dfs(,,);
@ok-google-run Жыл бұрын
I think its like conditioning and getting value 1 or 0
@angajalasaisri8228 Жыл бұрын
Bro In thumbnail the Question name written wrong. Instead of "reorder" there is "record."
@ARYANMITTAL Жыл бұрын
Thanks broo 🙌🏻
@girishgarg2816 Жыл бұрын
Same Aryan from 2y ago but richer.
@rishipalsingh9404 Жыл бұрын
bro be simple , itna tough code se samjhna is not good. just stick to the basic syntax of c++ like babbar bhaiya, anuj bhaiya etc. cool banke kuch fayda nh try to help us.
@AshutoshChoudhary2004 Жыл бұрын
Bhai bhot simple hi samjhya hai code pehle basic c++ strong karle fir kar lena DSA