🔥 Burn Fat Fast. Discover How! 💪

/*package whatever //do not write package name here */ import | OFF CAMPUS UPDATES

/*package whatever //do not write package name here */
import java.util.*;
import java.io.*;

class GFG {
public static void main (String[] args) {
Scanner sc = new Scanner(System.in);
String str = sc.nextLine();
int n = str.length();
int loop = sc.nextInt();
for(int i=0; i int a = sc.nextInt();
int b = sc.nextInt();
int count= 0;
while(b char firstVal = str.charAt(a);
char secondVal = str.charAt(b);
int compareOneTwo = Character.compare(firstVal, secondVal);
if(compareOneTwo == 0){
count= count +1;
}
else{
break;
}
a+=1;
b+=1;
}
System.out.println(count);


}
}
}

JAVA
Single file question program