Here's the problem:
I don't understand why they did if ((maskR >> i) & 1) == 0 and ((maskC >> j) & 1) == 0 && and c[i][j] == '#': black = black + 1.
I understand they are brute forcing all possible combinations so I get why they did (1 << H) — 1 and (1 << W) — 1. But I don't understand why the shift right maskR and maskC and check if the last bit for both is 0. What does that have to do with the solution?