I am using java 8 and I am trying to implement an algorithm to try to find the correct name in a list or else, the closest name.
For example :
**Name**
Smith Johnson Williams Brown
**Lists of names**
Johnson
Johnson Williams Brown
Smith Johnson Brown Williams
Smith Johnson
Smith Williams Brown Johnson
In this case, the algorithm must return "Smith Johnson Brown Williams" because of the order of the strings.
Of course if we add "Smith Johnson Williams Brown" to the list of names, it will return only this name, but if it's not present, we have to return the closest name regarding the order.
Can any one help on this please?
Thank you.