@@ -0,0 +1,1339 @@
+package com.ggcoke.oj.leetcode;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0A/**%0A * @author Wang Huisong %3Cwanghuisong@letv.com%3E%0A */%0Apublic class Triangle %7B%0A    public static int minimumTotal(List%3CList%3CInteger%3E%3E triangle) %7B%0A        if (triangle == null %7C%7C triangle.size() == 0) %7B%0A            return 0;%0A        %7D%0A%0A        int length = triangle.size();%0A%0A        int%5B%5D m = new int%5Blength%5D;%0A%0A        for (int i = 0; i %3C length; i++) %7B%0A            m%5Bi%5D = triangle.get(length - 1).get(i);%0A        %7D%0A%0A        for (int i = length - 2; i %3E -1; i--) %7B%0A            for (int j = 0; j %3C triangle.get(i).size(); j++) %7B%0A                m%5Bj%5D = Math.min(m%5Bj%5D, m%5Bj + 1%5D) + triangle.get(i).get(j);%0A            %7D%0A        %7D%0A%0A        return m%5B0%5D;%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        List%3CInteger%3E a1 = new ArrayList%3CInteger%3E();%0A        List%3CInteger%3E a2 = new ArrayList%3CInteger%3E();%0A        List%3CInteger%3E a3 = new ArrayList%3CInteger%3E();%0A        List%3CInteger%3E a4 = new ArrayList%3CInteger%3E();%0A%0A        a1.add(2);%0A        a2.add(3); a2.add(4);%0A        a3.add(6); a3.add(5); a3.add(7);%0A        a4.add(4); a4.add(1); a4.add(8); a4.add(3);%0A%0A        List%3CList%3CInteger%3E%3E a = new ArrayList%3CList%3CInteger%3E%3E();%0A        a.add(a1); a.add(a2); a.add(a3); a.add(a4);%0A%0A        int result = minimumTotal(a);%0A        System.out.println(result);%0A    %7D%0A%7D%0A

Add solution of 'Triangle'