Day 5 of 365 days of coding!
Link to the video
Today we are borrowing a challenge from Codewars!
Disclaimer: This is not my challenge...
For further actions, you may consider blocking this person and/or reporting abuse
While I don't think I have an efficient way of generating the spiral, I learnt a thing or two.
My method is to rotate the grid by 90 degrees and take the top row from the grid and add it to the output.
Thx. I used so many loops in my solution at first, but your solution looks good.
But you have a little mistake in the second solution. In line where you finally reverse the whole array it shoud be arr.reverse() instead of array.reverse(). It seems you got a divergence with code from video again) Have a nice day
HAHA! thank you I ad it as array the first time and changed it lol thanks for the catch will update