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 Answer

added 200 characters in body
Source Link
hyperneutrino
  • 42.8k
  • 5
  • 72
  • 227

Jelly, 87 bytes

ẆŒPe@\ƇḢẆŒPi\ƇḢ

Try it online! Try it online!

-1 byte thanks to Unrelated String

ẆŒPe@\ƇḢẆŒPi\ƇḢ  Main Link
 Ḣ Find the first
Ẇ slice (ordered by length)
 Ƈ where
 e@i  the right listlist's index is truthy (occurs in)
 ŒP the powerset (stable ordered)

1-indexing saves me a byte, thank you Dennis!

Jelly, 8 bytes

ẆŒPe@\ƇḢ

Try it online!

ẆŒPe@\ƇḢ Main Link
 Ḣ Find the first
Ẇ slice (ordered by length)
 Ƈ where
 e@ the right list occurs in
 ŒP the powerset (stable ordered)

Jelly, 7 bytes

ẆŒPi\ƇḢ

Try it online!

-1 byte thanks to Unrelated String

ẆŒPi\ƇḢ  Main Link
 Ḣ Find the first
Ẇ slice (ordered by length)
 Ƈ where
 i  the right list's index is truthy (occurs in)
 ŒP the powerset (stable ordered)

1-indexing saves me a byte, thank you Dennis!

Source Link
hyperneutrino
  • 42.8k
  • 5
  • 72
  • 227

Jelly, 8 bytes

ẆŒPe@\ƇḢ

Try it online!

ẆŒPe@\ƇḢ Main Link
 Ḣ Find the first
Ẇ slice (ordered by length)
 Ƈ where
 e@ the right list occurs in
 ŒP the powerset (stable ordered)

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