Given the root of a binary tree, return all root-to-leaf paths, each as the list of node values from the root down to a leaf. Return the paths as a nested array, in left-to-right (preorder) order. The tree is given as a level-order array with null for missing children.
Input: A level-order array of the tree.
Output: Nested array — each root-to-leaf path.
Input: [1,2,3,null,5]
Output: [[1,2,5],[1,3]]
Explanation: Two root-to-leaf paths.Input: [1]
Output: [[1]]
Explanation: Single-node path.Input: []
Output: []
Explanation: No paths.0<=nodes<=10^4-1000<=value<=1000