Add support for duplicated items in the list
Refactored algorithm to explicitly update the picked index. Without this change algorithm was working properly only when the unique values were provided.
Refactored algorithm to explicitly update the picked index. Without this change algorithm was working properly only when the unique values were provided.