Uhhh... I'm not sure what the riddle is? I already finished all the puzzles but I have no idea how to get the ending. Are we just supposed to leave and go to the other town? I dont know why an ender portal is there.
In the third puzzle the numbers on each row and column indicate groupings of black cells. The number of digits is the number of groupings and the value of each digit is the length of each grouping. It's a little difficult to describe with only text so the example in the corner of the room might help too.