def update_bits(n, m, i, j):
    max = ~0
left = max - ((1 << j + 1) - 1)
right = (1 << i) - 1
mask = left | right
return n & mask | m << i
Given two 32-bit numbers, N and M, and two bit positions, i and j. Write a method to set all bits between i and j in N equal to M