15,917,568 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
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}