This question evaluates competence with binary tree structures, path enumeration and traversal techniques along with the ability to represent traversal results as formatted strings.

Given the root of a binary tree, return all root-to-leaf paths.
"->"
.
root
: the root node of a binary tree (each node has
val
,
left
,
right
).
For the tree:
1
/ \
2 3
\
5
Output:
["1->2->5", "1->3"]