We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
  • Hackerrank Home
  • Prepare
    NEW
  • Certify
  • Compete
  • Career Fair
  • Hiring developers?
  1. Prepare
  2. Algorithms
  3. Dynamic Programming
  4. Interval Selection
  5. Discussions

Interval Selection

Problem
Submissions
Leaderboard
Discussions
Editorial

Sort 32 Discussions, By:

votes

Please Login in order to post a comment

  • ASHIMA20
    6 years ago+ 1 comment

    can somebody please explain the problem more clearly. I am not able to get it .

    14|
    Permalink
  • sakurakhadag
    5 years ago+ 1 comment

    In the sample test case, it says [1,10] [1,3] and [3,6] overlap on point 3. This is incorrect, right? Should the answer not be 4?

    2|
    Permalink
  • leonbnu
    6 years ago+ 0 comments

    this can be solved in O(nlogn) with greedy algo. Sort all the end points, then iterate through all the end points using a simple array of size 2 to keep track of the intervals that are still open(haven't met their closing point yet). Whenever the opening intervals reached 3, just remove the interval that spans the furtherst.

    1|
    Permalink
  • HotDogTax
    4 months ago+ 0 comments

    I understand the question after a good 15 minutes of reading. Not Google interview worthy problem solving skills yet, but I'm proud of myself for getting this far.

    0|
    Permalink
  • manjulamitti1239
    11 months ago+ 0 comments

    yes plz any one explain me problem statment

    0|
    Permalink
Load more conversations

Need Help?


View editorial
View top submissions
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy
  • Request a Feature