add the solution of spiral matrix problem in leetcode and refactor code