2097. Valid Arrangement of Pairs | No Pre-requisite | Eulerian Path | DFS

  Рет қаралды 952

Aryan Mittal

Aryan Mittal

Күн бұрын

Пікірлер: 6
@niravrathod1146
@niravrathod1146 3 сағат бұрын
Best explanation on post order DFS :)
@rajrajesh1669
@rajrajesh1669 2 сағат бұрын
This problem literally questioned my skills 😢. Usually, I'll try to avoid incorrect approaches by validating my thoughts but however for this problem I thought it's actually an easy-hard one, by assuming that each node will only have one edge, so I directly jumped to write an O(n) hash solution without DFS but after submission I realised the mistake. Then even though I know just a blind DFS from every starting point will not solve the problem due to the constraints, I wanted to just code it then if I get a TLE then I thought I'll read leetcode editorials for efficient solution if it's not enough then watch your video editorial. But there was yet another problem, I misjudged it again because I missed the backtracking part. After covering that part I again failed not by TLE but with my DFS itself, I spent about 2hrs just to debug and figure out what went wrong. After going through all these, I finally decided to give up and here I am. Basically, I went through every single wrong direction you explained, lol. No one can explain a solution with this level of care and effort, that's why you are the best. Thanks again for the wonderful editorial, Aryan bro. Finally, inner peace.❤
@kbcoder3734
@kbcoder3734 6 сағат бұрын
Really Nice Solution, one improvement could be using the vector ans to store the answer in the dfs, So that at the end we don't need to convert the result to the required format again.
@shadyboy3010
@shadyboy3010 4 сағат бұрын
nicely explained, thanks man
@Its_Shubham_Negi
@Its_Shubham_Negi 11 сағат бұрын
Finally c++❤
@bishwashkumarsah171
@bishwashkumarsah171 11 сағат бұрын
11:32 lol i was exactly thinking about this and wanted to take that case as input. haha
А я думаю что за звук такой знакомый? 😂😂😂
00:15
Денис Кукояка
Рет қаралды 5 МЛН
Turn Off the Vacum And Sit Back and Laugh 🤣
00:34
SKITSFUL
Рет қаралды 8 МЛН
How to Solve ANY LeetCode Problem (Step-by-Step)
12:37
Codebagel
Рет қаралды 305 М.
2 Years of C++ Programming
8:20
Zyger
Рет қаралды 6 М.
TCP/IP for Programmers
3:03:31
Eli the Computer Guy
Рет қаралды 230 М.
Quiet Night: Deep Sleep Music with Black Screen - Fall Asleep with Ambient Music
3:05:46
Defuse the Bomb | Leetcode 1652
19:32
Techdose
Рет қаралды 2,6 М.
А я думаю что за звук такой знакомый? 😂😂😂
00:15
Денис Кукояка
Рет қаралды 5 МЛН