Implemented a matrix spiral solution in Python.