Largest cosecutie sequence approach 3

it take more than 0(n) time i don’t why are you saying it take 0(n) time complexity because we not only iterate
array element but also we do extra work on strip (by while not loop )

when i submit this approach geeksforgeeks then my code not submit it say you take more time
can have any approach which solve this question in 0(N)
time

hello @khemchandrs,
No it is O(n) because all element is pushed in set exaclty once and we wont be accessing any element more than twice.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.