this problem on hackerrank https://www.hackerrank.com/contests/w15/challenges/haunted-house
require me to check on the existence of each N varies from 1 to 3x10^5 in the giver intervals [start,end] whether equal to or more than N+1 the intervals are also 1<= i <= 3x10^5 & the time limit for the problem is 1s i have done a sol of O(n^2) making a loop that iterates over all interval & counts the existence of each N so i can get the maximum N with the condition N exists for at least N+1 times !
would anyone here help me plz !
thanks in advance
The contest hasn't ended yet!
the contest is a long time contest because we have to search for the answer & learn educational contest + the problem score has been decreased yet !
anyway i have just solved it my self now thank you man :)