input: Write a python function to find the minimum number of operations to reduce a number to 1.
  assert minOperations(18) == 5
  assert minOperations(20) == 6
  assert minOperations(15) == 5
  assert minOperations(1) == 1
output: def minOperations(n):
      operations = 0
      while n > 1:
          if n % 2 == 0:
              n //= 2
          else:
              n -= 1
          operations += 1
      return operations + 1 if n == 1 else operations