Hi Craige,
Thanks for helping out. I have 1 to 5e6 and only one reference word. I basically want to filter out words that have more than 2 letter different comparing to a reference word and therefore I do not require more than yes/no or 0/1 as answer. Going through your questions:
test = "AEIOUA" // nDiff = 0 for identical string
test = "AAEIOU" // nDiff = 1 - for same letters, reordered.
- The first A is only one kept at the same position. (5 diff letters)
test = "AEIOU" // nDiff = 1 for same letters, missing one on right
test = "EIOUA" // nDiff = 1 for same letters, missing one on left
test = "EIOU" // nDiff = 1
test = "AA" // dDiff = 1
test = "AXA" // dDiff = 1
- Length is not same as AEIOUA. For this I applied a function Len to filter those words out.
test = "AXXXXA" // dDiff = 1 for matching length
- The first and last A are kept at the same position. (4 diff letters)
test = "AEIUOA" // dDiff = 0 for internal letters swapped
Only 2 letters different from AEIOUA, so it will pass the criteria.
test = "AEIOUEIOU" // nDiff = 1 for repeated letters
Long sequence. Removed using Len.
Sorry, I was not clear when explaining my question/problem. I recreated an example of what i'm looking for in addition to your questions.
Reference sequence | FEBRUARY |
| |
List of sequences | Label - more than 2 characters different from reference? |
FEBAUARY | No |
WAARUARY | Yes |
YRAURBEF | Yes |
FEBRURRR | No |
FEBRUARW | No |
YEAURBEF | Yes |
YEAURARY | Yes |