Scala, 139...107104 10494 bytes
def f(s? :AnyString):Set[_]=Set(s?)++(for{i<< <-1 to s"$s"?.size-1
x<-f(s"$s"take i?take<)
y<-f(s"$s"drop i?drop<)}yield x+","+y)
A recursive solutionmethod. The input canhas to be an Int
, a String
, or any other object with the toString
string.