public List<List<Integer>> generate(int numRows) {
		Integer[][] triangle = new Integer[numRows][];
		// error List<List<Integer>> triangle = new
		// ArrayList<ArrayList<Integer>>();

		//o(n*n)
		for (int i = 1; i <= numRows; i++) {
			Integer[] row = new Integer[i];
			if (i == 1) {
				row[0] = 1;
				triangle[i-1] = row;
				continue;
			}
			Integer[] beforeRow = triangle[i-2];
			row[0] = 1 ;
			for (int j = 1; j < i - 1; j++) {
				row[j] = beforeRow[j-1] + beforeRow[j]; 
			}
			row[i-1] = 1;
			triangle[i-1] = row;
		}
		//o(n*n)
		List<List<Integer>> result = new ArrayList<List<Integer>>();
		for(int i =0;i <numRows; i++){
			ArrayList<Integer> tmp = new ArrayList<Integer>();
			Integer[] ii = triangle[i];
			result.add(Arrays.asList(ii));
		}
		
		return result;
	}