Thanks for the explaination,

See,My Logic was that First i calculated number of ‘#’ in input matrix,then i converted maskR & maskC into their binary representation using bitsets and if their are ones in their binary representations (that means elements in selected rows and columns are painted red)then i checked if their are ‘#’ in selected rows and columns or not ,then i subtracted those number of ‘#’ from total number of ‘#’ and if the number of left ‘#’ are equal to k then i incremented my answer.

This is my AC Solution:Click Here

But i didn’t get what are trying to do in these lines,i mean can you explain it in layman language:

```
{
if(grid[k][l]!='#')continue;
if((i&(1<<k))!=0 || (j&(1<<l))!=0){
continue;
}
++counter;
```

I am really sorry for the dumbness,i know it’s a simple thing but it’s not getting into my head!

Can You explain in layman language(these above lines of your code)?

Thanks Again!