public int cutOffTree(List<List<Integer>> forest) {
        int count = 0;
        if (forest == null || forest.size() == 0)
            return 0;

        PriorityQueue<int[]> q = new PriorityQueue<>((a, b) -> a[2] - b[2]);

        for (int i = 0; i < forest.size(); i++) {
            for (int j = 0; j < forest.get(i).size(); j++) {
                int v = forest.get(i).get(j);
                if (v == 0)
                    continue;
                if (v > 1)
                    q.add(new int[] { i, j, v });
            }
        }
        int[] current = new int[] { 0, 0, forest.get(0).get(0) };
        while (!q.isEmpty()) {
            int[] p = q.remove();
            int cc = find(current, p, forest);
            if (cc == -1)
                return -1;
            current = p;
            count += cc;
        }
        return count;
    }
Why Did you create this class? what does it do?
src/problems/hard/CutOffTreesForGolfEvent.java