Binary Tree Paths

Given the root of a binary tree, return all root-to-leaf paths as a list of strings. Each path joins node values with ->. The paths may be returned in any order.

Examples
Input: [1]
Output: ["1"]
Hints

Binary Tree Paths

Given the root of a binary tree, return all root-to-leaf paths as a list of strings. Each path joins node values with `->`. The paths may be returned in any order.