Premium problem81. Generate Shifted Rows

Hard Locked

Given Z = [1..14], generate R = [[1,2,3,4],[2,3,4,5],...,[11,12,13,14]] using a size-4 sliding window.

Input

[ 1  2  3  4  5  6  7  8  9 10 11 12 13 14]

Output

[[ 1  2  3  4]
 [ 2  3  4  5]
 [ 3  4  5  6]
 [ 4  5  6  7]
 [ 5  6  7  8]
 [ 6  7  8  9]
 [ 7  8  9 10]
 [ 8  9 10 11]
 [ 9 10 11 12]
 [10 11 12 13]
 [11 12 13 14]]

Premium problem

This one's part of Premium. Unlock the full NumPy track plus every other premium problem on the site.

Implement solve(...)