Check if any adjacent cell is same
if ( i + rowN [ k ] >= 0 && i + rowN [ k ] < n && j + colN [ k ] >= 0 && j + colN [ k ] < m && v [ ( i + rowN [ k ] ) , ( j + colN [ k ] ) ] == ch ) { return false ; } }