X Interview Question

Traverse tree in triangle fashion