I want to write a function that when you pass in a vector as an argument, it returns the iterations of the vector ie
Any help would be much appreciated
it could look something like that:
user> (defn its [items]
(let [c (count items)]
(if (<= c 1)
items
(->> items
cycle
(partition c 1)
(take c)
(mapv vec)))))
#'user/its
user> (its [])
;;=> []
user> (its [1 2])
;;=> [[1 2] [2 1]]
user> (its [1 2 3])
;;=> [[1 2 3] [2 3 1] [3 1 2]]