For example, if k = 3
and x = [2,3,3,2,1,6]
, then a = 2
and b = [3,3,2,1,6]
. The prefix is [3,3,2,1,6]
. We tack a-1
to it and get [3,3,2,1,6,1]
. Repeat k
times to get [3,3,2,1,6,1,3,3,2,1,6,1,3,3,2,1,6,1]
. Concatenate with b
to get [3,3,2,1,6,1,3,3,2,1,6,1,3,3,2,1,6,1,3,3,2,1,6]
.