Skip to main content
Simple golf
Source Link
user
  • 457
  • 2
  • 21
  • 71

Scala, 141132 bytes

n=>(for{i<-1 to n-1 j<-i+1 to n-1 p<-1.to(n).permutations}yield{valSet(ap.slice(0,bi)=p splitAt j;val,p.slice(ci,dj)=a splitAt i;Set(c,dp.slice(j,bn))map(_.toSet)}).toSet.size 

Try it online!Try it online!

Is it short? No. Is it efficient? No. Is it clever? No. Why did I make it? I...don't know. I'll try golfing it later, if possible.

Scala, 141 bytes

n=>(for{i<-1 to n-1 j<-i+1 to n-1 p<-1.to(n).permutations}yield{val(a,b)=p splitAt j;val(c,d)=a splitAt i;Set(c,d,b)map(_.toSet)}).toSet.size 

Try it online!

Is it short? No. Is it efficient? No. Is it clever? No. Why did I make it? I...don't know. I'll try golfing it later, if possible.

Scala, 132 bytes

n=>(for{i<-1 to n-1 j<-i+1 to n-1 p<-1.to(n).permutations}yield{Set(p.slice(0,i),p.slice(i,j),p.slice(j,n))map(_.toSet)}).toSet.size 

Try it online!

Is it short? No. Is it efficient? No. Is it clever? No. Why did I make it? I...don't know. I'll try golfing it later, if possible.

Source Link
user
  • 457
  • 2
  • 21
  • 71

Scala, 141 bytes

n=>(for{i<-1 to n-1 j<-i+1 to n-1 p<-1.to(n).permutations}yield{val(a,b)=p splitAt j;val(c,d)=a splitAt i;Set(c,d,b)map(_.toSet)}).toSet.size 

Try it online!

Is it short? No. Is it efficient? No. Is it clever? No. Why did I make it? I...don't know. I'll try golfing it later, if possible.