Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to solve the problem of circus tower by leetcode

Shulou Source: shulou.com Published: 2022-06-01 13:08:50 10月03日 Update

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

Tags: Circus circus problem height individual code weight content actual faceted learning sorting practical deeper longest same beautiful interested ascending practical Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Microsoft macOS Docker Huawei