❔ ✅ Missing a first element of the output
So I am on this LeetCode puzzle https://leetcode.com/problems/n-ary-tree-preorder-traversal/?envType=study-plan&id=level-1
My code is here right now
It is still missing a first element in the List array as per screenshot. Could anyone kindly tell me why?
LeetCode
LeetCode - The World's Leading Online Programming Learning Platform
Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
7 Replies
@morry329 you seem to have forgotten the root node
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.Thanks a lot - just one more question.
So I have added the root node in the PreOrder method, it worked:
...What's the question?
Sorry I forgot to delete the question part, I just resolved it myself 🙂
Ah nice congrats
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.