Given a string s containing words separated by single spaces, return a new string with duplicate words removed while keeping only the first occurrence of each word. The relative order of the remaining words must stay the same.
You are practicing as a guest. Sign up free to run your code against the sample data. Your draft stays right here.