Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Incorrect solution is getting accepted [Missing TestCase] #3963

Closed
@ekanshsaxena

Description

@ekanshsaxena

Test Case:
[(25,579),(218,918),(1281,1307),(623,1320),(685,1353),(1308,1358)]

Problem:
https://neetcode.io/problems/meeting-schedule-ii

Solution getting accepted:

/** * Definition of Interval: * class Interval { * public: *     int start, end; *     Interval(int start, int end) { *         this->start = start; *         this->end = end; *     } * } */class Solution {public:    int minMeetingRooms(vector<Interval>& intervals) {        sort(intervals.begin(), intervals.end(), [](const Interval &a, const Interval &b){            return a.end < b.end;        });        int totalIntervals = intervals.size();        if(totalIntervals == 0) return 0;        int daysReq = 1;        int lastPointer = 0;        for(int intervalIdx = 1; intervalIdx < totalIntervals; intervalIdx++){            Interval interval = intervals[intervalIdx];            if(interval.start < intervals[lastPointer].end){                daysReq++;            }else{                lastPointer++;            }        }        return daysReq;    }};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp