### 12337 - Bob's Beautiful Balls

Posted:

**Fri Jan 31, 2014 11:41 pm**I keep getting WA for this problem. I'm transforming the string into a matrix (spiral) and then comparing checking if each column has only one color.

I tried these cases myself

Thank you

I tried these cases myself

Can anyone help with more test cases that I can check?Sample Input

7

BGWBBGGGBBWGBBGWBB

GBBWBBWBBB

BBBBBBBBBBBBBBB

GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGWW

GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG

GGGGGGGGGGGG

BGWBBGGGBBWGBBGWBBB

BBBBWWBBBB

Output for Sample Input

Case 1: 9

Case 2: -1

Case 3: 8

Case 4: -1

Case 5: 20

Case 6: 7

Case 7: -1

Case 8: 7

Thank you