PARITREE - 2 Cases Failing

I have tried to solve the problem PARITREE. But my solution seems to fail these 2 tc . Can anyone help me in finding what am i missing?
My solution

//