Skip to content

단속카메라 #426

@fkdl0048

Description

@fkdl0048
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

int solution(vector<vector<int>> routes) {
    int answer = 1;
    sort(routes.begin(), routes.end());
    int temp = routes[0][1];
    
    for (auto a : routes) {
        if (temp < a[0]) {
            answer++;
            temp = a[1];
        }
        
        if (temp >= a[1]) temp = a[1];
    }
    
    return answer;
}

Metadata

Metadata

Assignees

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions