# [Husk], 21 bytes

    ;moJ'-?I§e←→ε†sġ§=…eO

[Try it online!][TIO-kgxrmy49]

[Husk]: https://github.com/barbuz/Husk
[TIO-kgxrmy49]: https://tio.run/##AUEAvv9odXNr//87bW9KJy0/ScKnZeKGkOKGks614oCgc8Shwqc94oCmZU////9bOSwxMywzLDExLDgsNCwxMCwxNSw2XQ "Husk – Try It Online"

A bit lacking in the strings department, but does well.

No matter what I tried, it somehow stubbornly stayed at 21.

## Explanation
```
;moJ'-?I§e←→ε†sġ§=…eO
                    O order the list
               ġ      group the list by the following:
                   e  elements paired
                §=    equal
                  …   the range between them?
             †s       convert all the numbers to strings
 mo                   map each group to the following:
      ?     ε         if it's a single element:
       I              leave as is
        §e←→          otherwise, move the first and last elements to a list
   J'-                join with '-'
;                     nest to display in one line