what is wrong in my code?

code
is
my
rgame
what
with
wrong

#1

import java.util.Scanner;
class Rupsa
{
public static void main(String args[])
{
Scanner input = new Scanner(System.in);
//System.out.println("Enter umber of test cases : ");
int n = input.nextInt();
int a[][] = new int[n][];
int x,y,sum;
//System.out.println("Enter number of numbers in each test case : ");
for(int i=0;i<n;i++)
{
a* = new int[input.nextInt()+1];
for(int j=0;j<a*.length;j++)
{
a*[j] = input.nextInt();
}
}
for(int i=0;i<n;i++)
{
sum = 0;

				for(int j=0;j<a*.length;j++)
				{
					for(int k = j+1;k<a*.length;k++)
					{
						if(j<2)
						{
							sum = sum+(a*[j]*a*[k]*(int)Math.pow(2,(a*.length-k)));
						}
						else
						{
							sum = sum+(a*[j]*a*[k]*(int)Math.pow(2,(a*.length-k+1)));
						}
					}
				}
				 if(a*.length==1)
				System.out.println(a*[0]);
				else
				{		
					System.out.println(sum);
				}
			
		}
	}
}

#2

Overflow. Array’s length can be upto 10^5, you cant just Math.pow(2,10^5), it will cause heavy overflow.

If you are a beginner, skip this Q for now, its a easy-medium question as labelled by tag (IDK just WHO put it in beginner’s section…). It needs you to know some tricks, which you will learn during course of practicing (Easy section)problems and participating in contests.