public int minimumTotal1(List<List<Integer>> triangle) { //自顶向下
        int[] history = new int[triangle.size() + 1];
        for (int i = 0; i < history.length; ++i)
            history[i] = Integer.MAX_VALUE;
        history[0] = triangle.get(0).get(0);
        for (int i = 1; i < triangle.size(); ++i) {
            for (int j = triangle.get(i).size() - 1; j > 0; --j) {
                if (history[j] < history[j - 1])
                    history[j] = history[j] + triangle.get(i).get(j);
                else
                    history[j] = history[j - 1] + triangle.get(i).get(j);
            }
            history[0] += triangle.get(i).get(0);
        }
        int min = Integer.MAX_VALUE;
        for (int i : history)
            if (min > i)
                min = i;
        return min;
    }