Test case 1 and 2 are not passing

please make the corrections required to pass all test cases

hello @Nishant_08
image

here it should be root->right

correct it and then try

yes it worked now
it will take o(n) time right?
because we are pushing and popping every element once

yeah . . . . . . . . . . . .