링크 : https://school.programmers.co.kr/learn/courses/30/lessons/42884
#include <string>
#include <vector>
#include <algorithm>
#include <iostream>
using namespace std;
int solution(vector<vector<int>> routes) {
int answer = 1;
sort(routes.begin(),routes.end());
int temp = routes[0][1];
for(int i = 1; i < routes.size(); i++){
if(temp < routes[i][0]){
answer++;
temp = routes[i][1];
}
else if(temp > routes[i][1]){
temp = routes[i][1];
}
}
return answer;
}