I coded myself but my solution ended up just like yours. The same vector and variable names. The same if statement 😂
Thanks man! I am definitely checking out your Graph Playlist.
"Thanks for this detailed explanation! The step-by-step approach and code breakdown made the concept so much easier to understand. Great job on simplifying complex topics! Looking forward to more such videos!"
🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥 Today's Quote won my heart
Radhe Radhe ❤
It can be solved using the indegree concept for detecting cycles in a directed graph.
Do i need to complete graph topic before or I can directly watch your playlist
Find champion 1 bhi kar lia bhaiya ❤
bhaiya raadhe raadhe..❤
0:15 bana liya khud se, tho not sure if it will be the most optimal.
i was trying to use arraylist and hashmap in java i created adj list first... and got stuck in bfs... :( bro, in which order should I study the topics, please share again..
My sol class Solution { public int findChampion(int n, int[][] edges) { ArrayList<ArrayList<Integer>>graph=new ArrayList<>(); for(int i=0;i<n;i++){ graph.add(new ArrayList<>()); } for(int i[]:edges){ int u=i[0]; int v=i[1]; graph.get(v).add(u); } int count=0; int ans=-1; for(int i=0;i<n;i++){ if(graph.get(i).size()==0){ count++; ans=i; } } return (count==1)?ans:-1; } }
@psychologyfact2320