@@ -0,0 +1,965 @@
+package coding4fun;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Arrays;%0Aimport java.util.List;%0A%0A/**%0A * Implement Pascal's triangle for a given number.%0A *%0A * %3Cpre%3E%0A * Input: 6%0A * Output:%0A *             1%0A *          1     1%0A *        1    2    1%0A *     1    3     3    1%0A *   1   4     6     4   1%0A * 1   5   10     10   5   1%0A * %3C/pre%3E%0A */%0Apublic class Problem41 %7B%0A    private static void pascalTriangle(int n) %7B%0A        pascalTriangle(n, Arrays.asList(1));%0A    %7D%0A%0A    private static void pascalTriangle(int n, List%3CInteger%3E list) %7B%0A        if (n == 0) %7B%0A            return;%0A        %7D%0A        System.out.println(list);%0A        List%3CInteger%3E newList = new ArrayList%3C%3E();%0A        newList.add(1);%0A        for (int i = 0; i %3C list.size() - 1; i++) %7B%0A            newList.add(list.get(i) + list.get(i + 1));%0A        %7D%0A        newList.add(1);%0A        pascalTriangle(n - 1, newList);%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        pascalTriangle(6);%0A    %7D%0A%7D%0A

Add problem 41