Knowing that Vector startpoints is the start of snowy road a
Knowing that Vector<int> start_points is the start of snowy road and Vector<int> end_points is the end of the snowy patch of road, return the total length of highway segments covered by snow. Note that the reported segments may overlap.
My code does not deal with the problem of start and end points that are within other start or end points (this creates a longer length than there actually is).
my code (note bolded code cannot be changed):
int snowy_highway_length(Vector<int> &start_points, Vector<int> &end_points) {
 // fill in code here
int length = 0;
for (int i = 0; i < start_points.size(); i++){
length = length + (end_points[i] - start_points[i]);
}
return length;
}
Solution
int snowy_highway_length(Vector<int> const &start_points, Vector<int> const &end_points)
 {
     
 int length = 0;
for (int i = 0; i < start_points.size(); i++){
length = length + (end_points[i] - start_points[i]);
}
return length;
}

