hamming
to store the Hamming distances between all pairs of words.hamming
matrix.dp
to store the length of the longest subsequence ending at each word.prev
array to store the previous index in the subsequence for each word.dp
and prev
arrays based on the conditions.dp
array.prev
array.