Daily LeetCode Challenge (Day 41): N-ary Tree Postorder Traversal

  Рет қаралды 51

Alejandro Iglesias Llobet

Alejandro Iglesias Llobet

Күн бұрын

Welcome to Day 41 of my Daily LeetCode Challenge until I reach 1 year's worth of green contributions on GitHub! Today, we're solving Problem 590 - N-ary Tree Postorder Traversal.
🔗 Problem Link: leetcode.com/p...
🚀 Check out my GitHub for all solutions: github.com/Jac...
📅 Join me daily for a new LeetCode problem!
Don't forget to like, comment, and subscribe if you like joining along to these types of videos!
#LeetCode #CodingChallenge #DailyCoding #Programming #GitHub #Python

Пікірлер: 6
@saag420
@saag420 20 күн бұрын
Two LeetCode easy ones back to back-that’s what we love to see! 😁 And with the way you’re gaining subs, we’ll hit 100 in no time!
@alejandroill
@alejandroill 20 күн бұрын
Hahahaha yessssss, although I wonder what that means is in store for us the next 1-3 days difficulty-wise… 🫠 Hopefully no back-to-back ultra hards 😅 AND YES OMG SO EXCITINGGGGG, ALMOST THERE!!! 💯🤩
@EverAfterBreak2
@EverAfterBreak2 21 күн бұрын
I was able to solve this one, you pretty much explained it yesterday 👍
@alejandroill
@alejandroill 20 күн бұрын
Ayyyy, I’m so glad to hear that José!! 🤩 It’s amazing to already see you progress, that means you were able to internalize the solution well yesterday, which is otherwise a big trap that people can get into when building new projects or grinding out a technical skill like Leetcode. So big kudos to you my friend, and let’s keep the Leetcode problem solving streak going 😎💪
@theragaru
@theragaru 21 күн бұрын
would love to see you explore the follow ups in the daily problems after the initial solutions
@alejandroill
@alejandroill 21 күн бұрын
Hey there, thanks so much for leaving a comment! I had to search up what you meant -- I actually had no idea that Leetcode had follow up questions!! I'll definitely have to take a look and share my thoughts (or even solve them) in my future videos from now on. Thank you so much for the suggestion!! 🥰 As for this problem specifically, one thing we learned in my CS class back in college was drawing out the traversal methods (preorder vs inorder vs postorder) to get a better sense of intution with each, as it was meant to warm us up to understanding the recursion method. One thing I noticed is that for preorder you added nodes to the result the first time you visit them, for inorder the second, and for postorder the third time you traverse them. That works for binary trees, but in this problem where a node has say K children, you then add the node to your result array on the (K+1)th visit. So every time you traverse a node, you would append it to a dictionary with its value set to the number of it's children (if not seen before), and otherwise subtract 1 from its dictionary-value (and append it to result array if its value is now 0, hinting it's the K+1th time we visit the node). That way, the result array would then get populated in correct postorder traversal. I hope that explanation is useful, in case you wanted to have a mental roadmap of how I'd tackle the problem iteratively; though I just want to quickly say thank you so much for giving me that feedback, I will 100% start to watch out for follow up questions in my future Leetcode problem-solving videos 😁
Daily LeetCode Challenge (Day 40): Binary Tree Postorder Traversal
17:14
Alejandro Iglesias Llobet
Рет қаралды 61
Dynamic Programming isn't too hard. You just don't know what it is.
22:31
DecodingIntuition
Рет қаралды 140 М.
At the end of the video, deadpool did this #harleyquinn #deadpool3 #wolverin #shorts
00:15
Anastasyia Prichinina. Actress. Cosplayer.
Рет қаралды 19 МЛН
Girl, dig gently, or it will leak out soon.#funny #cute #comedy
00:17
Funny daughter's daily life
Рет қаралды 8 МЛН
So Cute 🥰
00:17
dednahype
Рет қаралды 49 МЛН
Unlocking Your Intuition: How to Solve Hard Problems Easily
17:34
Colin Galen
Рет қаралды 1,3 МЛН
Just enough C to have fun
39:29
Kay Lack
Рет қаралды 39 М.
Daily LeetCode Challenge (Day 53): Linked List in Binary Tree
40:48
Alejandro Iglesias Llobet
Рет қаралды 53
How to Solve ANY LeetCode Problem (Step-by-Step)
12:37
Codebagel
Рет қаралды 212 М.
Demystifying the C++ Compiler!
12:52
Low Level Game Dev
Рет қаралды 10 М.
Daily LeetCode Challenge (Day 59): XOR Queries of a Subarray
1:39:05
Alejandro Iglesias Llobet
Рет қаралды 48
My Honest College Advice for Computer Science Majors
14:06
Sayhyun (세현)
Рет қаралды 162 М.
The 5 Levels Of Text Splitting For Retrieval
1:09:00
Greg Kamradt (Data Indy)
Рет қаралды 69 М.
Mastering Dynamic Programming - How to solve any interview problem (Part 1)
19:41