My issue
it is showing nosuchelementfound
what should i do
My code
import java.util.*;
class Main
{
public static void main (String[] args)
{
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
sc.nextLine();
while(t-->=0){
String s1=sc.nextLine();
String s2=sc.nextLine();
int min=0;
int max=0;
for(int i=0;i<s1.length();i++){
char c1=s1.charAt(i);
char c2=s2.charAt(i);
if(c1=='?'&&c2=='?'){
max+=2;
}else if(c1=='?'||c2=='?'){
max+=2;
}else if(c1!=c2){
min+=1;
max+=1;
}
}
System.out.println(min+" "+max);
}
sc.close();
}
}
Learning course: Roadmap to 3*
Problem Link: https://www.codechef.com/learn/course/klu-roadmap-3star/KLURMP300A/problems/CHEFSTLT