Boundary traversal binary tree

question:https://codezen.codingninjas.com/practice/499/772/boundary-traversal
wrong ans
https://ideone.com/btwlWe