how to solve merging repeated characters together by giving input later

by
characters
giving
input
later
merging
repeated
together

#1

alt text