public int minimumTotal_lint(ArrayList<ArrayList<Integer>> triangle) {
        // write your code here
        if (triangle == null || triangle.size() == 0 || triangle.get(0) == null || triangle.get(0).size() == 0)
            return 0;
        for (int i = triangle.size() - 2; i >= 0; --i) {
            ArrayList<Integer> prev = triangle.get(i + 1);
            ArrayList<Integer> cur = triangle.get(i);
            for (int j = cur.size() - 1; j >= 0; --j) {
                cur.set(j, cur.get(j) + Math.min(prev.get(j), prev.get(j + 1)));
            }
        }
        return triangle.get(0).get(0);
    }