davidktw
Arch-Supremacy Member
- Joined
- Apr 15, 2010
- Messages
- 13,550
- Reaction score
- 1,302
PROBLEM
Given a string of alphanumeric characters [A-Z0-9] of length range [10-1000], produce a regular expression that will find the first sequence of distinct characters(substring) of length 5.
That means given the found substring ABCDE, the distinct characters are 5 while the substring ABABA, the distinct characters are 2 only since the unique characters are only A and B.
Only output if there is such a substring found.
INPUT
OUTPUT
Happy New Year.

Given a string of alphanumeric characters [A-Z0-9] of length range [10-1000], produce a regular expression that will find the first sequence of distinct characters(substring) of length 5.
That means given the found substring ABCDE, the distinct characters are 5 while the substring ABABA, the distinct characters are 2 only since the unique characters are only A and B.
Only output if there is such a substring found.
INPUT
Code:
WZ8JL74NK2UU4A3NGW7T3PBXZCRQDI1U
V11FTVO5KBJ3XVAJQN4FY9GWX0V4DH4X
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAABCDDABCDEAAAAAA
OUTPUT
Code:
WZ8JL
1FTVO
ABCDE
Happy New Year.