private boolean check(char[][] map,int i,int j){
		if(ValidPosition(i-1, j) && map[i-1][j] == map[i][j] && ValidPosition(i+1, j) && map[i+1][j]==map[i][j])
			return true;
		if(ValidPosition(i-1, j) && map[i-1][j] == map[i][j] && ValidPosition(i-2, j) && map[i-2][j]==map[i][j])
			return true;
		if(ValidPosition(i+1, j) && map[i+1][j] == map[i][j] && ValidPosition(i+2, j) && map[i+2][j]==map[i][j])
			return true;
		if(ValidPosition(i, j-1) && map[i][j-1] == map[i][j] && ValidPosition(i, j+1) && map[i][j+1] ==map[i][j])
			return true;
		if(ValidPosition(i, j+1) && map[i][j+1] == map[i][j] && ValidPosition(i, j+2) && map[i][j+2] ==map[i][j])
			return true;
		if(ValidPosition(i, j-1) && map[i][j-1] == map[i][j] && ValidPosition(i, j-2) && map[i][j-2] ==map[i][j])
			return true;
		return false;
	}