How to encode positional information of a string in a NN effectively
If you just want to compare the letter and position, you could just use the strings as lists of characters and either compare up to the index of the shortest list or by sliding the shorter list over the longer list and grabbing the average number of matches.

Depending on your needs though I would recommend using more than just the positional data in the string. Two approaches I would probably try in addition to the above.


You could try converting the string to m length subsequences and then compare or aggregate in some way the number of matching or similar subsequences.
You could try converting the string to a regex and then compare the regex similarity.