It's not mandatory that the length of the string be a square number, but when it is it's a lot easier. Also, it's a much more interesting problem to solve when allowing for any length string.

To...