257. Binary Tree Paths

Description

Given a binary tree, return all root-to-leaf paths.

Note: A leaf is a node with no children.

Constraints

Approach

  • GeeksforGeeks

  • ProgramCreek

  • YouTube

Examples

Input: [1, 2, 3, null, 5]

Output: ["1->2->5", "1->3"]

Solutions

Follow up

Last updated

Was this helpful?