Caricamento dell'esercizio…
Sometimes you need to combine the characters from two strings and keep only the unique ones. Write longest, which takes strings s1 and s2, collects every character that appears in at least one of them, removes duplicates, and sorts the result in ascending order. Return the final characters as one string.
"aretheyhere", "yeartroptpar""aehoprty""loopingisfunbutdangerous", "lessdangerousthancoding""abcdefghilnoprstu""inmar", "gbea""abegimnr"def longest(s1: str, s2: str) -> str:
Accedi per vedere la cronologia degli invii
AccediAccedi per usare l'AI Mentor
AccediThey run when you press "Submit" — your whole solution is checked against them so you can't hard-code answers for the visible cases.