line representing the number line with a size large enough to cover all possible positions.res to store the amount of new area painted each day.paint array.start to end.line[start] is 0), increment the count for the day and set line[start] to end.line[start].line[start] to the maximum of its current value and end.res array containing the amount of new area painted each day.