How to solve the problem of circus tower by leetcode
This article mainly explains "how to solve the circus tower problem by leetcode". Interested friends might as well take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "how to solve the circus tower problem by leetcode".
A circus is designing a stack of performances in which one person has to stand on the shoulder of the other. For practical and aesthetic reasons, the people above are shorter and lighter than those below. Given the height and weight of everyone in the circus, please write code to calculate how many people you can stack.
Example:
Input: height = [65, 70, 56, 75, 60, 68] weight = [100, 150, 90, 190, 110]
Output: 6
Explanation: stacked Lohan can stack up to 6 layers from top to bottom: (56, 90), (60, 95), (65100), (68110), (70150), (75190)
Tip:
Height.length = = weight.length