and also specify the errors in the comments why not giving correct output for t>1
Please correct the logical error
import java.util.*;
public class Main
{
public static void main(String args[])
{
String s,s1;
int i,j,t;
Scanner sc=new Scanner(System.in);
t=sc.nextInt();
for(i=0;i<t;i++)
{
s=sc.next();
s1=sc.next();
// if(s.length()<=100)
// {
// for(i=0;i<s.length();i++)
// {
// if(s.charAt(i)==s1.charAt(i))
// System.out.print(β0β);
// else
// System.out.print(β1β);
// }
for(j=0;j<s.length();j++)
{
if(s.charAt(j)==s1.charAt(j))
System.out.print("0");
else
System.out.print("1");
}
System.out.println();
// }
}
}
}
both inner and outer loop iterate with i
itβs not correct.
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.