IN THIS PROBLEM, NONE OF THE TEST CASES ARE PASSING THOUGH ALL THE MANUAL INPUTS GOT CORRECT OUTPUTS.
import java.util.*;
public class MinSteps
{
static long count;
public static long minSteps(long n)
{
if(n==0)
return count;
if((n&(n-1))==0)
{
count++;
return count;
}
else
{
count++;
n–;
}
return minSteps(n);
}
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
int T=sc.nextInt();
for(int i=0;i<T;i++)
{
count=0;
System.out.println(minSteps(sc.nextInt()));
}
}
}