rumtime error: munmap_chunk(): invalid pointer: 0x0000000002842c70 ***

  • 0

    If anyone can help me to identify why my code have run time error message :" munmap_chunk(): invalid pointer: 0x0000000002842c70 ***" when "submit solution", even though I do not have these errors when "run code" with the same test case.

    class Solution {
        static bool compare(Interval val1, Interval val2) {
            if (val1.start < val2.start)
                return true;
            else {
                if (val1.end < val2.end)
                    return true;
                    return false;
        int minMeetingRooms(vector<Interval>& intervals) {
            priority_queue<int, vector<int>, greater<int>> res;
            int len = intervals.size();
            int i;
            if (len == 0)
                return 0;
            sort(intervals.begin(), intervals.end(), compare);
            for (i = 1; i < len; i++) {
                if (intervals[i].start >= {
            return res.size();

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.