Click here to Skip to main content
15,917,568 members

Comments by Member 13711733 (Top 4 by date)

Member 13711733 7-Mar-18 13:45pm View    
Yes. And the longest repetition which occurs at least twice is 1212.
Member 13711733 7-Mar-18 10:56am View    
That's not my definition of repetition. For me repetition is a subsequence that occurs at least twice int the sequence.
121212 - 1212
11211 - 11
111211 - 11
and so on.
Member 13711733 7-Mar-18 9:07am View    
In your case if 1212123212 returns 121212, than 11211 should return 111, not 11.
Member 13711733 7-Mar-18 2:54am View    
Thanks! But I can't rework it to do the magic without jumping. Do you think it can be done with input
new [] {1, 2, 1, 2, 1, 2, 3, 2, 1, 2})
to return
new [] {1, 2, 1, 2}