public int minimumTotal(List<List<Integer>> triangle) {
		if (triangle == null || triangle.size() == 0)
			return 0;
		List<List<Integer>> result = new ArrayList<List<Integer>>();
		List<Integer> newList;
		for (List<Integer> curList : triangle) {
			int n = curList.size();
			newList = new ArrayList<Integer>();
			if (n == 1) {
				newList.add(curList.get(0));
			} else {
				List<Integer> lastList = result.get(n - 2);
				int first = lastList.get(0) + curList.get(0);
				newList.add(first);
				for (int i = 1; i < n - 1; i++) {
					int tmp = curList.get(i);
					int min = Math.min(lastList.get(i - 1), lastList.get(i));
					newList.add(tmp + min);
				}
				int last = lastList.get(n - 2) + curList.get(n - 1);
				newList.add(last);
			}
			result.add(newList);
		}

		List<Integer> lastList = result.get(result.size() - 1);
		int min = lastList.get(0);
		for (int i = 1; i < lastList.size(); i++) {
			min = min > lastList.get(i) ? lastList.get(i) : min;
		}

		return min;
	}