Getting runtime error in testcase 0 and 2

getting runtime error in testcase 0 and 2, rest are passing

hello @aman89533

image

here u r only considering north coordinates (i know u have sorted the data but that will not ensure that cordinates will not intersect) only .
a) first sort ur data list
b) then use the sorted data list to compute lis (currently u r using only north).
if u have considered ith and jth data then they should br non intersecting so u need to add seprate condition for it along with other conditions that u r using to compute lis.

Sir i have tried ur approach but i am not able to make it work.

So, sir i have used comparator such that if south coordinates are equal then i have to sort using north coordinates and if south coordinates are distinct then we just have to sort north coordinates with respect to south.Testcases 1,3,4 are passing because maybe they contains distinct south coordinates.

Sir should i use lis on both and get max out of two…but Maybe problem lies with comparator could you please give me hint for testcases 0 and 2 whether it contains duplicates or the problem arising due to negative numbers.

I don’t know why i am getting runtime error in testcase 0 and 2…it should give WA

@aman89533
once check this->

do let me know if anything is not clear

Okay sir…now ur approach is clear to me.
I am trying it again…will let u know if any confusion arises.

Thank you sir

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.