@@ -0,0 +1,1135 @@
+/**%0A *%09Given numRows, generate the first numRows of Pascal's triangle.%0A *%0A *%09For example, given numRows = 5,%0A *%09Return%0A *%09%0A *%09%5B%0A *    %09%09%5B1%5D,%0A *   %09   %5B1,1%5D,%0A *  %09  %5B1,2,1%5D,%0A * %09%09 %5B1,3,3,1%5D,%0A *%09%09%5B1,4,6,4,1%5D%0A *%09%5D%0A *%0A *%09Author: matao%0A *%0A */%0A%0Aimport java.util.List;%0Aimport java.util.ArrayList;%0A%0Apublic class PascalTriangle %7B%0A%09public static List%3CList%3CInteger%3E%3E generate(int numRows) %7B%0A        List%3CList%3CInteger%3E%3E result = new ArrayList%3CList%3CInteger%3E%3E();%0A        if (numRows == 0) %7B%0A        %09return result;%0A        %7D%0A        for (int i = 0; i %3C numRows; i++) %7B%0A        %09List%3CInteger%3E item = new ArrayList%3CInteger%3E();%0A        %09for (int j = 0; j %3C= i; j++) %7B%0A        %09%09if(j == 0 %7C%7C j == i) %7B%0A        %09%09%09item.add(1);%0A        %09%09%7D else %7B%0A        %09%09%09item.add(result.get(i-1).get(j-1) + result.get(i-1).get(j));%0A        %09%09%7D%0A        %09%7D%0A        %09result.add(item);%0A        %7D%0A        return result;%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A %09%09List%3CList%3CInteger%3E%3E result = generate(5);%0A %09%09for (List%3CInteger%3E list : result) %7B%0A %09%09%09for (Integer integer : list) %7B%0A %09%09%09%09System.out.print(integer + %22 %22);%0A %09%09%09%7D%0A %09%09%09System.out.println();%0A %09%09%7D%0A    %7D%0A%7D

add Pascal Triangle solution