“Test - Basics 3” => this testcase is looking for an incorrect answer. The testcase thinks that BLACK should be at 22, but the actual answer is 36. Below is the correct answer:
As input, I see 9 rows, 9 columns. After running, black has 4 stones in each row and white has 4, with the middle column neutral. I’m wondering if I’m seeing a different input than you?
Below is what I see for input, and also after running the program:
You didn’t understand the rules properly.
For you, an intersection belongs to black if it’s closer to black than to white.
It’s not the rule.
The rule is: an intersection belongs to black if it’s surrounded by black.
So, as I said above, all central intersections are neutral.
Thanks, now I understand. My code (neutral squares are the squares equidistant from both colors) worked for all the other testcases but only failed for the third testcase. I’m surprised other players didn’t interpret this incorrectly as well, but I have never played GO.