Reconstruct itinerary || Leetcode
Vložit
- čas přidán 6. 09. 2024
- Please consume this content on nados.pepcoding.com for a richer experience. It is necessary to solve the questions while watching videos, nados.pepcoding.com enables that.
NADOS also enables doubt support, career opportunities and contests besides free of charge content for learning. Pepcoding has taken the initiative to provide counselling and learning resources to all curious, skillful and dedicated Indian coders. This video is part of the series to impart industry-level web development and programming skills in the community.
We also provide professional courses with live classes and placement opportunities.
For more free study resources and information about the courses, visit: www.pepcoding....
Have a look at our result: www.pepcoding....
Follow us on our CZcams page: / pepcoding
Follow us on our FB page: / pepcoding
Follow us on Instagram: / pepcoding
Follow us on LinkedIn: / pepcoding-education
Follow us on Pinterest: / _created
Follow us on Twitter: home
.
.
.
Happy Programming !!! Pep it up
.
.
.
#pepcoding #code #coder #codinglife #programming #coding #java #freeresources #datastrucutres #pepcode #competitive #competitiveprogramming #softwareengineer #engineering #engineer
what a command over graph ! 👑
++🔥🔥
Best explaination for this problem.
oh so we are making visited of edges! thank you so much sir crystal clear hogaya
Thanks... gr8 explanation
Well explained. Thanks.
Bhaiyo topological sort,mother vertex,kosaraju algo and yee sab connected Hai
It will fail a case, where the lexographically smallest result is not valid, i.e. doesn't visit all the edges. Example: [["JFK","KUL"],["JFK","NRT"],["NRT","JFK"]]
So in this case we will have to go ahead with Linked List instead of prioirty Queue, maintain a overall edges, and number of edge removed count,
and add back the string to LL if they don't match.
It will work!
It is working!!
yes. but how his code s working?
@@vishalgaurav4411 Just do a dry run ,It covers this case too
@@vishalgaurav4411 see with this approach kul will be added first in last position because no dfs call can be done from kul as there is no ticket from kul.And this is what we need .We need the location that will be visited at last in the last position and the place from where no other places can be visited shall be last.
King.
[["JFK","KUL"],["JFK","NRT"],["NRT","JFK"]] ye wala case kaise handle ho rha hai? can you pls walkthro' this once?
i am also stuck in same. you got the answer?
Time complexity tow bataye heen nhi
ELogE
Today loudly bol lijiye bhai pls