출처 : https://leetcode.com/problems/points-that-intersect-with-cars/

class Solution {
public int numberOfPoints(List<List<Integer>> nums) {
int count = 0;
boolean[] visited = new boolean[101];
for(List<Integer> l : nums){
for(int j = l.get(0); j <= l.get(1); j++){
visited[j]=true;
}
}
for(boolean b : visited){
if(b) count++;
}
return count;
}
}