Longest chain of nesting boxes
Each box in boxes is [width, height]. A box fits inside another only when it is strictly smaller in both width and height, and boxes can't be rotated. Return the largest number of boxes you can nest one inside the next, like Russian dolls.
boxes has 0 to 10,000 boxes with sides from 1 to 100,000, possibly repeated. Aim for O(n log n) time.
Besides the tests, one large input (4,500 boxes) with a ~200 ms limit (scaled to your device's speed): brute force won't pass.
Examples
max_nested([[5,4],[6,4],[6,7],[2,3]])→3max_nested([[1,2],[1,3],[1,4]])→1max_nested([[3,1],[1,3],[2,2]])→1