Please let me know where i am going wrong.
Thanks in advance
Please let me know where i am going wrong.
Thanks in advance
// Update the code below to solve this problem
import java.util.Scanner;
class Codechef
{
public static void main (String[] args)
{
Scanner read = new Scanner(System.in);
int t = read.nextInt();
for(int i=0; i<t; i++)
{
int n = read.nextInt();
int x = read.nextInt();
int ans=(int)Math.pow(2,x);
/*System.out.println(ans)*/;
int y=ans,j;
for(j=0;j<n;j++){
y/=2;
ans-=y;
}
System.out.println(y);
}
}
}
Hope So this code might be correct I am not allowed to submit the code if you might able to test the code you can test(POV:-I don’t know much about java language)
It worked,Thank you