You are given a 2-D integer array boxes where each element is [w, h] representing the width and height of a box.
A box A can fit inside box B only if both the width and height of A are strictly smaller than those of B.
Find the maximum number of boxes you can nest one inside another.
(Note: Boxes cannot be rotated.)
Input: boxes = [[4,5],[7,6],[8,9],[3,4]]
Output: 3
Explanation:
One optimal nesting is [3,4] → [4,5] → [8,9], giving a chain of length 3.
Input: boxes = [[2,2],[2,2],[2,2]]
Output: 1
Explanation:
All boxes are identical, so only one can be chosen.
Accepted:
Submission: