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
The answer posted by @AdrianLeonhard is perfectly working. But if I have a sequence of 0, 1, 2, 3, 4, 3, 5, 6, 4, 7, 8, 7, 8 many might be wondering on how to get all the repeated numbers from the array.
So, I wrote this simple logic which prints all the repeated numbers with their positions
int[] arr = {0, 1, 2, 3, 4, 3, 5, 6, 4, 7, 8, 7, 8};
for(int i=0; i