I have a algorithm to analysis string but it take only about 10000 characters more than that it will throw following exception
Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - constant string too long
this is the code I'm using
public static void printRepeatingStrings(String inputString, int sequenceLength) {
if (inputString.isEmpty() || sequenceLength <= 0 || sequenceLength >= inputString.length()) {
System.out.println("Invalid input");
} else {
int i = 0;
int j = i + sequenceLength;
Set<String> tempSet = new HashSet<>();
Set<String> repeatingSequences = new TreeSet<>();
while (j <= inputString.length()) {
if (!tempSet.add(inputString.substring(i, j))) {
repeatingSequences.add(inputString.substring(i, j));
}
i++;
j = i + sequenceLength;
}
for (String str : repeatingSequences) {
System.out.println(str);
}
}
}
If you can help me to fix this that will be very helpful