Lee distance
In coding theory, the Lee distance is a distance between two strings x 1 x 2 … x n {\displaystyle x_{1}x_{2}\dots x_{n}} and y 1 y 2 … y n {\displaystyle y_{1}y_{2}\dots y_{n}} of equal length n over the q-ary alphabet {0, 1, …, q − 1} of size q ≥ 2. It is a metric defined as ∑ i = 1 n min ( | x i − y i | , q − | x i − y i | ) .