#K42122. Hamming Distance Calculation
Hamming Distance Calculation
Hamming Distance Calculation
Given two strings s1 and s2 of equal length, compute their Hamming distance, which is defined as:
\(d(s_1,s_2)=\sum_{i=1}^{n} [s_{1i} \neq s_{2i}]\)
If the two strings have different lengths, the program should output an error message "Strings must be of equal length".
Your program should read input from stdin and output the result to stdout.
inputFormat
The input consists of two lines. The first line contains the first string and the second line contains the second string. It is guaranteed that if the strings are intended to be compared, they have the same length. Otherwise, your program should handle the error case as described.
outputFormat
If the two strings have the same length, output a single integer representing the Hamming distance. If the strings have different lengths, output the error message "Strings must be of equal length".
## samplekarolin
kathrin
3