Nonogram Encode
I believe you love the picture logic puzzles called nonograms and have solved many of them. This mission is the opposite: you already have a binary image, formed by strings of equal length, where a background empty cell contains whitespace and a picture cell contains 'X'.
Your goal is to create a nonogram based upon the image: write number clues for solving the image like it was hidden. Your function
should return an Array of two Arrays. The first one consists of
Arrays with numbers for the columns' clues and the second one
contains the same for the rows' clues. All Arrays of the columns' clues, as well as of
the rows' clues, should be of the same...