Let the heights be 1,2,3,4,5,6
C D 6
1 A B
This should be the arrangement.
Hence we are left with 4 unknown positions A,B,C,D corresponding to 2,3,4,5 (not in the same order)
Now, for D:
D>A and D>C
Hence D should be greater than at least 2 elements out of 2,3,4,5
Which means D can be 4 or 5
Now, for C,
C
So C can be 2 or 3 or 4
When D = 4, C can be 2 or 3 -> 2 ways
When D = 5, C can take 2 or 3 or 4. -> 3 ways
Hence total 5 ways.