Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Revisions

1 of 5
digEmAll
  • 5.1k
  • 15
  • 22

R, 110 bytes

function(v,s,r=v,`+`=length){combn(+v,+s,function(y,x=sort(y),a=v[x:x[+x]]){if(all(v[x]==s)&+r>+a)r<<-a;0});r}

Try it online!

Explanation in progress...

digEmAll
  • 5.1k
  • 15
  • 22

AltStyle によって変換されたページ (->オリジナル) /