Here is an example of an input of monoliths. There are 4 in this example.
_
| | _
| | _ | |
| | | | | | _
_| |_| |___| |____| |_
The first monolith is 4 units high, the second is 2, the third is 3, and the last is 1.
The task
Your program should output the heights of the monoliths in order from left to right. The output format can be in any sort of list or array.
Notes
- The input can be taken as any dimensional string, list of strings, or list of characters.
- This is code-golf, so lowest bytes wins.
- You are to assume that monoliths always have the same width, and are always at least 1
_
away from another. - They can come in any height, and in any quantity.
I/O
_
| | _
| | _ | |
| | | | | | _
_| |_| |___| |____| |_ >> [4,2,3,1]
_
| |
_ | |
| | _ | | _
_| |_| |__| |_| |_ >> [2,1,4,1]
_ _ _
| |_| |_| |_____ >> [1,1,1]
____________________ >> undefined behavior
_
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | >> [11]
_ _ _ _ _
_ | | _ | | _ | | _ | | _ | |
| |_| |_| |_| |_| |_| |_| |_| |_| |_| | >> [1,2,1,2,1,2,1,2,1,2]
[10]
monolith not[11]
? \$\endgroup\$_
on top as in the test cases, or merely that they always have the same width per input? \$\endgroup\$