On Sunday, 10 May 2020 at 10:02:18 UTC, Adnan wrote:
In my naive implementation of edit-distance finder, I have to
check whether the last characters of two strings match:
ulong editDistance(const string a, const string b) {
if (a.length == 0)
return b.length;
if (b.length ==
On 10.05.20 12:02, Adnan wrote:
ulong editDistance(const string a, const string b) {
if (a.length == 0)
return b.length;
if (b.length == 0)
return a.length;
const auto delt = a[$ - 1] == b[$ - 1] ? 0 : 1;
import std.algorithm : min;
return min(
In my naive implementation of edit-distance finder, I have to
check whether the last characters of two strings match:
ulong editDistance(const string a, const string b) {
if (a.length == 0)
return b.length;
if (b.length == 0)
return a.length;
const auto delt = a[