Tap here to switch tabs
Problem
Submissions

Problem: Amount of New Area Painted Each Day

med
30 min
Try to solve the Amount of New Area Painted Each Day problem.

Statement

You are given a 00 indexed 2extD2 ext{D} integer array paint of length nn, where paint[i] = [start_i, end_i] indicates that on the iextthi^{ ext{th}} day, you need to paint the continuous interval from start_i to end_i.

Any portion of the interval that has already been painted on previous days should not be painted again.

Return an array result of length nn, where result[i] represents the total amount of new, unpainted area painted on the iextthi^{ ext{th}} day.

Constraints:

  • 1≤1 \leq paint.length ≤105\leq 10^5

  • paint[i].length =2= 2

  • 0≤0 \leq start_i << end_i ≤5imes104\leq 5 imes 10^4

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Amount of New Area Painted Each Day

med
30 min
Try to solve the Amount of New Area Painted Each Day problem.

Statement

You are given a 00 indexed 2extD2 ext{D} integer array paint of length nn, where paint[i] = [start_i, end_i] indicates that on the iextthi^{ ext{th}} day, you need to paint the continuous interval from start_i to end_i.

Any portion of the interval that has already been painted on previous days should not be painted again.

Return an array result of length nn, where result[i] represents the total amount of new, unpainted area painted on the iextthi^{ ext{th}} day.

Constraints:

  • 1≤1 \leq paint.length ≤105\leq 10^5

  • paint[i].length =2= 2

  • 0≤0 \leq start_i << end_i ≤5imes104\leq 5 imes 10^4