Dots Game algorithm
int grid[5][5] = { {0, 1, 0, 0, 0}, {0, 0, 2, 0, 0}, {0, 2, 1, 2, 0}, {0, 2, 1, 2, 0}, {0, 0, 2, 0, 0} }; For example, given such an array and you need to count the number of elements in the island surrounded by twos like the game “dots […]