Write a program that will find the longest common substring from a series of two to many words given to you by the user. For example, your program will ask the user how many words he/she wants to compare, with two being the minimum input. The longest common substring of the strings “QWERTY”, “TEWERU”, “YWERQT” is WER. Your algorithm should work for any number of inputs (words), if there is no match of common substrings, indicate to the user with a message. A common algorithm to follow when making this program is first to prompt the user for how many words he/she wants to compare (check for valid input of a number 2 to ‘n’) and then prompt the user for the strings (words) and following this return the common substring if one is present.
Write a program that will find the longest common substring from a series of two to many words given to you by the user. For example, your program will ask the user how many words he/she wants to compare, with two being the minimum input. The longest common substring of the strings “QWERTY”, “TEWERU”, “YWERQT” is WER. Your
Step by step
Solved in 4 steps with 3 images