Challenge arrays(ultra fast mathematics)

sir once see my code plz

import java.util.Scanner;

public class Main {
static Scanner s=new Scanner(System.in);
public static void main(String a[]) {
int n=s.nextInt();
s.nextLine();
String[] str1 =new String[n];
String[] str2 =new String[n];
for(int i=0;i<n;i++) {
str1[i]=s.nextLine();
str2[i]=s.nextLine();
}
for(int i=0 ;i<n ;i++) {
int len=str1[i].length();
for(int j=0 ;j <len ;j++) {
char ch1=str1[i].charAt(j);
char ch2=str2[i].charAt(j);
if(ch1==ch2) {
System.out.print(β€œ0”);
}else {
System.out.print(β€œ1”);
}
}
}
}
}

@sameeksha,

Don’t use s.nextLine(); for input. Instead use s.next(); because the inputs are given in a single line. Also, after printing the output of a test case print, the next output in the next line. So add a println statement after that. I have attached the corrected code below.

https://ide.codingblocks.com/s/258882 corrected code.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.