input: Write a python function to find the maximum number of consecutive 1s in the binary representation of a given integer.
  assert max_consecutive_ones(14) == 3  # 14 in binary is '1110'
  assert max_consecutive_ones(222) == 4  # 222 in binary is '11011110'
  assert max_consecutive_ones(29) == 2  # 29 in binary is '11101'
output: def max_consecutive_ones(n):
      binary_representation = bin(n)[2:]  # Convert number to binary and strip the '0b' prefix
      max_ones = 0
      current_ones = 0
  
      for digit in binary_representation:
          if digit == '1':
              current_ones += 1
              if current_ones > max_ones:
                  max_ones = current_ones
          else:
              current_ones = 0
  
      return max_ones