-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
Bug Report for https://neetcode.io/problems/binary-tree-right-side-view
Please describe the bug below and include any steps to reproduce the bug or screenshots if possible.
Given the problem test case [1,2]:

since 2 appears right after 1 in the array, the Node with 2 actually appears to the left of 1, not the right of 1. Hence, when getting just the node of the right side of the tree, the root would only be included since that is the only element of the right side of the tree.
The expected output says[1,2], but that is incorrect because the node with 2 does not appear on the right side of the tree since it is to the left of the node containing the value 1.
Pleas review this error and fix it as soon as possible as this is not good to have when expressing a tree as an array, If 2 were to be the right node, it should've been [1, null, 2]