For this Question: You are given the number N. You need to convert it to 1 in the minimum number of operations.
The operations allowed are as follows:
1. If N is even then divide the number by 2.
2. If N is odd then you can either add 1 to it or subtract 1 from it.
Using the above operations, find the minimum number of operations required to convert N to 1.The first line of input contains an integer T denoting the number of test cases. T test cases follow.  Each test case contains 1 line of input containing integer N.

<b>Constraints:</b>
1 &le; T &le; 100
1 &le; N &le; 10<sup>7</sup>
For each testcase, in a new line, print the minimum number of steps required.Sample Input:
4
1
2
3
4

Sample Output:
0
1
2
2

<b>Explanation:</b>
1 can be converted into 1 in 0 steps.
2 can be converted into 1 in 1 step: 2/2=1
3 can be converted into 1 in 3 steps: 3-1= 2 then 2/2=1
4 can be converted into 1 in 2 steps:  4/2=2 then 2/2=1, I have written this Solution Code: def stepCount(n):
    count = 0
    while n > 1:
        if n % 2 == 0:            
            n = n // 2
        elif n == 3 or n % 4 == 1: 
            n = n - 1
        else:                     
            n = n + 1
        count += 1
    return count


t=int(input())
for _ in range(t):
	n=int(input())
	print(stepCount(n)), In this Programming Language: Python, Now tell me if this Code is compilable or not?