Freshworks interview question

string merging in random arrangements