I have a seq in this format -
( ([2 3 4] [7 6 8]) (["hh" 5] [9 8]))
I want to flatten it so that its a seq of vectors instead of a seq of seq of vectors. How do I do that ?
Also flatten completely flattens it, I want to only flatten it one level to - ([2 3 4] [ 7 6 8] ["hh" 5] [9 8])
Try concat
:
(apply concat seq)
(reduce (fn[h v]
(reduce (fn[s e] (conj s e)) h v))
[] [[[2 3 4] [7 6 8]] [["hh" 5] [9 8]]])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With