Given a binary tree (not BST), print the column traversal from leftmost to rightmost column, top node first within a column. Asked in the onsite coding stage. from 7335359
Represent each node as { "val": number, "left": node|null, "right": node|null }. Implement def vertical_order(root):, returning a list of columns, where each column is a list of node values. Group nodes by horizontal distance from the root, with left child at distance -1 and right child at distance +1. Use breadth-first traversal so nodes appear top to bottom.
Example: 1 with left 2 and right 3 returns [[2], [1], [3]]. An empty tree returns [].
def vertical_order(root):