Find the Minimum Number of Fibonacci Numbers Whose Sum Is K
Given the number k
, return the minimum number of Fibonacci numbers whose sum is equal to k
, whether a Fibonacci number could be used multiple times.
The Fibonacci numbers are defined as:
F1 = 1
F2 = 1
Fn = Fn-1 + Fn-2 , for n > 2.
It is guaranteed that for the given constraints we can always find such fibonacci numbers that sum k
.
Example 1:
Example 2:
Example 3:
Constraints:
1 <= k <= 10^9
Last updated