> For the complete documentation index, see [llms.txt](https://anton-veselskyi.gitbook.io/codding-problems-solutions/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://anton-veselskyi.gitbook.io/codding-problems-solutions/codewars/7-kyu/two-to-one.md).

# Two to One

### [Two to One](https://www.codewars.com/kata/5656b6906de340bd1b0000ac)

Take 2 strings `s1` and `s2` including only letters from `a`to `z`. Return a new **sorted** string, the longest possible, containing distinct letters,

* each taken only once - coming from s1 or s2.

## Examples:

```
a = "xyaabbbccccdefww"
b = "xxxxyyyyabklmopq"
longest(a, b) -> "abcdefklmopqwxy"

a = "abcdefghijklmnopqrstuvwxyz"
longest(a, a) -> "abcdefghijklmnopqrstuvwxyz"
```

### Solutions

#### 🐍 Python

```python
def longest(s1, s2):
    return ''.join(sorted(set( s1.join(s2))))
```
