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. Graph Theory
  4. HackerX
  5. Discussions

HackerX

Problem
Submissions
Leaderboard
Discussions
Editorial

Sort 10 Discussions, By:

votes

Please Login in order to post a comment

  • TChalla
    1 year ago+ 0 comments

    Python 3 code

    n = int(input())
    inp = (map(int, input().split()) for i in range(n))
    p = sorted(list((a + b, a - b) for a, b in inp))
    a = list(y for x, y in p)
    d = []
    for x in a:
        low, high = -1, len(d) # >, <=
        while high - low > 1:
            mid = (low + high) >> 1
            if d[mid] > x:
                low = mid
            else:
                high = mid
        if high == len(d):
            d.append(x)
        else:
            d[high] = x
    print(len(d))
    
    0|
    Permalink
  • hagar9886
    1 year ago+ 0 comments

    does an increase in the frequency by 1 for example means it's gonna take time of the same amount(1) to be adjusted? i mean if does an increase in frequency by 1 requires 1 unit of time ??

    0|
    Permalink
  • renat_valeev
    5 years ago+ 1 comment

    I have an algorithm what gives less than expected output, for example for case 4, it gives 15. And could not find a cause. All missiles are hit and enough spare time to change frequency. Have I missed something obvious?

    0|
    Permalink
  • dbalgley
    6 years ago+ 0 comments

    I'm feeling quite dumb, but can we assume for this problem that we have visibility into the whole scenario? Meaning: we know when each missile will arrive from the beginning, and can optimize our missile switching accordingly? The Minimum Path Coverage of the DAG would indicate that...but the nature of the word problem would seem to not allow future knowledge.

    0|
    Permalink
  • Soham_Tamba
    7 years ago+ 1 comment

    In the question does \|fB - fA\| mean abs(fB - fA)

    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