Capped string ladder Given a string s and a positive integer N, gradually duplicate each character more and more until N duplicates, and then staying at N duplicates until N characters away from the end, then step down again.

For example, given abalone and 3:

a    we start with 1 copy
bb   then 2 copies
aaa  then 3 copies, which is our second parameter
lll  so we continue using 3 copies
ooo  until we reach the end
nn   where we use 2 copies
e    and then finally 1 copy


and the result would be abbaaalllooonne.

It is guaranteed that the string has length greater than 2N and only has characters from a to z.

More testcases:

N string       output
2 aaaaa        aaaaaaaa
3 abcdabcdabcd abbcccdddaaabbbcccdddaaabbbccd


This is code-golf. Shortest answer in bytes wins. Standard loopholes apply.
Jelly, 6 bytes

JṡFṢị⁸


Try it online!

How it works

JṡFṢị⁸  Main link. Arguments: s (string), n (integer)

J       Get the indices of s.
 ṡ      Split the indices into overlapping chunks of length n.
  F     Flatten the array of chunks.
   Ṣ    Sort the resulting array of indices.
    ị⁸   Get the characters of s at these indices.


Sample run

JṡFṢị⁸  "abalone", 3

J       [1, 2, 3, 4, 5, 6, 7].
 ṡ      [[1, 2, 3], [2, 3, 4], [3, 4, 5], [4, 5, 6], [5, 6, 7]]
  F     [1, 2, 3, 2, 3, 4, 3, 4, 5, 4, 5, 6, 5, 6, 7]
   Ṣ    [1, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 7]
    ị⁸  "abbaaalllooonne"