public int rangeBitwiseAnd(int m, int n) {
		if (m == n)
			return m;

		int ret = 0;
		for (int i = 30; i >= 0; i--) {
			if ((n >> i & 1) == 1) {
				if ((m >> i & 1) == 1)
					ret |= 1 << i;
				else
					return ret;
			}
		}

		return 0;
	}