package leetcode;

/**
 * https://leetcode.com/problems/find-the-minimum-number-of-fibonacci-numbers-whose-sum-is-k/
 */
public class Problem1414 {
    public int findMinFibonacciNumbers(int k) {
        // TODO
        return 0;
    }

    public static void main(String[] args) {
        Problem1414 prob = new Problem1414();
        System.out.println(prob.findMinFibonacciNumbers(7)); // 2
        System.out.println(prob.findMinFibonacciNumbers(10)); // 2
        System.out.println(prob.findMinFibonacciNumbers(19)); // 3
    }
}

@@ -185,24 +185,179 @@
 rs(int k) %7B%0A
+        Integer%5B%5D memo = new Integer%5Bk + 1%5D;%0A        memo%5B1%5D = 1;%0A        memo%5B2%5D = 1;%0A        fibonacci(k, memo);%0A        int answer = Integer.MAX_VALUE;%0A
         // T
@@ -359,16 +359,17 @@
  // TODO
+:
 %0A       
@@ -376,17 +376,301 @@
  return 
-0
+answer;%0A    %7D%0A%0A    private static int fibonacci(int n, Integer%5B%5D memo) %7B%0A        if (n %3C= 2) %7B%0A            return 1;%0A        %7D%0A        if (memo%5Bn%5D != null) %7B%0A            return memo%5Bn%5D;%0A        %7D%0A        memo%5Bn%5D = fibonacci(n - 1, memo) + fibonacci(n - 2, memo);%0A        return memo%5Bn%5D
 ;%0A    %7D%0A

Update problem 1414