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

2 of 2
added 200 characters in body
hyperneutrino
  • 42.8k
  • 5
  • 72
  • 227

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!

hyperneutrino
  • 42.8k
  • 5
  • 72
  • 227

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