Hamming Distance#11432

Hamming Distance

1 segundo
128 megabytes
Fácil

The Hamming distance between two strings and of equal length is the number of positions where the strings differ.

You are given bit strings, each of length and your task is to calculate the minimum Hamming distance between two strings.

Entrada

The first line has two integers n\:(2 \le n \le 2 ⋅ 10^4) and k\:(1 \le k \le 30): the number of bit strings and their length.

Then there are lines each consisting of one bit string of length .

Salida

Print the minimum Hamming distance between two strings.

Ejemplos

Ejemplo 1

Loading
Loading