# Leetcode 257 - Binary tree paths

Note

• Know how to check if a node is a leaf node
• Use spread operator to pass by value (Otherwise changing an element of the array would propagate back to the original array)

Given the root of a binary tree, return all root-to-leaf paths in any order.

A leaf is a node with no children.

Example

Backtracking