You are given the root of a binary tree.
Your task is to return all the paths from the root node to each leaf node in any order.
A leaf node is defined as a node that has no left or right child.
Each path should be represented as a string, where node values are connected by "->".
Input: root = [10, 5, 15, null, 7]
Output: ["10->5->7", "10->15"]
Input: root = [8]
Output: ["8"]
Accepted:
Submission: