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.
- Prepare
- Algorithms
- Graph Theory
- HackerX
- Discussions
HackerX
HackerX
+ 0 comments Here is my solution in java, javascript, python, C, C++, Csharp HackerRank HackerX Problem Solution
+ 0 comments Here is the solution of HackerX Click Here
+ 0 comments Here is problem solution - https://programs.programmingoneonone.com/2021/07/hackerrank-hackerX-problem-solution.html
+ 1 comment https://zeroplusfour.com/hackerx-hackerrank-solution/
Here's how I did in all languages Java 8 , C++ , C , Python 3, Python 2.
+ 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))
Load more conversations
Sort 14 Discussions, By:
Please Login in order to post a comment