Create an auto-cucumber program Oops, Auto-correct.


You have a word. But it's wrong. You wonder what word it would be. Thankfully, being a code golfer, You can make a code to take a rough guess.

I/O

You will be given a (wrong, all lowercase) word, and a '(All lowercase)Dictionary list'. You have to output the word with the least Levenshtein distance to the wrong word. If there are multiple words of the same levenshtein distance, use the last one in the list.

Examples

Input =&gt; Output
(["apple", "banana", "orange", "pineapple"], "baenanae") =&gt; "banana"
(["zeal", "zealot", "zealotry", "zealots", "zealous", "zealously", "zealousness"], "zealousl") =&gt; "zealously"
(["abductors", "abducts", "abe", "abeam", "abel"], "") =&gt; "abe"
05AB1E, 6 bytes

Σ.L(}¤


Try it online! (note: the trailing newline on the input is necessary for the empty string case.)

How?

Σ.L(}¤ - implicitly push the first input (the dictionary list)
Σ   }  - sort the list by:
       -   implicitly push second input (the misspelled word)
 .L    -   Levenshtein distance
   (   -   negated
     ¤ - tail the sorted list  and place the entry on the top of the stack
       - implicitly print top of stack