Problem-solving ideas:
(1) First find the largest Fibonacci sequence less than or equal to k
(2) Judge from back to front
class Solution {
public:
int findMinFibonacciNumbers(int k) {
vector<int> v(2,1);
int a=1,b=1,c=0;
while(c<k) {
c=a+b;
v.push_back(c);
a=b;
b=c;
}
int count=0,i=v.size()-1;
while(i>=0) {
if(v[i]<=k) {
count++;
k-=v[i];
if(k==0) return count;
} else i--;
}
return count;
}
};