It makes me confused in docs of
Seq.combinations it says
Iterates over combinations. A combination of length n is a subsequence of the original sequence, with the elements taken in order. Thus, “xy” and “yy” are both length-2 combinations of “xyy”, but “yx” is not. If there is more than one way to generate the same subsequence, only one will be returned.
And it returns
// should here be List("cb", "cc") ? scala> "cbc".combinations(2).toList val res23: List[String] = List(cc, cb) scala> "cba".combinations(2).toList val res24: List[String] = List(cb, ca, ba)
Does I misunderstanding