Hi there. I think second test should produce [26, 2] due to the fact that all 2-numbers connected. See matrix illustration:
[2, x, 2, 2, 2, x]
[2, x, 2, 2, 2, 2]
[2, x, x, 2, 2, 2]
[2, x, 2, 2, x, 2]
[2, x, 2, 2, 2, 2]
[2, 2, x, x, 2, 2]
or did I misunderstand something?
Tnx in advance.