#JavaScript (ES6), (削除) 56 (削除ここまで) 52 bytes
a=>![...a,1].some(x=>t>0/x?1:(t+=x-1)*x<0?t=0:0,t=0)
Arnauld
- 205.5k
- 21
- 187
- 670
Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack Exchange#JavaScript (ES6), (削除) 56 (削除ここまで) 52 bytes
a=>![...a,1].some(x=>t>0/x?1:(t+=x-1)*x<0?t=0:0,t=0)