Given the root of a binary tree, return its inorder traversal using Morris traversal — O(1) extra space, no recursion or explicit stack — by temporarily threading predecessor links. Return the values as an array. The tree is given as a level-order array.
Input: A level-order array of the tree.
Output: Array — node values in inorder.
Input: [1,2,3,4,5,null,7]
Output: [4,2,5,1,3,7]
Explanation: Inorder via threaded links.Input: [1]
Output: [1]
Explanation: Single node.Input: []
Output: []
Explanation: Empty tree.0<=nodes<=10^4-1000<=value<=1000