Add semi-working solution for generating spiral for an array.