Coding exercise: build a message filtering system that processes a stream of messages (words separated by spaces) and removes duplicate words while keeping the original order of first appearance. Matching ignores case ('Hello' and 'hello' are the same word) but the output keeps the case of the first occurrence; return the filtered message with single spaces between words and handle empty or single-word input.
Asked in the Coding exercise (after AI interview; reviewed by AI plus human) stage. The narrator read the prompt and examples on screen and solved it in Python.
Implement def filter_message(message):. The input is a string, and the output is a string containing each distinct word once, separated by single spaces.
def filter_message(message):