Lengthen letter runs
Python 3, 44 bytes
for c in input():print(c,end=c[id==c:]);id=c
Try it online!
05AB1E, 5 bytes
.¡€ĆJ
Explanation:
Example input: "dddogg"
.¡ Split into chunks of consecutive equal elements
stack: [['ddd', 'o', 'gg']]
€ For each...
Ć Enclose; append the first character to the end of the string
stack: [['dddd', 'oo', 'ggg']]
J Join array elements into one string
stack: ['ddddooggg']
Implicitly output top element in stack: "ddddooggg"
Try it online or as a test suite.
Enclose is a pretty new builtin; it's the first time I've used it. Very convenient ;)
05AB1E, 4 bytes (non-competing)
γ€ĆJ
.¡
has been replaced by γ
in the latest update.
Retina, 11 bytes
(.)\1*
$1$&
Try it online!
Replaces each run of characters with one of the run's characters followed by the run itself.