title: I am trying to solve this leetcode problem
body: <p>Question :</p>
  <p>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.</p>
  <p>The Fibonacci numbers are defined as:</p>
  <pre><code>F1 = 1
  F2 = 1
  Fn = Fn-1 + Fn-2 , for n &gt; 2.
  </code></pre>
  <p>It is guaranteed that for the given constraints we can always find such fibonacci numbers that sum k.</p>
  <p>Link to question:</p>
  <p><a href="https://leetcode.com/problems/find-the-minimum-number-of-fibonacci-numbers-whose-sum-is-k/" rel="nofollow noreferrer">https://leetcode.com/problems/find-the-minimum-number-of-fibonacci-numbers-whose-sum-is-k/</a></p>
  <p>Example :
  Input: k = 7
  Output: 2
  Explanation: The Fibonacci numbers are: 1, 1, 2, 3, 5, 8, 13, ...
  For k = 7 we can use 2 + 5 = 7.</p>
  <pre><code>
      class Solution {
          public int findMinFibonacciNumbers(int count) {
              PriorityQueue&lt;Integer&gt; num=new PriorityQueue&lt;&gt;(Collections.reverseOrder());
            
              int i1=1,i2=1;
              num.add(i1);
              num.add(i2);
              int k=count;
              int i3=0;
              k=k-2;
              int res=0;
              while(k&gt;=1){
                  i3=i2+i1;
                  num.add(i3);
                  int temp=i2;
                  i2=i3;
                  i1=temp;
                  k--;
              }
              while(count!=0){
                  int n=num.poll();
                  if(n&lt;=count)
                  {      res++;
                         count-=n;
                  }
              }
              return res;
              
          }
      }
  
  </code></pre>
  <p>It says wrong output for 'input=3'. I generated the fibonacci series and traversed from highest number to find numbers less than or equal to sum. It will be really helpful if somebody helps me.
  Thank you in advance.</p>