C
C
ConradToWin2019-11-05 00:02:03
Python
ConradToWin, 2019-11-05 00:02:03

What algorithm should be used for this task?

I have a task:
"Trees grow along the alley. Trees have different heights. To create a landscape design, make a decision to cut down some of the trees and leave only trees that grow in height. Knowing the number of trees and the height of each tree, it is necessary to determine the largest number For example, if 9 trees grow along the alley and their height is: 5 8 3 2 6 4 5 3 7, then only 4 trees (3 4 5 7 or 2 4 5 7)."
And the algorithm/solution is preferably in Python
. PS Sorry for the "Do it for me" plan question. I've been sitting for an hour already, thinking, but I can't even understand what to cling to. Thank you for your attention_

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly Stolyarov, 2019-11-05
@Ni55aN

https://e-maxx.ru/algo/longest_increasing_subseq_log

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question