How to find repeating sequence of Integers in an array of Integers?
00 would be repeating, so would 123123, but 01234593623 would not be.
I have an idea to h
You can always play with regular expressions to achieve a desired result. Use the regex backreference and combine it with the greedy quantifier:
void printRepeating(String arrayOfInt)
{
String regex = "(\\d+)\\1";
Pattern patt = Pattern.compile(regex);
Matcher matcher = patt.matcher(arrayOfInt);
while (matcher.find())
{
System.out.println("Repeated substring: " + matcher.group(1));
}
}