Tap here to switch tabs
Problem
Submissions

Problem: Set Intersection Size At Least Two

med
30 min
Try to solve the Set Intersection Size At Least Two problem.

Statement

You are given a two dimensional integer array intervals where intervals[i] =[starti,endi]= [start_i, end_i] denotes an inclusive interval spanning from startistart_i to endiend_i.

A set of integers nums is valid if its intersection with every interval in intervals contains at least 22 distinct integers.

Return the minimum possible size of such a set nums.

Constraints:

  • 1≤1 \leq intervals.length ≤3000\leq 3000

  • intervals[i].length =2= 2

  • 0≤starti<endi≤1080 \leq start_i < end_i \leq 10^8

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Set Intersection Size At Least Two

med
30 min
Try to solve the Set Intersection Size At Least Two problem.

Statement

You are given a two dimensional integer array intervals where intervals[i] =[starti,endi]= [start_i, end_i] denotes an inclusive interval spanning from startistart_i to endiend_i.

A set of integers nums is valid if its intersection with every interval in intervals contains at least 22 distinct integers.

Return the minimum possible size of such a set nums.

Constraints:

  • 1≤1 \leq intervals.length ≤3000\leq 3000

  • intervals[i].length =2= 2

  • 0≤starti<endi≤1080 \leq start_i < end_i \leq 10^8