@@ -0,0 +1,744 @@
+import java.util.Arrays;%0A%0Apublic class LeetCode0279 %7B%0A    public int numSquares(int n) %7B%0A        if (n %3C= 0) %7B%0A            return 0;%0A        %7D%0A%0A        int m = (int) Math.sqrt(n);%0A%0A        long%5B%5D dp = new long%5Bn + 1%5D;%0A        Arrays.fill(dp, Integer.MAX_VALUE);%0A%0A        dp%5B0%5D = 0;%0A%0A        for (int i = 0; i %3C dp.length; i++) %7B%0A            for (int j = 1; j %3C= m; j++) %7B%0A                int num = j * j;%0A                if (i + num %3C= n) %7B%0A                    dp%5Bi + num%5D = Math.min(dp%5Bi + num%5D, dp%5Bi%5D + 1);%0A                %7D%0A            %7D%0A        %7D%0A        return (int) dp%5Bn%5D;%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        LeetCode0279 leetcode = new LeetCode0279();%0A        System.out.println(leetcode.numSquares(13));%0A    %7D%0A%7D%0A

Add LeetCode0279.java