Program to find the duplicate words in a stringExplanationIn this program, we need to find out the duplicate words present in the string and display those words. To find the duplicate words from the string, we first split the string into words. We count the occurrence of each word in the string. If count is greater than 1, it implies that a word has duplicate in the string. In above example, the words highlighted in green are duplicate words. Algorithm
SolutionPythonOutput: Duplicate words in a given string : big black COutput: Duplicate words in a given string : big black JAVAOutput: Duplicate words in a given string : big black C#Output: Duplicate words in a given string : big Black PHPOutput: Duplicate words in a given string : big black Next Topic# |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India