@@ -0,0 +1,1472 @@
+package com.ggcoke.oj.leetcode;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0A/**%0A * @author Wang Huisong %3Cggcoke@foxmail.com%3E%0A */%0Apublic class PascalsTriangle %7B%0A%0A    public static void main(String%5B%5D args) %7B%0A        PascalsTriangle pascalsTriangle = new PascalsTriangle();%0A%0A        List%3CList%3CInteger%3E%3E result = pascalsTriangle.generate(5);%0A        if (result != null) %7B%0A            for (List%3CInteger%3E list : result) %7B%0A                for (int item : list) %7B%0A                    System.out.print(item + %22 %22);%0A                %7D%0A                System.out.println();%0A            %7D%0A%0A        %7D%0A    %7D%0A%0A    public List%3CList%3CInteger%3E%3E generate(int numRows) %7B%0A        List%3CList%3CInteger%3E%3E result = new ArrayList%3CList%3CInteger%3E%3E();%0A%0A        if (numRows == 0) %7B%0A            return result;%0A        %7D%0A%0A        for (int row = 0; row %3C numRows; row++) %7B%0A            int maxColumn = row + 1;%0A            List%3CInteger%3E rowContent = new ArrayList%3CInteger%3E();%0A%0A            if (row == 0) %7B%0A                rowContent.add(1);%0A            %7D else %7B%0A                List%3CInteger%3E lastRow = result.get(row - 1);%0A                rowContent.add(lastRow.get(0));%0A                for (int column = 1; column %3C maxColumn - 1; column++) %7B%0A                    rowContent.add(lastRow.get(column - 1) + lastRow.get(column));%0A                %7D%0A                rowContent.add(lastRow.get(lastRow.size() - 1));%0A            %7D%0A%0A            result.add(rowContent);%0A        %7D%0A%0A        return result;%0A    %7D%0A%7D%0A

Add solution for "Pascal's Triangle"