Sum of Two Arrays

import java.util.*;
public class Main {
public static void main (String args[]) {
Scanner s = new Scanner(System.in);
int n = s.nextInt() ;
int []a = new int[n] ;
for (int i = 0 ; i < n ; i++){
a[i] = s.nextInt();
}
int m = s.nextInt() ;
int []b = new int[m] ;
for (int i = 0 ; i < m ; i++){
b[i] = s.nextInt() ;
}
int []ans = sum(a , b);
for (int val : ans){
System.out.print(val + ", ");
}
System.out.println(“END”);
}
public static int[] sum(int []a , int []b){
int []c = new int [a.length + b.length];
int k = 0 , i = a.length-1 , j = b.length-1 ;
while (i >= 0 && j >= 0){
int t = a[i] + b[j] ;
c[k+1] = 0 + t/10 ;
if (t/10 > 0){
c[k] = c[k] + t%10 ;
}
else{
c[k] = t + c[k] ;
}
k++ ;
j-- ;
i-- ;
}
if (i > j)
for ( ; i >= 0 ; i–){
c[k] = a[i] + c[k] ;
k++ ;
}
if (j > i)
for ( ; j >= 0 ; j–){
c[k] = c[k] + b[j] ;
k++ ;
}
int t ;
if (a.length == b.length && (a[0] + b[0])/10 > 0){
t = k ;
}else{
t = k-1 ;
}
int []arr = new int [k] ;
int p = 0 ;
for ( ; t >= 0 ; t–){
arr[p] = c[t] ;
p++ ;
}
return arr ;
}
}
why two test cases are giving run time error ?
Pls help to correct the code