Vertical tree wrong answer


sir this code is not working for all test case

hi @sraj39273 refer and do a dry run on paper and confirm