Russian Doll Envelopes

Hard

📝 Description

Find maximum envelopes you can stack (one inside another)

Input Format

Pairs of width,height (space-separated)

Output Format

Maximum stack size

Constraints

1 ≤ envelopes.length ≤ 10^5

🔍 Sample Input

5 4 6 4 6 7 2 3
            

✅ Sample Output

3
            

Code Editor

Please login to run and submit code.

Shortcuts: Ctrl+Enter to submit, Ctrl+Shift+R to run