public ArrayList<Integer> getRow(int rowIndex) {
    	ArrayList<Integer> ret = new ArrayList<Integer>();
    	int nums[] = new int[rowIndex + 1];
    	for (int i = 0; i <= rowIndex; i++)
    		for (int j = i; j >= 0; j--)
    		{
    			if (j == i || j == 0)
    				nums[j] = 1;
    			else
    				nums[j] = nums[j] + nums[j - 1];
    		}
    	for (int i = 0; i < rowIndex + 1; i++)
    		ret.add(nums[i]);
    	return ret;
    }