Write a program or a function that returns or prints a square-random-symmetrical matrix.
N: The size of the matrix i.e
6 x 6
The matrix. You can either print it, return it as string (with the newlines) or as a list/array of lists/arrays.
You need to use at least
Ndifferent characters, where
Nis the size of the square matrix (input). Since we 're using only letter [a, z][A, Z] and digits [0, 9] (and only 1 digit at the time) you can assume that
N < 27and
N > 2, that is because at
N <= 2you can't have both letters and digits. Last but not least, every letter/digit must have non-zero probability of occurring (uniform distribution is not a necessity). However, the result must have at least
The matrix has to be both horizontally and vertically symmetrical.
Exactly 2 rows and 2 columns must contain strictly one single-digit number (it's position should be random as well). The rest of rows/cols will contain only letters. Consider letters as [a, z] and [A, Z] and of course single-digit numbers as [0, 9].
Just to be easier, you can assume that the case of the letters doesn't matter, as long as the cases are symmetrical which means:
a=A, b=B, etc.
Every possible output must have a non-zero probability of occurring. The random distribution doesn't need to be uniform.
c r p s s p r c r k o z z o k r u t 2 a a 2 t u y n q z z q n y y n q z z q n y u t 2 a a 2 t u r k o z z o k r c r p s s p r c