[I'm definitely not using the formatting sandbox as a free pastebin.]
[Draft[draft for something else.]
Given two strings S
and A
, call S
a good suffix of A
if (and only if) S
is not longer than one third of the length of A
, and is longer than 2 characters.
The challengeNote: Given arbitrarily many (more than 4) words, your goal is to find the longest string thatThis question is a good suffix of all of them.
If there's no such string, do not make any output.
All given words are separated by spaces; they only contain lower case English alphabetsoff-topic for Stack Overflow.
You can use any way to accept input, but output should only be in STDOUT See How to download video with blob url? on Super User instead.