Question Link
My Solution:
Full Solution Link:
Plz tell me where I am doing wrong.Using LIS concept.