This code takes a string as input from the user, splits it on spaces into an array, then removes any repeated words by comparing strings and shifting elements up. It prints the unique words one per line.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
26 views4 pages
Delete All Repeated Words in String
This code takes a string as input from the user, splits it on spaces into an array, then removes any repeated words by comparing strings and shifting elements up. It prints the unique words one per line.