@@ -0,0 +1,876 @@
+import java.util.Arrays;%0A%0Apublic class LeetCode0322 %7B%0A    public int coinChange(int%5B%5D coins, int amount) %7B%0A        if (coins == null %7C%7C coins.length == 0 %7C%7C amount %3C= 0) %7B%0A            return 0;%0A        %7D%0A%0A        long%5B%5D dp = new long%5Bamount + 1%5D;%0A%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 = 0; j %3C coins.length; j++) %7B%0A                if ((long)i + coins%5Bj%5D %3C= amount) %7B%0A                    dp%5Bi + coins%5Bj%5D%5D = Math.min(dp%5Bi + coins%5Bj%5D%5D, dp%5Bi%5D + 1);%0A                %7D%0A            %7D%0A        %7D%0A%0A        return dp%5Bamount%5D %3E= Integer.MAX_VALUE ? -1 : (int) dp%5Bamount%5D;%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        LeetCode0322 leetcode = new LeetCode0322();%0A        int%5B%5D coins = new int%5B%5D %7B 2147483647 %7D;%0A        System.out.println(leetcode.coinChange(coins, 2));%0A    %7D%0A%7D%0A

Add LeetCode0322.java