Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

Latest commit

 

History

History
executable file
·
17 lines (10 loc) · 614 Bytes

File metadata and controls

executable file
·
17 lines (10 loc) · 614 Bytes

题目

You have a number of envelopes with widths and heights given as a pair of integers (w, h). One envelope can fit into another if and only if both the width and height of one envelope is greater than the width and height of the other envelope.

What is the maximum number of envelopes can you Russian doll? (put one inside other)

Example:

Given envelopes = [[5,4],[6,4],[6,7],[2,3]], the maximum number of envelopes you can Russian doll is 3 ([2,3] => [5,4] => [6,7]).

解题思路

见程序注释