Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Only keep coordinates with both <code>x</code> and <code>y</code> being strictly less than <code>coordinates[k]</code>.
Sort them by <code>x</code>’s, in the case of equal, the <code>y</code> values should be decreasing.
Calculate LIS only using <code>y</code> values.
Do the same for coordinates with both <code>x</code> and <code>y</code> being strictly larger than <code>coordinates[k]</code>.