Given a binary tree, write a function to determine its depth.
Represent each node as [value, left, right], where a missing child is null, and return the number of nodes on the longest root-to-leaf path. Return 0 for an empty tree; for example, [1, [2, null, null], [3, null, null]] has depth 2.
def max_depth(root):