/* Name of the class has to be “Main” only if the class is public. */
class Codechef
{
public static void main (String[] args) throws IOException
{
// your code goes here
InputStreamReader read=new InputStreamReader(System.in);
BufferedReader in=new BufferedReader(read);
int testCase,i,j,noOfElement,k1=0,k2=0,inp,ans;
testCase=Integer.parseInt(in.readLine());
for(i=0;i<testCase;i++)
{
k1=0;
k2=0;
ans=0;
noOfElement=Integer.parseInt(in.readLine());
for(j=0;j<noOfElement;j++)
{
inp=Integer.parseInt(in.readLine());
if(inp==2)
{
k1++;
}
if(inp==0)
{
k2++;
}
}
I have encountered similar errors for many solutions.
Can someone please help me deal with this problem?
Both scanner and buffered reader have caused similar errors for me before.