[Community Puzzle] Extended Hamming Codes

https://www.codingame.com/training/easy/extended-hamming-codes

Send your feedback or ask for help here!

Created by @Dogeek,validated by @selenae,@KAIn and @ATHANOR.
If you have any issues, feel free to ping them.

3Blue1Brown’s awesome video on hamming code:

Ok, I’m just not getting it. So, bit b is set if dfhjlnp has even # of 1’s? If subset dfhjlnp has an even # of 1’s then b should be set - then set bdfhjlnp would then be odd… so that’s wierd. testcase 4, no error - i get fails on b,c, and i. if I reverse it so b is off when even, test case 4 passes the parity. I don’t get it, the bit(s) to fix should be 0xFFFF&thebitsthatfail&~thebitsthatpass , if the count of the fixbits==0, its good, ==1, i fix the 1 bit, >1, more than 2 bits. Am I wrong?

No it’s the opposite, reread the description :
Bit b is a parity bit for the bits [d, f, h, j, l, n, p], meaning that the subset bdfhjlnp has an even number of 1 's.

Notice that b is included, which means it is set if dfhjlnp is odd. That way the subset as a whole has an even number of 1’s.

1 Like

yeah i got it…finally. tx. Dunno what I was thinking, didn’t realize the puzzle was actually layed out in a known format. Parity takes me back to old modem codes and CRC checksums. Puzzle imho would be seriously confusing for a beginner.

1 Like