Scala, 207204 bytes
Modified from @steenslag's Ruby answer.
Golfed version. Try it online!Try it online!
def s(a:Int*):Seq[String]={val s=a.sorted;(Seq[Seq[Int]](Seq(s(0)))/:s.sliding(2)){(c,p)=>if(p(0)+1==p(1))c.init:+(c.last:+ p+p(1)) else c:+ Seq+Seq(p(1))}.map(r=>if(r.size<2)r.mkString else s"${r(0)}-${r.last}")}
Ungolfed version. Try it online!
object Main {
def s(a: Int*): Unit = {
val sorted = a.sorted
val sortedRanges = sorted.sliding(2).foldLeft(List[List[Int]](List(sorted.head))) { (acc, pair) =>
if (pair(0) + 1 == pair(1)) acc.init :+ (acc.last :+ pair(1))
else acc :+ List(pair(1))
}
val ranges = sortedRanges.map(range => if (range.size < 2) range.mkString else s"${range.head}-${range.last}")
println(ranges.mkString(" "))
}
def main(args: Array[String]): Unit = {
s(9, 13, 3, 11, 8, 4, 10, 15, 6)
}
}