I am practising a problem in hackerearth called Inversion Graphs.
I have solved using Longest Increasing subsequence in O(nlogn) algorithm.
My solution has passed all the test cases except the one test case #7.
Surprisingly, my solution is similar to the editorial one.
Link to the code : Online Compiler and IDE - GeeksforGeeks
If the above link does not work, try this : Inversion Graphs - Pastebin.com
Thank you in advance