hey guys.. I am looking for something that is call...
# announcements
p
hey guys.. I am looking for something that is called
partition
in clojure in Kotlin. It basically splits up a list into groups of elements in sequence (not by predicate) and you can also specify an offset and step. For example in pseudo-code:
Copy code
[1,2,3,4,5,6].partition(n=2, offset=1) == [[1,2],[2,3],[3,4],[4,5],[5,6]]