If I have a string which has been mutated in two different ways, is there any way I could combine these into one, with just one function, using the original and the two mutated ones? Like an automatic merge in github?
Example input/output:
Original: "I have a boat",
Mut1: "I have boat" - deletion of "a"
Mut1: "I have a boat, cool." - add of ", cool"
-> "I have boat, cool." - both changes included
Why I want this:
I have a webapp in which multiple people can edit text and every 10 sec the software looks for an update in the database. So if someone IS editing the text (change1) and someone else has updated the text (change2), then the original text is still saved at the person who is currently editing the text. That way you know change1 and change2 is based on the original text. When the update comes (change2) to the person doing change1 I want to merge the two texts.