MinDistance: the fastest finding O(n * log(n)) is realized