12
You are given
npairs of numbers. In every pair, the first number is always smaller than the second number. A pair(c,d)can follow(a,b)if and only ifbis less thanc. Chains of pairs can be formed in this manner. Find the longest chain of pairs formed.
I got this question in an interview with Amazon but couldn't figure out the answer, just that it is related to the LIS problem.