Path in a Fibonacci Tree

Fibonacci trees are recursively defined as follows: T(1) and T(2) are single-node trees. For k >= 3, T(k) has root, left subtree T(k-1), and right subtree T(k-2).

Nodes are numbered in pr...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: