Russian Doll Envelopes

easy
1. You will be given an Integer array of envelopes that consists of their widths and heights
 2. You need to find maximum number of envelopes you can put inside another much like a russian doll
 3. An envelope can only fit inside another if it's smaller than the other
 4. Input and output is handled for you
 5. It is a functional problem ,please do not modify main()
 
 NOTE: Rotatioin is not allowed

Input Format

Input is handled for you

Output Format

Output is handled for you

Constraints

Array contains ONLY positive integers

Notice

Try First, Check Solution later

1. You should first read the question and watch the question video.
2. Think of a solution approach, then try and submit the question on editor tab.
3. We strongly advise you to watch the solution video for prescribed approach.

Example

Input
5
2 9 
1 4 
7 1 
10 7 
8 3
Output
3
Previous
Rod Cutting
Next
Scramble String

Related Questions