Skip to content

Practice Find the Minimum Number of Fibonacci Numbers Whose Sum Is K

Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.

Medium#1414
LeetCode Problem

Find the Minimum Number of Fibonacci Numbers Whose Sum Is K

Problem Statement

The Fibonacci sequence starts with 1, 1; every later term is the sum of the preceding two. Return the smallest number of Fibonacci terms whose sum is k. A value may be chosen more than once, and a solution is guaranteed for the allowed inputs.

Source: Find the Minimum Number of Fibonacci Numbers Whose Sum Is K on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
k = 7
Output
2

# Example 2

Input
k = 10
Output
2

# Example 3

Input
k = 19
Output
3

Constraints

1 <= k <= 10^9

Related LeetCode Problems

Practice more problems similar to Find the Minimum Number of Fibonacci Numbers Whose Sum Is K.

Review your practice with PhantomCodeAI

After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.