I have vector of numbers
std::vector numbers;
How to find the biggest sequence of some number passed like parameter ?
For example if I have like 0, 1, 1 , 3 , 2 , 0 , 0, 0, 6 , 0 , 0
and I am looking for 0 number I need to get start index 5 in this case.
Is there already some functions or combinations to achieve in stl or boost for this problem ? ( I cannot use C++11 )
I have vector of numbers std::vector numbers; How to find the biggest sequence of
Share
I do not think there is a standard function that does this for you, but you can program a relatively straightforward algorithm for it: