Skip to main content
deleted 61 characters in body
Source Link
user
  • 357
  • 2
  • 21
  • 68

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)

Try it online!Try it online!

A recursive solutionmethod. The input canhas to be an Int, a String, or any other object with the toStringstring.

Scala, 139...107 104 bytes

def f(s:Any):Set[_]=Set(s)++(for{i<-1 to s"$s".size-1
x<-f(s"$s"take i)
y<-f(s"$s"drop i)}yield x+","+y)

Try it online!

A recursive solution. The input can be an Int, a String, or any other object with the toString.

Scala, 139...104 94 bytes

def f(? :String):Set[_]=Set(?)++(for{< <-1 to?.size-1
x<-f(?take<)
y<-f(?drop<)}yield x+","+y)

Try it online!

A recursive method. The input has to be a string.

deleted 16 characters in body
Source Link
user
  • 357
  • 2
  • 21
  • 68

Scala, 139...127107 107104 bytes

def f(s:Any):Set[Any]=SetSet[_]=Set(s)++(for{i<-1 to s"$s".size-1
(a,b)=s"$s"splitAt i
x<-f(as"$s"take i)
y<-f(bs"$s"drop i)}yield x+","+y)

Try it online!Try it online!

A recursive solution. The input can be an Int, a String, or any other object with the toString.

Scala, 139...127 107 bytes

def f(s:Any):Set[Any]=Set(s)++(for{i<-1 to s"$s".size-1
(a,b)=s"$s"splitAt i
x<-f(a)
y<-f(b)}yield x+","+y)

Try it online!

A recursive solution. The input can be an Int, a String, or any other object with the toString.

Scala, 139...107 104 bytes

def f(s:Any):Set[_]=Set(s)++(for{i<-1 to s"$s".size-1
x<-f(s"$s"take i)
y<-f(s"$s"drop i)}yield x+","+y)

Try it online!

A recursive solution. The input can be an Int, a String, or any other object with the toString.

deleted 21 characters in body
Source Link
user
  • 357
  • 2
  • 21
  • 68

Scala, 139...127 114107 bytes

def f(s:Any):Set[Seq[Any]]=Set(SeqSet[Any]=Set(s))++(for{i<-1 to s"$s".size-1
(a,b)=s"$s"splitAt i
x<-f(a)
y<-f(b)}yield x++yx+","+y)

Try it online!Try it online!

A recursive solution. The input can be an Int, a String, or any other object with the toString.

Scala, 139...127 114 bytes

def f(s:Any):Set[Seq[Any]]=Set(Seq(s))++(for{i<-1 to s"$s".size-1
(a,b)=s"$s"splitAt i
x<-f(a)
y<-f(b)}yield x++y)

Try it online!

A recursive solution. The input can be an Int, a String, or any other object with the toString.

Scala, 139...127 107 bytes

def f(s:Any):Set[Any]=Set(s)++(for{i<-1 to s"$s".size-1
(a,b)=s"$s"splitAt i
x<-f(a)
y<-f(b)}yield x+","+y)

Try it online!

A recursive solution. The input can be an Int, a String, or any other object with the toString.

deleted 1342 characters in body
Source Link
user
  • 357
  • 2
  • 21
  • 68
Loading
added 4 characters in body
Source Link
user
  • 357
  • 2
  • 21
  • 68
Loading
added 99 characters in body
Source Link
user
  • 357
  • 2
  • 21
  • 68
Loading
added 736 characters in body
Source Link
user
  • 357
  • 2
  • 21
  • 68
Loading
Source Link
user
  • 357
  • 2
  • 21
  • 68
Loading