Haskell, (削除) 41 (削除ここまで) 47(削除) 47 (削除ここまで) 43 bytes
f l|w<l|w@"hello"<-take 5 l,w=="hello"=w|a5l=w|a:b<-l=a:f b|1<2=l
Haskell's laziness handles the infinite input/output quit well.
Edit: didn't handle finite input - fixed. Thanks @Leo for pointing out.
Edit II: @Ørjan Johansen saved 4 bytes. Thanks!
Haskell, (削除) 41 (削除ここまで) 47 bytes
f l|w<-take 5 l,w=="hello"=w|a:b<-l=a:f b|1<2=l
Haskell's laziness handles the infinite input/output quit well.
Edit: didn't handle finite input - fixed. Thanks @Leo for pointing out.
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.
Edit: didn't handle finite input - fixed. Thanks @Leo for pointing out.
Edit II: @Ørjan Johansen saved 4 bytes. Thanks!
Haskell, 41(削除) 41 (削除ここまで) 47 bytes
f l|w<-take 5 l,w=="hello"=w|a:b<-l=a:f bb|1<2=l
Haskell's laziness handles the infinite input/output quit well.
Edit: didn't handle finite input - fixed. Thanks @Leo for pointing out.
Haskell, 41 bytes
f l|w<-take 5 l,w=="hello"=w|a:b<-l=a:f b
Haskell's laziness handles the infinite input/output quit well.
Haskell, (削除) 41 (削除ここまで) 47 bytes
f l|w<-take 5 l,w=="hello"=w|a:b<-l=a:f b|1<2=l
Haskell's laziness handles the infinite input/output quit well.
Edit: didn't handle finite input - fixed. Thanks @Leo for pointing out.
Haskell, 41 bytes
f l|w<-take 5 l,w=="hello"=w|a:b<-l=a:f b
Haskell's laziness handles the infinite input/output quit well.
Haskell, 41 bytes
f l|w<-take 5 l,w=="hello"=w|a:b<-l=a:f b
Haskell's laziness handles the infinite input/output quit well.
Haskell, 41 bytes
f l|w<-take 5 l,w=="hello"=w|a:b<-l=a:f b
Haskell's laziness handles the infinite input/output quit well.