elif(not(flag) and curr<prev):
What does not(flag) mean here? What is it doing?
elif(not(flag) and curr<prev):
What does not(flag) mean here? What is it doing?
hey @prakhar.kamal.met17 ,
In the case you are refering too,
not is actually a not operation , mean it reverse the value of a boolean input , like True to False , or False to True.
So here if you consider flag =1
not(flag) will first convert it to boolean means not(True) and then interpret its output as False.
I hope this helped.
And Sir what is its role overthere? Like why are we not using just a single condition in the third elif statement? Why are we using not(flag) and curr<prev together?
there is no such hardcore rule , that you need to implement in this way only.
Its just a method to solve this , if you have any other algorithm in your mind then you can use that.
For current, i will need to check the whole code once. I can’t tell you like this
Can you please check it once and clear my doubt please.

share me the code link please.

here the flag is just used to check or continue the increasing sequence.
flag to set that , the last number recieved was a valid number and we can continue else , we need to break at that moment
Okay okay. Got it. Thank you so much!
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.