In this challenge, you will remove duplicate words from each sentence.
Hello Hello, World! Hello, World! Code Code! Golf Code Code! Golf Code Hello hello World Hello World Programming Golf Programming! Programming Golf!
- Input will be a string of ASCII characters.
- A sentence is defined as anything until the end of the string, a linefeed (
\n), or punctuation (
- A word is defined as a sequence of
- Words are case insensitive (
- Only the first occurrence of a word in a sentence is kept.
- If a word is removed, the spaces before the removed word should be removed. (e.g.
A A B->
- As always standard loopholes are disallowed.
This is code-golf so shortest code in bytes wins!