So I am trying to devise a spin off of the Levenshtein algorithm, where I keep track of what transformations I did in the string(insert a, replace a for b, or delete) in strictly XQuery only.
Example:
Basically, say I am computing the edit distance of "cat" and "cbt", and am trying to transform "cbt" into "cat."
The edit distance will be 1 and the transformation will be "replace (letter at index 1) for a"
P.S. This same post was made 5 years ago, but I wish to have a solution in XQuery instead of Python, and I am finding it quite hard to do so as I am unable to use 2-D arrays (sequences).