int[][] nearestPolice(int[][]rooms) {
		// 0: closed room
		// 1: open room 
		// 2: policeman
		int m=rooms.length, n=rooms[0].length;
		int[][] rel=new int[m][n];
		for (int i=0;i<m;++i)Arrays.fill(rel[i], Integer.MAX_VALUE);
		
		//bfs from policeman
		for (int i=0;i<m;++i) 
			for (int j=0;j<n;++j)
				if (rooms[i][j]==2)
					bfs(rooms,rel,i,j);
		return rel;
	}