Implement a solution easier to understand and with less edge cases for spiral matrix problem.