duplicate of https://gateoverflow.in/85928/hamming-code
Although the first parity bit can detect even-numbered bits and the second parity bit can detect odd-numbered bits, this coding scheme can only detect ALL single error for sure, that is, d=1.
Therefore, the Hamming distance is d+1=2.
Although it can sometimes detect 2 errors (one even-numbered, one odd-numbered),
it cannot detect all the 2 errors.(think about it ?? you will get answer)