Solution to potd_3_7_14. Does not error check for invalid input or acceppt a matrix as input as a string