add the solution of zigzag conversion problem in leetcode and refactor code