First, place the tallest person on either end, then there are 4 ways to place the shortest...8
Next place the tallest in any middle position, then there are 3 ways to place the shortest....12
Then the other 4 people may be arranged in 4! ways
Total 20*4!=240
Please note: I cannot follow your logic.
Where did the 5*2 come from?

Paul M.
05/05/21