4th test case is failing for bottom view. works fine for top view
One test case is failing
@piyush.bansal8158625
hello piyush,
can u please send me the input and output format of the given problem
@piyush.bansal8158625
btw ur logic is bit wrong. In map store two things first is value and second is level .
and update ur map only when u enconter a node whose level is greater than currently existing level. or when then key does not exist

1 2 3 4 5 -1 6 -1 -1 -1 -1 -1 -1
Its basically a level order tree creation.
I am using map with key to store horizontal chance and the value for key to represent data. If in bottom view we found another node with same or greater level then we update map because from bottom view that node will be only visible.
For top view I checked Only once every distance should be added.
Only 1 test case s failed in bottom view
@piyush.bansal8158625
pls dry run ur code for given tree

the highlighted part should be in answer
but urs will give different output
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.