Closed
Description
reproduction steps
using Scala 2.13,
"aba".combinations(3).toSeq // returns Seq("aab"), should return Seq("aba")
"abaa".combinations(3).toSeq // returns Seq("aaa", "aab"), should return Seq("aaa", "aba")
https://scastie.scala-lang.org/V3sDnjcJTTSjVq3nfKXLzA
problem
Combinations method does not seem to gracefully handle input with duplicated elements. The output does not represent an ordered combination of the input, as the docs suggest it should do
Iterates over combinations. A _combination_ of length n is a subsequence of the original sequence, with the elements taken in order.