Hello Everyone!!
I m new to Java programming though i now a bit of C++. Can anyone tell me where i am getting an error.
import java.util.*;
import java.lang.*;
import java.io.*;
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int T,N,count=0,i;
T=Integer.parseInt(br.readLine());
while(T>0)
{
N=Integer.parseInt(br.readLine());
Long A[] = new Long[N];
Long B[] = new Long[N];
String input1[] = br.readLine().split(" ");
String input2[] = br.readLine().split(" ");
for(i=0;i<N;i++)
{
A[i]=Long.parseLong(input1[i]);
B[i]=Long.parseLong(input2[i]);
}
for(i=0;i<N;i++)
{
if(i==0)
{
if(A[i]>=B[i])
{
count++;
}
}
else
{
if((A[i]-A[i-1])>=B[i])
{
count++;
}
}
}
System.out.println(count);
count=0;
}
}
}
For better understanding the link to my code is :-
https://www.codechef.com/viewsolution/14269215
The error shown is:-
Exception in thread “main” java.lang.NumberFormatException: null at java.lang.Integer.parseInt(Integer.java:542) at java.lang.Integer.parseInt(Integer.java:615) at Codechef.main(Main.java:14)