Tap here to switch tabs
Problem
Submissions

Problem: Amount of New Area Painted Each Day

Amount of New Area Painted Each Day tracks daily painting intervals and asks you to return the amount of previously unpainted area covered on each day.

Statement

You are given a 00 indexed 2D2 {D} integer array paint of length nn, where paint[i] = [start_i, end_i] indicates that on the ithi^{ {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 ithi^{ {th}} day.

Constraints:

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

  • paint[i].length =2= 2

  • 0≤0 \leq start_i << end_i ≤5×104\leq 5 \times 10^4

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Amount of New Area Painted Each Day

Amount of New Area Painted Each Day tracks daily painting intervals and asks you to return the amount of previously unpainted area covered on each day.

Statement

You are given a 00 indexed 2D2 {D} integer array paint of length nn, where paint[i] = [start_i, end_i] indicates that on the ithi^{ {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 ithi^{ {th}} day.

Constraints:

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

  • paint[i].length =2= 2

  • 0≤0 \leq start_i << end_i ≤5×104\leq 5 \times 10^4