HarveyCipher's blog

By HarveyCipher, 10 years ago, In English

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

  • Vote: I like it
  • -14
  • Vote: I do not like it

| Write comment?
»
10 years ago, # |
  Vote: I like it +3 Vote: I do not like it

The contest hasn't ended yet!

  • »
    »
    10 years ago, # ^ |
      Vote: I like it -15 Vote: I do not like it

    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 !

  • »
    »
    10 years ago, # ^ |
      Vote: I like it -11 Vote: I do not like it

    anyway i have just solved it my self now thank you man :)