文字列を考えるsと、正の整数N、徐々にまで、より多くの各文字を複製しN、重複した後に滞在Nするまで、重複N離れた端から文字、再びステップダウン。
例えば、与えられたabaloneと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
結果はになりますabbaaalllooonne。
文字列の長さは以上で2N、からaまでの文字のみであることが保証されていますz。
その他のテストケース:
N string output
2 aaaaa aaaaaaaa
3 abcdabcdabcd abbcccdddaaabbbcccdddaaabbbccd