windowed([1, 2, 3, 4, 5], 3) // β [[1,2,3], [2,3,4], [3,4,5]]windowed returns all consecutive sub-arrays (windows) of the given size.
Challenge: Implement windowed<T>(arr: T[], size: number): T[][] returning all contiguous subarrays of length size.
windowed([1,2,3,4,5], 3) // β [[1,2,3],[2,3,4],[3,4,5]]