How to get first 1's index and last 1's index in a or-tools 1-D bool array? (or-tools)

后端 未结 0 1808
北海茫月
北海茫月 2021-02-07 18:24

I want to find out a first 1\'s index and last 1\'s index in a or-tools 1-D bool array , it look like this: if the array=[0,0,1,0,1,0,1,0] , I wish to get first_one_index = 2 a

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