First occurrence characters

Write codeEasy10 min

Your task

Given a string s, return a new string containing each character only the first time it appears, preserving the original left-to-right order. For example 'banana' becomes 'ban'. The string may be empty and may contain any printable characters.

Examples

dedup_keep_order(s: str) -> str
Example 1
Inputdedup_keep_order("banana")
Output"ban"