Solving the Spiral Matrix challenge in a functional way is a lot easier when you think about generating the index in which numbers should be placed, rather than trying to generate numbers in the right order. Hopefully the trick I am using will be made clear in the broadcast... should be an interesting one 🙂
nice
Broadcast - Saturday 09:00 UTC https://youtu.be/Z5C7X1UN8yo More coding challenge walk-throughs from http://Exercism.io. I will be walking through the Spiral Matrix challenge, which required a bit of lateral thinking, some fairly simple maths and quite a few transformations of data structures (but that is what Clojure excels at). The solution looks a little complex when put together, although it is just made up of map reduce cycle sort-by and a few other common clojure.core functions
11😺The code I'm covering tomorrow is shared on GitHub https://github.com/practicalli/exercism-clojure-guides/tree/master/spiral-matrix There is a functional approach (although its not beautiful) and a recursive function approach.
1😺