https://programmers.co.kr/learn/courses/30/lessons/42884
function solution(routes) {
routes = routes.sort((a, b) => a[1] - b[1]);
console.log(routes);
let ans = 1;
let temp = routes[0][1];
for (let i = 0; i < routes.length; i++) {
if (routes[i][0] > temp) {
temp = routes[i][1];
ans++;
}
}
return ans;
}