Skip to main content
added 759 characters in body
Source Link
naffetS
  • 13.1k
  • 2
  • 22
  • 54

Vyxal, 15 bytes

ė2ḋƛ∩÷Ṙ¹∇Ȧ;‡⁰꘍∵ 

Try it Online!

ė2ḋƛ∩÷ could be ẏ2ḋƛ¹İ for the same byte count.

ė2ḋƛ∩÷Ṙ¹∇Ȧ;‡⁰꘍∵ ė # Enumerate, make a list [index, x] for each x in the first input. 2ḋ # Combinations without replacement of length 2; pairs. ƛ # For each: ∩ # Transpose ÷ # Dump; push both items onto the stack. Ṙ # Reverse the top pair (the pair of two characters). Call this Y, and the other pair X. ¹ # Push the first input ∇ # Push it under the top two values of the stack, aka c,a,b. Ȧ # Assign; replace each of the indices in X with the corresponding value in Y. ; # Close map. ‡ ∵ # Minimum by: ⁰꘍ # Levenshtein distance with the second input. 

Vyxal, 15 bytes

ė2ḋƛ∩÷Ṙ¹∇Ȧ;‡⁰꘍∵ 

Try it Online!

ė2ḋƛ∩÷ could be ẏ2ḋƛ¹İ for the same byte count.

Vyxal, 15 bytes

ė2ḋƛ∩÷Ṙ¹∇Ȧ;‡⁰꘍∵ 

Try it Online!

ė2ḋƛ∩÷ could be ẏ2ḋƛ¹İ for the same byte count.

ė2ḋƛ∩÷Ṙ¹∇Ȧ;‡⁰꘍∵ ė # Enumerate, make a list [index, x] for each x in the first input. 2ḋ # Combinations without replacement of length 2; pairs. ƛ # For each: ∩ # Transpose ÷ # Dump; push both items onto the stack. Ṙ # Reverse the top pair (the pair of two characters). Call this Y, and the other pair X. ¹ # Push the first input ∇ # Push it under the top two values of the stack, aka c,a,b. Ȧ # Assign; replace each of the indices in X with the corresponding value in Y. ; # Close map. ‡ ∵ # Minimum by: ⁰꘍ # Levenshtein distance with the second input. 
deleted 515 characters in body
Source Link
naffetS
  • 13.1k
  • 2
  • 22
  • 54

Vyxal, 1815 bytes

ẏ:£2ḋƛḂ¥∇Ŀ¹İ∑;‡⁰꘍∵ė2ḋƛ∩÷Ṙ¹∇Ȧ;‡⁰꘍∵ 

Try it Online!Try it Online!

Onceė2ḋƛ∩÷ could be this is fixed, something like this will work:

Vyxal, 15 bytes

ẏ2ḋƛ¹İṘ¹∇Ȧ;‡⁰꘍∵ 

Try it Online!ẏ2ḋƛ¹İ for the same byte count.

Vyxal, 18 bytes

ẏ:£2ḋƛḂ¥∇Ŀ¹İ∑;‡⁰꘍∵ 

Try it Online!

Once this is fixed, something like this will work:

Vyxal, 15 bytes

ẏ2ḋƛ¹İṘ¹∇Ȧ;‡⁰꘍∵ 

Try it Online!

Vyxal, 15 bytes

ė2ḋƛ∩÷Ṙ¹∇Ȧ;‡⁰꘍∵ 

Try it Online!

ė2ḋƛ∩÷ could be ẏ2ḋƛ¹İ for the same byte count.

deleted 5 characters in body
Source Link
naffetS
  • 13.1k
  • 2
  • 22
  • 54

Vyxal, 18 bytes

ẏ:£2ḋƛḂ¥∇Ŀ¹İ∑;‡⁰꘍∵ 

Try it Online!

Once this is fixed, something like this will work:

Vyxal, 1415 bytes

ẏ2ḋƛ¹İ¹∇Ȧ;‡⁰꘍∵ẏ2ḋƛ¹İṘ¹∇Ȧ;‡⁰꘍∵ 

Don't yet try it online!Try it Online!

Vyxal, 18 bytes

ẏ:£2ḋƛḂ¥∇Ŀ¹İ∑;‡⁰꘍∵ 

Try it Online!

Once this is fixed, something like this will work:

Vyxal, 14 bytes

ẏ2ḋƛ¹İ¹∇Ȧ;‡⁰꘍∵ 

Don't yet try it online!

Vyxal, 18 bytes

ẏ:£2ḋƛḂ¥∇Ŀ¹İ∑;‡⁰꘍∵ 

Try it Online!

Once this is fixed, something like this will work:

Vyxal, 15 bytes

ẏ2ḋƛ¹İṘ¹∇Ȧ;‡⁰꘍∵ 

Try it Online!

added 513 characters in body
Source Link
naffetS
  • 13.1k
  • 2
  • 22
  • 54
Loading
Source Link
naffetS
  • 13.1k
  • 2
  • 22
  • 54
Loading