windows

From The K Language Wiki
Windows
a f':y
a':y

windows or stencil is used to apply a monadic function to each a-size overlapping windows of the list y.

To simply get windows of an array, f can be omitted.

  3':1 2 3 4 5 6
(1 2 3
 2 3 4
 3 4 5
 4 5 6)

  3 +/':1 2 3 4 5 6
6 9 12 15