Excel VBA, 71 Bytes
Anonymous VBE immediate window function that take input from range [A1:B1] and outputs to the VBE immediate window.
For i=1To[Len(A1)]:[C1]=i:?[Rept(Mid(A1,C1,1),B1^(Mod(C1,B1)=1))];:Next
Taylor Raine
- 9k
- 2
- 29
- 53