How can I find a specific pattern in a list?

后端 未结 0 733
攒了一身酷
攒了一身酷 2020-11-21 08:37

Given a list of numbers containing either 0\'s, 1\'s, or -1\'s, how can I find the longest portion of the list that starts with a +1 and ends with a -1.

For example,

相关标签:
回答
  • 消灭零回复
提交回复
热议问题