As for the problem itself, it can be solved without finding connected components. I won't post the solution right away because it is potentially a spoiler. See for problem analysis (828B) and for an example implementation in D.

Ivan Kazmenko.

Wow I understand the question wrongly than,


I excepted there should be two B squares here.

One 3*3 and another 1*1.
And my answer would be 6 instead 12 here.

Yes if there can be only one black square than my solution would be much more simple.

One good thing about D community is when I ask a question here you guys are really nice that I get inspired.

Thanks Ivan

Reply via email to