-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
#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
Labels
Projects
Status
Done