Company X recently detected some strange text
messages being sent between customers. They
believe that these coded text messages are in
support of criminal activities. They want to be able to
automate the detection and escalation of these
messages to help avoid crime. The text message
seems to be a string of random alphanumeric
characters followed by a symbol (the last three
characters of the text message), but on closer
identification they notice that there are palindromes
within the text that correlate to spurious activity. A
palindrome is a word, phrase, or sequence that
reads the same backward as forward.
The challenge is to identify these palindromes and
assign a score. What we have noticed is the
following:
• In their scenario, a valid palindrome is defined
as having three or more characters in sequence
and can overlap each other in the sequence.
When there are two or more palindromes a
threat should be detected.
• The score can be calculated as the sum of the
length of all valid palindromes.
The cardinality of the score can be measured as
follows:
• 1-10 - Possible
• 11-40 - Probable
11-40 - Probable
• 41-150 - Escalate
• Otherwise - Ignore
As an analyst, you have been tasked to take the text
messages presented and write a programme that will
predict what your manager should do.
Constraints
• 1
All text messages will be followed by a three
character symbol