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

4 of 4
added 53 characters in body
nimi
  • 36k
  • 4
  • 35
  • 100

Haskell, (削除) 41 (削除ここまで) (削除) 47 (削除ここまで) 43 bytes

f l|w@"hello"<-take 5l=w|a:b<-l=a:f b|1<2=l

Haskell's laziness handles the infinite input/output quit well.

Try it online!

Edit: didn't handle finite input - fixed. Thanks @Leo for pointing out.

Edit II: @Ørjan Johansen saved 4 bytes. Thanks!

nimi
  • 36k
  • 4
  • 35
  • 100

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