SPOTWO - Editorial

class Codechef
{

public static void main (String[] args) throws java.lang.Exception
{
Scanner sc=new Scanner(System.in);

int t=sc.nextInt();

while(t–>0)
{
int n=sc.nextInt();

String s=Integer.toString(n,2);

int val=Integer.parseInt(s);

  BigInteger bi=new BigInteger("2");
  
  BigInteger ans=bi.pow(val*2);

System.out.println(ans);}
// your code goes here
}
}

It is showing time limit exceeded what should I do to optimize the program?