Tree Left View wrong answer

kindly help as i have already used the code given in the coding blocks discussion forum and it is not working for their own test case when i used a test case which the same guy used as an argument in the forum…
use any input test cases and please specify and explain in detail why it is not working
https://codeshare.io/adLrrK

hi
ur height function is wrong

if root==NULL then height is 0 then why -1 height cannot be negative
also ur level function is not logically correct

check this

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.