Go Fish!
Given a school of fish, for example:
><> ><> ><> ><> ><>
<>< <>< ><> <>< ><>
><> ><> ><><>< ><>><> <><
><> ><> <>< ><> <><
><> ><> ><> ><> ><>
><> <><<>< ><> <><><> ><> ><>
><> ><> ><> ><> <><
><> ><> <>< <>< ><> ><>
give an output that tells how many fish tails are in each column. Eg., in the above example, there is 1 tail in the 0
column, 3 tails in the 1
column, 2 tails in the 2
column, and so on... so the output would be:
1321101102211100003000321110110131012200013200
Output can be in any (reasonable) format: a string, array of integers, etc.
I shouldn't need to clarify: the tail of the fish is this part:
><> <><
^ ^
Input Rules:
The fish can be facing either direction:
<><
or><>
and are allowed to touch each other:
<><<><
,><>><>
,<><><>
,><><><
Only valid fish will be included in the input
There is an unlimited amount of fish per row, but never more than 15 rows. Each row has trailing whitespace stripped.
Test Cases:
><>
100
<><
001
><>><> <><
<><<><><>
><>><><><><>
200300111200
><><><><><><><><><><>
100001100001100001100
#Standard-rules-apply #Code-Golf #Have-fun