This comment is hidden because it contains spoiler information about the solution
The description says “Because of the edge-cases for tiny spirals, the size will be at least 5.”
But Ruby's test go from 0 to 5+
Please change either tests or task description.
There is typo in Ruby version.
Starting code is:
# MOD = 998244353 has been predefined
so there is -e:5: syntax error, unexpected ':'
-e:5: syntax error, unexpected ':'
What if all data contain only sex: 'f' and method run with sex: 'm', I think it be wrong.