Assign elements at index, index+1, index+2 into array

to avoid any confusion: the Collection.windows(ofCount:) method is from the swift-algorithms package. it does not come with the toolchain.

it is also available on Array, though there is no way of knowing this via the docs, because Collection.windows(ofCount:) is dark API.

3 Likes